5#include "testing/testing.h"
8#include <pxr/usd/usd/prim.h>
9#include <pxr/usd/usd/stage.h>
53 BlendfileLoadingBaseTest::SetUp();
87 <<
"Blender scene should have 4 objects.";
93 ASSERT_EQ(original_cwd, original_cwd_buff)
94 <<
"BLI_current_working_dir is not expected to return a different value than the given char "
98 params.export_materials =
false;
99 params.convert_world_material =
false;
100 params.visible_objects_only =
false;
103 ASSERT_TRUE(result) <<
"usd export to " <<
output_filepath <<
" failed.";
106 ASSERT_TRUE(
bool(
stage)) <<
"unable to open stage for the exported usdz file.";
108 std::string prim_name = pxr::TfMakeValidIdentifier(
"Cube");
109 pxr::UsdPrim test_prim =
stage->GetPrimAtPath(pxr::SdfPath(
"/Cube/" + prim_name));
110 EXPECT_TRUE(
bool(test_prim)) <<
"Cube prim should exist in exported usdz file.";
112 prim_name = pxr::TfMakeValidIdentifier(
"Cylinder");
113 test_prim =
stage->GetPrimAtPath(pxr::SdfPath(
"/Cylinder/" + prim_name));
114 EXPECT_TRUE(
bool(test_prim)) <<
"Cylinder prim should exist in exported usdz file.";
116 prim_name = pxr::TfMakeValidIdentifier(
"Icosphere");
117 test_prim =
stage->GetPrimAtPath(pxr::SdfPath(
"/Icosphere/" + prim_name));
118 EXPECT_TRUE(
bool(test_prim)) <<
"Icosphere prim should exist in exported usdz file.";
120 prim_name = pxr::TfMakeValidIdentifier(
"Sphere");
121 test_prim =
stage->GetPrimAtPath(pxr::SdfPath(
"/Sphere/" + prim_name));
122 EXPECT_TRUE(
bool(test_prim)) <<
"Sphere prim should exist in exported usdz file.";
128 ASSERT_EQ(final_cwd, final_cwd_buff) <<
"BLI_current_working_dir is not expected to return "
129 "a different value than the given char buffer.";
130 EXPECT_TRUE(
STREQ(original_cwd, final_cwd))
131 <<
"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 struct 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
virtual void SetUp() override
bool load_file_and_depsgraph(const StringRefNull &filepath, const eEvaluationMode eval_mode=DAG_EVAL_VIEWPORT)
virtual void TearDown() override
char temp_output_dir[FILE_MAX]
char output_filepath[FILE_MAX]
bool USD_export(const bContext *C, const char *filepath, const USDExportParams *params, bool as_background_job, ReportList *reports)
TEST_F(UsdCurvesTest, usd_export_curves)
const StringRefNull usdz_export_test_filename