diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-10 10:19:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-10 14:04:51 +0300 |
commit | 2abfcebb0eb7989e3d1e7d03f37ecf5c088210af (patch) | |
tree | e7a1ad5912b4661d4ece743f4f7fd86e6bf4d3c4 /source/blender/io/alembic | |
parent | c735aca42e9f5961fec7e5d5fc196b5bd6b85f56 (diff) |
Cleanup: use C comments for descriptive text
Follow our code style guide by using C-comments for text descriptions.
Diffstat (limited to 'source/blender/io/alembic')
6 files changed, 51 insertions, 51 deletions
diff --git a/source/blender/io/alembic/exporter/abc_archive.cc b/source/blender/io/alembic/exporter/abc_archive.cc index a181a721de9..68ad2089a3e 100644 --- a/source/blender/io/alembic/exporter/abc_archive.cc +++ b/source/blender/io/alembic/exporter/abc_archive.cc @@ -177,10 +177,10 @@ ABCArchive::ABCArchive(const Main *bmain, double scene_fps = FPS; MetaData abc_metadata = create_abc_metadata(bmain, scene_fps); - // Create the Archive. + /* Create the Archive. */ archive = create_archive(&abc_ostream_, filename, abc_metadata); - // Create time samples for transforms and shapes. + /* Create time samples for transforms and shapes. */ TimeSamplingPtr ts_xform; TimeSamplingPtr ts_shapes; @@ -197,11 +197,11 @@ ABCArchive::ABCArchive(const Main *bmain, time_sampling_index_shapes_ = archive->addTimeSampling(*ts_shapes); } - // Construct the frames to export. + /* Construct the frames to export. */ get_frames(scene_fps, params, params.frame_samples_xform, xform_frames_); get_frames(scene_fps, params, params.frame_samples_shape, shape_frames_); - // Merge all frames to get the final set of frames to export. + /* Merge all frames to get the final set of frames to export. */ export_frames_.insert(xform_frames_.begin(), xform_frames_.end()); export_frames_.insert(shape_frames_.begin(), shape_frames_.end()); diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index c22864a5433..892109dc578 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -64,7 +64,7 @@ struct ExportJobData { namespace blender::io::alembic { -// Construct the depsgraph for exporting. +/* Construct the depsgraph for exporting. */ static void build_depsgraph(Depsgraph *depsgraph, const bool visible_objects_only) { if (visible_objects_only) { @@ -99,12 +99,12 @@ static void export_startjob(void *customdata, } BKE_scene_graph_update_tagged(data->depsgraph, data->bmain); - // For restoring the current frame after exporting animation is done. + /* For restoring the current frame after exporting animation is done. */ Scene *scene = DEG_get_input_scene(data->depsgraph); const int orig_frame = CFRA; const bool export_animation = (data->params.frame_start != data->params.frame_end); - // Create the Alembic archive. + /* Create the Alembic archive. */ std::unique_ptr<ABCArchive> abc_archive; try { abc_archive = std::make_unique<ABCArchive>( @@ -115,15 +115,15 @@ static void export_startjob(void *customdata, error_message_stream << "Error writing to " << data->filename; const std::string &error_message = error_message_stream.str(); - // The exception message can be very cryptic (just "iostream error" on Linux, for example), so - // better not to include it in the report. + /* The exception message can be very cryptic (just "iostream error" on Linux, for example), + * so better not to include it in the report. */ CLOG_ERROR(&LOG, "%s: %s", error_message.c_str(), ex.what()); WM_report(RPT_ERROR, error_message.c_str()); data->export_ok = false; return; } catch (...) { - // Unknown exception class, so we cannot include its message. + /* Unknown exception class, so we cannot include its message. */ std::stringstream error_message_stream; error_message_stream << "Unknown error writing to " << data->filename; WM_report(RPT_ERROR, error_message_stream.str().c_str()); @@ -136,7 +136,7 @@ static void export_startjob(void *customdata, if (export_animation) { CLOG_INFO(&LOG, 2, "Exporting animation"); - // Writing the animated frames is not 100% of the work, but it's our best guess. + /* Writing the animated frames is not 100% of the work, but it's our best guess. */ const float progress_per_frame = 1.0f / std::max(size_t(1), abc_archive->total_frame_count()); ABCArchive::Frames::const_iterator frame_it = abc_archive->frames_begin(); const ABCArchive::Frames::const_iterator frames_end = abc_archive->frames_end(); @@ -148,7 +148,7 @@ static void export_startjob(void *customdata, break; } - // Update the scene for the next frame to render. + /* Update the scene for the next frame to render. */ scene->r.cfra = static_cast<int>(frame); scene->r.subframe = frame - scene->r.cfra; BKE_scene_graph_update_for_newframe(data->depsgraph); @@ -163,13 +163,13 @@ static void export_startjob(void *customdata, } } else { - // If we're not animating, a single iteration over all objects is enough. + /* If we're not animating, a single iteration over all objects is enough. */ iter.iterate_and_write(); } iter.release_writers(); - // Finish up by going back to the keyframe that was current before we started. + /* Finish up by going back to the keyframe that was current before we started. */ if (CFRA != orig_frame) { CFRA = orig_frame; BKE_scene_graph_update_for_newframe(data->depsgraph); diff --git a/source/blender/io/alembic/exporter/abc_writer_transform.cc b/source/blender/io/alembic/exporter/abc_writer_transform.cc index 79e460e56e9..7b1fa87de64 100644 --- a/source/blender/io/alembic/exporter/abc_writer_transform.cc +++ b/source/blender/io/alembic/exporter/abc_writer_transform.cc @@ -66,10 +66,10 @@ const IDProperty *ABCTransformWriter::get_id_properties(const HierarchyContext & void ABCTransformWriter::do_write(HierarchyContext &context) { - float parent_relative_matrix[4][4]; // The object matrix relative to the parent. + float parent_relative_matrix[4][4]; /* The object matrix relative to the parent. */ mul_m4_m4m4(parent_relative_matrix, context.parent_matrix_inv_world, context.matrix_world); - // After this, parent_relative_matrix uses Y=up. + /* After this, parent_relative_matrix uses Y=up. */ copy_m44_axis_swap(parent_relative_matrix, parent_relative_matrix, ABC_YUP_FROM_ZUP); /* If the parent is a camera, undo its to-Maya rotation (see below). */ diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index b7fcdbc2087..31a8cf46fa7 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -339,11 +339,11 @@ static void process_normals(CDStreamConfig &config, Alembic::AbcGeom::GeometryScope scope = normals.getScope(); switch (scope) { - case Alembic::AbcGeom::kFacevaryingScope: // 'Vertex Normals' in Houdini. + case Alembic::AbcGeom::kFacevaryingScope: /* 'Vertex Normals' in Houdini. */ process_loop_normals(config, normsamp.getVals()); break; case Alembic::AbcGeom::kVertexScope: - case Alembic::AbcGeom::kVaryingScope: // 'Point Normals' in Houdini. + case Alembic::AbcGeom::kVaryingScope: /* 'Point Normals' in Houdini. */ process_vertex_normals(config, normsamp.getVals()); break; case Alembic::AbcGeom::kConstantScope: @@ -614,7 +614,7 @@ bool AbcMeshReader::topology_changed(Mesh *existing_mesh, const ISampleSelector m_schema.getName().c_str(), sample_sel.getRequestedTime(), ex.what()); - // A similar error in read_mesh() would just return existing_mesh. + /* A similar error in read_mesh() would just return existing_mesh. */ return false; } diff --git a/source/blender/io/alembic/tests/abc_export_test.cc b/source/blender/io/alembic/tests/abc_export_test.cc index 625dbfd176f..e1a9bd34f6b 100644 --- a/source/blender/io/alembic/tests/abc_export_test.cc +++ b/source/blender/io/alembic/tests/abc_export_test.cc @@ -1,6 +1,6 @@ #include "testing/testing.h" -// Keep first since utildefines defines AT which conflicts with STL +/* Keep first since utildefines defines AT which conflicts with STL */ #include "exporter/abc_archive.h" #include "intern/abc_util.h" @@ -49,7 +49,7 @@ class AlembicExportTest : public testing::Test { deleteArchive(); } - // Call after setting up the parameters. + /* Call after setting up the parameters. */ void createArchive() { if (abc_archive != nullptr) { @@ -108,28 +108,28 @@ TEST_F(AlembicExportTest, TimeSamplesFullShutterDifferent) createArchive(); std::vector<double> frames(abc_archive->frames_begin(), abc_archive->frames_end()); EXPECT_EQ(8, frames.size()); - EXPECT_NEAR(31.0, frames[0], 1e-5); // transform + shape + EXPECT_NEAR(31.0, frames[0], 1e-5); /* transform + shape */ EXPECT_TRUE(abc_archive->is_xform_frame(frames[0])); EXPECT_TRUE(abc_archive->is_shape_frame(frames[0])); - EXPECT_NEAR(31.33333, frames[1], 1e-5); // transform + EXPECT_NEAR(31.33333, frames[1], 1e-5); /* transform */ EXPECT_TRUE(abc_archive->is_xform_frame(frames[1])); EXPECT_FALSE(abc_archive->is_shape_frame(frames[1])); - EXPECT_NEAR(31.5, frames[2], 1e-5); // shape + EXPECT_NEAR(31.5, frames[2], 1e-5); /* shape */ EXPECT_FALSE(abc_archive->is_xform_frame(frames[2])); EXPECT_TRUE(abc_archive->is_shape_frame(frames[2])); - EXPECT_NEAR(31.66666, frames[3], 1e-5); // transform + EXPECT_NEAR(31.66666, frames[3], 1e-5); /* transform */ EXPECT_TRUE(abc_archive->is_xform_frame(frames[3])); EXPECT_FALSE(abc_archive->is_shape_frame(frames[3])); - EXPECT_NEAR(32.0, frames[4], 1e-5); // transform + shape + EXPECT_NEAR(32.0, frames[4], 1e-5); /* transform + shape */ EXPECT_TRUE(abc_archive->is_xform_frame(frames[4])); EXPECT_TRUE(abc_archive->is_shape_frame(frames[4])); - EXPECT_NEAR(32.33333, frames[5], 1e-5); // transform + EXPECT_NEAR(32.33333, frames[5], 1e-5); /* transform */ EXPECT_TRUE(abc_archive->is_xform_frame(frames[5])); EXPECT_FALSE(abc_archive->is_shape_frame(frames[5])); - EXPECT_NEAR(32.5, frames[6], 1e-5); // shape + EXPECT_NEAR(32.5, frames[6], 1e-5); /* shape */ EXPECT_FALSE(abc_archive->is_xform_frame(frames[6])); EXPECT_TRUE(abc_archive->is_shape_frame(frames[6])); - EXPECT_NEAR(32.66666, frames[7], 1e-5); // transform + EXPECT_NEAR(32.66666, frames[7], 1e-5); /* transform */ EXPECT_TRUE(abc_archive->is_xform_frame(frames[7])); EXPECT_FALSE(abc_archive->is_shape_frame(frames[7])); } diff --git a/source/blender/io/alembic/tests/abc_matrix_test.cc b/source/blender/io/alembic/tests/abc_matrix_test.cc index 02ef1a99348..fc5b645987e 100644 --- a/source/blender/io/alembic/tests/abc_matrix_test.cc +++ b/source/blender/io/alembic/tests/abc_matrix_test.cc @@ -10,15 +10,15 @@ namespace blender::io::alembic { TEST(abc_matrix, CreateRotationMatrixY_YfromZ) { - // Input variables + /* Input variables */ float rot_x_mat[3][3]; float rot_y_mat[3][3]; float rot_z_mat[3][3]; float euler[3] = {0.f, M_PI_4, 0.f}; - // Construct expected matrices + /* Construct expected matrices */ float unit[3][3]; - float rot_z_min_quart_pi[3][3]; // rotation of -pi/4 radians over z-axis + float rot_z_min_quart_pi[3][3]; /* rotation of -pi/4 radians over z-axis */ unit_m3(unit); unit_m3(rot_z_min_quart_pi); @@ -27,7 +27,7 @@ TEST(abc_matrix, CreateRotationMatrixY_YfromZ) rot_z_min_quart_pi[1][0] = M_SQRT1_2; rot_z_min_quart_pi[1][1] = M_SQRT1_2; - // Run tests + /* Run tests */ create_swapped_rotation_matrix(rot_x_mat, rot_y_mat, rot_z_mat, euler, ABC_YUP_FROM_ZUP); EXPECT_M3_NEAR(rot_x_mat, unit, 1e-5f); @@ -37,15 +37,15 @@ TEST(abc_matrix, CreateRotationMatrixY_YfromZ) TEST(abc_matrix, CreateRotationMatrixZ_YfromZ) { - // Input variables + /* Input variables */ float rot_x_mat[3][3]; float rot_y_mat[3][3]; float rot_z_mat[3][3]; float euler[3] = {0.f, 0.f, M_PI_4}; - // Construct expected matrices + /* Construct expected matrices */ float unit[3][3]; - float rot_y_quart_pi[3][3]; // rotation of pi/4 radians over y-axis + float rot_y_quart_pi[3][3]; /* rotation of pi/4 radians over y-axis */ unit_m3(unit); unit_m3(rot_y_quart_pi); @@ -54,7 +54,7 @@ TEST(abc_matrix, CreateRotationMatrixZ_YfromZ) rot_y_quart_pi[2][0] = M_SQRT1_2; rot_y_quart_pi[2][2] = M_SQRT1_2; - // Run tests + /* Run tests */ create_swapped_rotation_matrix(rot_x_mat, rot_y_mat, rot_z_mat, euler, ABC_YUP_FROM_ZUP); EXPECT_M3_NEAR(rot_x_mat, unit, 1e-5f); @@ -64,17 +64,17 @@ TEST(abc_matrix, CreateRotationMatrixZ_YfromZ) TEST(abc_matrix, CreateRotationMatrixXYZ_YfromZ) { - // Input variables + /* Input variables */ float rot_x_mat[3][3]; float rot_y_mat[3][3]; float rot_z_mat[3][3]; - // in degrees: X=10, Y=20, Z=30 + /* in degrees: X=10, Y=20, Z=30 */ float euler[3] = {0.17453292012214f, 0.34906581044197f, 0.52359879016876f}; - // Construct expected matrices - float rot_x_p10[3][3]; // rotation of +10 degrees over x-axis - float rot_y_p30[3][3]; // rotation of +30 degrees over y-axis - float rot_z_m20[3][3]; // rotation of -20 degrees over z-axis + /* Construct expected matrices */ + float rot_x_p10[3][3]; /* rotation of +10 degrees over x-axis */ + float rot_y_p30[3][3]; /* rotation of +30 degrees over y-axis */ + float rot_z_m20[3][3]; /* rotation of -20 degrees over z-axis */ unit_m3(rot_x_p10); rot_x_p10[1][1] = 0.9848077297210693f; @@ -94,7 +94,7 @@ TEST(abc_matrix, CreateRotationMatrixXYZ_YfromZ) rot_z_m20[1][0] = 0.3420201241970062f; rot_z_m20[1][1] = 0.9396926164627075f; - // Run tests + /* Run tests */ create_swapped_rotation_matrix(rot_x_mat, rot_y_mat, rot_z_mat, euler, ABC_YUP_FROM_ZUP); EXPECT_M3_NEAR(rot_x_mat, rot_x_p10, 1e-5f); @@ -104,17 +104,17 @@ TEST(abc_matrix, CreateRotationMatrixXYZ_YfromZ) TEST(abc_matrix, CreateRotationMatrixXYZ_ZfromY) { - // Input variables + /* Input variables */ float rot_x_mat[3][3]; float rot_y_mat[3][3]; float rot_z_mat[3][3]; - // in degrees: X=10, Y=20, Z=30 + /* in degrees: X=10, Y=20, Z=30 */ float euler[3] = {0.1745329201221466f, 0.3490658104419708f, 0.5235987901687622f}; - // Construct expected matrices - float rot_x_p10[3][3]; // rotation of +10 degrees over x-axis - float rot_y_m30[3][3]; // rotation of -30 degrees over y-axis - float rot_z_p20[3][3]; // rotation of +20 degrees over z-axis + /* Construct expected matrices */ + float rot_x_p10[3][3]; /* rotation of +10 degrees over x-axis */ + float rot_y_m30[3][3]; /* rotation of -30 degrees over y-axis */ + float rot_z_p20[3][3]; /* rotation of +20 degrees over z-axis */ unit_m3(rot_x_p10); rot_x_p10[1][1] = 0.9848077297210693f; @@ -134,7 +134,7 @@ TEST(abc_matrix, CreateRotationMatrixXYZ_ZfromY) rot_z_p20[1][0] = -0.3420201241970062f; rot_z_p20[1][1] = 0.9396926164627075f; - // Run tests + /* Run tests */ create_swapped_rotation_matrix(rot_x_mat, rot_y_mat, rot_z_mat, euler, ABC_ZUP_FROM_YUP); EXPECT_M3_NEAR(rot_x_mat, rot_x_p10, 1e-5f); |