main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
2 changed files with 14 additions and 14 deletions
Showing only changes of commit 78e8c6649d - Show all commits

View File

@ -64,7 +64,7 @@ static int wm_ply_export_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "No filename given"); BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
struct PLYExportParams export_params; struct PLYExportParams export_params = {"\0"};
export_params.file_base_for_tests[0] = '\0'; export_params.file_base_for_tests[0] = '\0';
RNA_string_get(op->ptr, "filepath", export_params.filepath); RNA_string_get(op->ptr, "filepath", export_params.filepath);
export_params.blen_filepath = CTX_data_main(C)->filepath; export_params.blen_filepath = CTX_data_main(C)->filepath;

View File

@ -125,7 +125,7 @@ static std::vector<char> read_temp_file_in_vectorchar(const std::string &file_pa
TEST_F(PlyExportTest, WriteHeaderAscii) TEST_F(PlyExportTest, WriteHeaderAscii)
{ {
std::string filePath = get_temp_ply_filename(temp_file_path); std::string filePath = get_temp_ply_filename(temp_file_path);
PLYExportParams _params; PLYExportParams _params = {};
_params.ascii_format = true; _params.ascii_format = true;
_params.export_normals = false; _params.export_normals = false;
_params.vertex_colors = PLY_VERTEX_COLOR_NONE; _params.vertex_colors = PLY_VERTEX_COLOR_NONE;
@ -163,7 +163,7 @@ TEST_F(PlyExportTest, WriteHeaderAscii)
TEST_F(PlyExportTest, WriteHeaderBinary) TEST_F(PlyExportTest, WriteHeaderBinary)
{ {
std::string filePath = get_temp_ply_filename(temp_file_path); std::string filePath = get_temp_ply_filename(temp_file_path);
PLYExportParams _params; PLYExportParams _params = {};
_params.ascii_format = false; _params.ascii_format = false;
_params.export_normals = false; _params.export_normals = false;
_params.vertex_colors = PLY_VERTEX_COLOR_NONE; _params.vertex_colors = PLY_VERTEX_COLOR_NONE;
@ -201,7 +201,7 @@ TEST_F(PlyExportTest, WriteHeaderBinary)
TEST_F(PlyExportTest, WriteVerticesAscii) TEST_F(PlyExportTest, WriteVerticesAscii)
{ {
std::string filePath = get_temp_ply_filename(temp_file_path); std::string filePath = get_temp_ply_filename(temp_file_path);
PLYExportParams _params; PLYExportParams _params = {};
_params.ascii_format = true; _params.ascii_format = true;
_params.export_normals = false; _params.export_normals = false;
_params.vertex_colors = PLY_VERTEX_COLOR_NONE; _params.vertex_colors = PLY_VERTEX_COLOR_NONE;
@ -233,7 +233,7 @@ TEST_F(PlyExportTest, WriteVerticesAscii)
TEST_F(PlyExportTest, WriteVerticesBinary) TEST_F(PlyExportTest, WriteVerticesBinary)
{ {
std::string filePath = get_temp_ply_filename(temp_file_path); std::string filePath = get_temp_ply_filename(temp_file_path);
PLYExportParams _params; PLYExportParams _params = {};
_params.ascii_format = false; _params.ascii_format = false;
_params.export_normals = false; _params.export_normals = false;
_params.vertex_colors = PLY_VERTEX_COLOR_NONE; _params.vertex_colors = PLY_VERTEX_COLOR_NONE;
@ -275,7 +275,7 @@ TEST_F(PlyExportTest, WriteVerticesBinary)
TEST_F(PlyExportTest, WriteFacesAscii) TEST_F(PlyExportTest, WriteFacesAscii)
{ {
std::string filePath = get_temp_ply_filename(temp_file_path); std::string filePath = get_temp_ply_filename(temp_file_path);
PLYExportParams _params; PLYExportParams _params = {};
_params.ascii_format = true; _params.ascii_format = true;
_params.export_normals = false; _params.export_normals = false;
_params.vertex_colors = PLY_VERTEX_COLOR_NONE; _params.vertex_colors = PLY_VERTEX_COLOR_NONE;
@ -305,7 +305,7 @@ TEST_F(PlyExportTest, WriteFacesAscii)
TEST_F(PlyExportTest, WriteFacesBinary) TEST_F(PlyExportTest, WriteFacesBinary)
{ {
std::string filePath = get_temp_ply_filename(temp_file_path); std::string filePath = get_temp_ply_filename(temp_file_path);
PLYExportParams _params; PLYExportParams _params = {};
_params.ascii_format = false; _params.ascii_format = false;
_params.export_normals = false; _params.export_normals = false;
_params.vertex_colors = PLY_VERTEX_COLOR_NONE; _params.vertex_colors = PLY_VERTEX_COLOR_NONE;
@ -348,7 +348,7 @@ TEST_F(PlyExportTest, WriteFacesBinary)
TEST_F(PlyExportTest, WriteVertexNormalsAscii) TEST_F(PlyExportTest, WriteVertexNormalsAscii)
{ {
std::string filePath = get_temp_ply_filename(temp_file_path); std::string filePath = get_temp_ply_filename(temp_file_path);
PLYExportParams _params; PLYExportParams _params = {};
_params.ascii_format = true; _params.ascii_format = true;
_params.export_normals = true; _params.export_normals = true;
_params.vertex_colors = PLY_VERTEX_COLOR_NONE; _params.vertex_colors = PLY_VERTEX_COLOR_NONE;
@ -380,7 +380,7 @@ TEST_F(PlyExportTest, WriteVertexNormalsAscii)
TEST_F(PlyExportTest, WriteVertexNormalsBinary) TEST_F(PlyExportTest, WriteVertexNormalsBinary)
{ {
std::string filePath = get_temp_ply_filename(temp_file_path); std::string filePath = get_temp_ply_filename(temp_file_path);
PLYExportParams _params; PLYExportParams _params = {};
_params.ascii_format = false; _params.ascii_format = false;
_params.export_normals = true; _params.export_normals = true;
_params.vertex_colors = PLY_VERTEX_COLOR_NONE; _params.vertex_colors = PLY_VERTEX_COLOR_NONE;
@ -450,14 +450,14 @@ class ply_exporter_ply_data_test : public PlyExportTest {
TEST_F(ply_exporter_ply_data_test, CubeLoadPLYDataVertices) TEST_F(ply_exporter_ply_data_test, CubeLoadPLYDataVertices)
{ {
PLYExportParams params; PLYExportParams params = {};
PlyData plyData = load_ply_data_from_blendfile("io_tests/blend_geometry/cube_all_data.blend", PlyData plyData = load_ply_data_from_blendfile("io_tests/blend_geometry/cube_all_data.blend",
params); params);
EXPECT_EQ(plyData.vertices.size(), 8); EXPECT_EQ(plyData.vertices.size(), 8);
} }
TEST_F(ply_exporter_ply_data_test, CubeLoadPLYDataUV) TEST_F(ply_exporter_ply_data_test, CubeLoadPLYDataUV)
{ {
PLYExportParams params; PLYExportParams params = {};
params.export_uv = true; params.export_uv = true;
PlyData plyData = load_ply_data_from_blendfile("io_tests/blend_geometry/cube_all_data.blend", PlyData plyData = load_ply_data_from_blendfile("io_tests/blend_geometry/cube_all_data.blend",
params); params);
@ -465,16 +465,16 @@ TEST_F(ply_exporter_ply_data_test, CubeLoadPLYDataUV)
} }
TEST_F(ply_exporter_ply_data_test, SuzanneLoadPLYDataUV) TEST_F(ply_exporter_ply_data_test, SuzanneLoadPLYDataUV)
{ {
PLYExportParams params; PLYExportParams params = {};
params.export_uv = true; params.export_uv = true;
PlyData plyData = load_ply_data_from_blendfile("io_tests/blend_geometry/suzanne_all_data.blend", PlyData plyData = load_ply_data_from_blendfile("io_tests/blend_geometry/suzanne_all_data.blend",
params); params);
EXPECT_EQ(plyData.uv_coordinates.size(), 541); EXPECT_EQ(plyData.uv_coordinates.size(), 542);
} }
TEST_F(ply_exporter_ply_data_test, CubeLoadPLYDataUVDisabled) TEST_F(ply_exporter_ply_data_test, CubeLoadPLYDataUVDisabled)
{ {
PLYExportParams params; PLYExportParams params = {};
params.export_uv = false; params.export_uv = false;
PlyData plyData = load_ply_data_from_blendfile("io_tests/blend_geometry/cube_all_data.blend", PlyData plyData = load_ply_data_from_blendfile("io_tests/blend_geometry/cube_all_data.blend",
params); params);