5#include "testing/testing.h"
8#include <pxr/usd/usd/prim.h>
9#include <pxr/usd/usd/stage.h>
52 BlendfileLoadingBaseTest::SetUp();
86 <<
"Blender scene should have 4 objects.";
92 ASSERT_EQ(original_cwd, original_cwd_buff)
93 <<
"BLI_current_working_dir is not expected to return a different value than the given char "
97 params.export_materials =
false;
98 params.convert_world_material =
false;
99 params.visible_objects_only =
false;
105 ASSERT_TRUE(
bool(stage)) <<
"unable to open stage for the exported usdz file.";
107 std::string prim_name = pxr::TfMakeValidIdentifier(
"Cube");
108 pxr::UsdPrim test_prim = stage->GetPrimAtPath(pxr::SdfPath(
"/Cube/" + prim_name));
109 EXPECT_TRUE(
bool(test_prim)) <<
"Cube prim should exist in exported usdz file.";
111 prim_name = pxr::TfMakeValidIdentifier(
"Cylinder");
112 test_prim = stage->GetPrimAtPath(pxr::SdfPath(
"/Cylinder/" + prim_name));
113 EXPECT_TRUE(
bool(test_prim)) <<
"Cylinder prim should exist in exported usdz file.";
115 prim_name = pxr::TfMakeValidIdentifier(
"Icosphere");
116 test_prim = stage->GetPrimAtPath(pxr::SdfPath(
"/Icosphere/" + prim_name));
117 EXPECT_TRUE(
bool(test_prim)) <<
"Icosphere prim should exist in exported usdz file.";
119 prim_name = pxr::TfMakeValidIdentifier(
"Sphere");
120 test_prim = stage->GetPrimAtPath(pxr::SdfPath(
"/Sphere/" + prim_name));
121 EXPECT_TRUE(
bool(test_prim)) <<
"Sphere prim should exist in exported usdz file.";
127 ASSERT_EQ(final_cwd, final_cwd_buff) <<
"BLI_current_working_dir is not expected to return "
128 "a different value than the given char buffer.";
129 EXPECT_TRUE(
STREQ(original_cwd, final_cwd))
130 <<
"Final CWD should be the same as the original one.";
void BKE_tempdir_init(const char *userdir)
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
void CTX_data_main_set(bContext *C, Main *bmain)
void CTX_free(bContext *C)
void CTX_data_scene_set(bContext *C, Scene *scene)
File and directory operations.
bool BLI_dir_create_recursive(const char *dirname) ATTR_NONNULL()
int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL()
char * BLI_current_working_dir(char *dir, size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLI_path_join(...)
external readfile function prototypes.
virtual void depsgraph_create(eEvaluationMode depsgraph_evaluation_mode)
bool blendfile_load(const char *filepath)
struct BlendFileData * bfile
constexpr const char * c_str() const
bool load_file_and_depsgraph(const StringRefNull &filepath, const eEvaluationMode eval_mode=DAG_EVAL_VIEWPORT)
char temp_output_dir[FILE_MAX]
TEST_F(UsdExportTest, usd_export_rain_mesh)
char output_filepath[FILE_MAX]
bool USD_export(const bContext *C, const char *filepath, const USDExportParams *params, bool as_background_job, ReportList *reports)
const StringRefNull usdz_export_test_filename