Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/io')
-rw-r--r--source/blender/io/alembic/exporter/abc_archive.cc8
-rw-r--r--source/blender/io/alembic/exporter/abc_export_capi.cc20
-rw-r--r--source/blender/io/alembic/exporter/abc_writer_transform.cc4
-rw-r--r--source/blender/io/alembic/intern/abc_reader_mesh.cc6
-rw-r--r--source/blender/io/alembic/tests/abc_export_test.cc20
-rw-r--r--source/blender/io/alembic/tests/abc_matrix_test.cc44
-rw-r--r--source/blender/io/collada/AnimationExporter.h10
-rw-r--r--source/blender/io/collada/AnimationImporter.h28
-rw-r--r--source/blender/io/collada/ArmatureExporter.cpp36
-rw-r--r--source/blender/io/collada/ArmatureExporter.h18
-rw-r--r--source/blender/io/collada/ArmatureImporter.cpp8
-rw-r--r--source/blender/io/collada/ArmatureImporter.h25
-rw-r--r--source/blender/io/collada/BCAnimationCurve.cpp6
-rw-r--r--source/blender/io/collada/BCAnimationCurve.h2
-rw-r--r--source/blender/io/collada/BCAnimationSampler.cpp16
-rw-r--r--source/blender/io/collada/BCAnimationSampler.h2
-rw-r--r--source/blender/io/collada/BCMath.cpp3
-rw-r--r--source/blender/io/collada/BCSampleData.h2
-rw-r--r--source/blender/io/collada/BlenderContext.cpp2
-rw-r--r--source/blender/io/collada/ControllerExporter.cpp8
-rw-r--r--source/blender/io/collada/ControllerExporter.h10
-rw-r--r--source/blender/io/collada/DocumentExporter.cpp40
-rw-r--r--source/blender/io/collada/DocumentImporter.cpp16
-rw-r--r--source/blender/io/collada/DocumentImporter.h8
-rw-r--r--source/blender/io/collada/EffectExporter.cpp20
-rw-r--r--source/blender/io/collada/ErrorHandler.h2
-rw-r--r--source/blender/io/collada/ExtraHandler.h2
-rw-r--r--source/blender/io/collada/GeometryExporter.cpp6
-rw-r--r--source/blender/io/collada/LightExporter.cpp12
-rw-r--r--source/blender/io/collada/MaterialExporter.cpp2
-rw-r--r--source/blender/io/collada/MaterialExporter.h6
-rw-r--r--source/blender/io/collada/Materials.cpp50
-rw-r--r--source/blender/io/collada/MeshImporter.cpp186
-rw-r--r--source/blender/io/collada/SkinInfo.h42
-rw-r--r--source/blender/io/collada/TransformReader.cpp10
-rw-r--r--source/blender/io/collada/TransformReader.h2
-rw-r--r--source/blender/io/collada/collada_internal.cpp16
-rw-r--r--source/blender/io/collada/collada_internal.h4
-rw-r--r--source/blender/io/common/IO_abstract_hierarchy_iterator.h12
-rw-r--r--source/blender/io/common/intern/abstract_hierarchy_iterator.cc71
-rw-r--r--source/blender/io/common/intern/abstract_hierarchy_iterator_test.cc34
-rw-r--r--source/blender/io/common/intern/object_identifier_test.cc4
-rw-r--r--source/blender/io/usd/intern/usd_capi.cc14
-rw-r--r--source/blender/io/usd/intern/usd_writer_abstract.cc12
-rw-r--r--source/blender/io/usd/intern/usd_writer_camera.cc2
-rw-r--r--source/blender/io/usd/intern/usd_writer_hair.cc2
-rw-r--r--source/blender/io/usd/intern/usd_writer_mesh.cc8
-rw-r--r--source/blender/io/usd/intern/usd_writer_transform.cc4
48 files changed, 435 insertions, 430 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);
diff --git a/source/blender/io/collada/AnimationExporter.h b/source/blender/io/collada/AnimationExporter.h
index 2d38a541347..fd691184e8b 100644
--- a/source/blender/io/collada/AnimationExporter.h
+++ b/source/blender/io/collada/AnimationExporter.h
@@ -39,7 +39,7 @@
#include "BLI_utildefines.h"
#include "BIK_api.h"
-#include "BKE_action.h" // pose functions
+#include "BKE_action.h" /* pose functions */
#include "BKE_armature.h"
#include "BKE_constraint.h"
#include "BKE_fcurve.h"
@@ -69,7 +69,7 @@
#include "IK_solver.h"
-#include <algorithm> // std::find
+#include <algorithm> /* std::find */
#include <map>
#include <vector>
@@ -100,7 +100,7 @@ class AnimationExporter : COLLADASW::LibraryAnimations {
bool exportAnimations();
- // called for each exported object
+ /* called for each exported object */
void operator()(Object *ob);
protected:
@@ -129,8 +129,8 @@ class AnimationExporter : COLLADASW::LibraryAnimations {
Object *ob_arm,
bPoseChannel *pChan);
- // dae_bone_animation -> add_bone_animation
- // (blend this into dae_bone_animation)
+ /* dae_bone_animation -> add_bone_animation
+ * (blend this into dae_bone_animation) */
void dae_bone_animation(std::vector<float> &fra,
float *v,
int tm_type,
diff --git a/source/blender/io/collada/AnimationImporter.h b/source/blender/io/collada/AnimationImporter.h
index 5c6f9400286..44001366adc 100644
--- a/source/blender/io/collada/AnimationImporter.h
+++ b/source/blender/io/collada/AnimationImporter.h
@@ -52,7 +52,7 @@ class ArmatureImporter;
class AnimationImporterBase {
public:
- // virtual void change_eul_to_quat(Object *ob, bAction *act) = 0;
+ /* virtual void change_eul_to_quat(Object *ob, bAction *act) = 0; */
};
class AnimationImporter : private TransformReader, public AnimationImporterBase {
@@ -75,7 +75,7 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
float value,
eBezTriple_Interpolation ipo = BEZT_IPO_LIN);
- // create one or several fcurves depending on the number of parameters being animated
+ /* create one or several fcurves depending on the number of parameters being animated */
void animation_to_fcurves(COLLADAFW::AnimationCurve *curve);
void fcurve_deg_to_rad(FCurve *cu);
@@ -143,7 +143,7 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
void set_import_from_version(std::string import_from_version);
bool write_animation(const COLLADAFW::Animation *anim);
- // called on post-process stage after writeVisualScenes
+ /* called on post-process stage after writeVisualScenes */
bool write_animation_list(const COLLADAFW::AnimationList *animlist);
void read_node_transform(COLLADAFW::Node *node, Object *ob);
@@ -199,9 +199,9 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
int array_index,
int scale = 1);
void unused_fcurve(std::vector<FCurve *> *curves);
- // prerequisites:
- // animlist_map - map animlist id -> animlist
- // curve_map - map anim id -> curve(s)
+ /* prerequisites:
+ * animlist_map - map animlist id -> animlist
+ * curve_map - map anim id -> curve(s) */
Object *translate_animation_OLD(COLLADAFW::Node *node,
std::map<COLLADAFW::UniqueId, Object *> &object_map,
std::map<COLLADAFW::UniqueId, COLLADAFW::Node *> &root_map,
@@ -212,21 +212,21 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
void find_frames_old(std::vector<float> *frames,
COLLADAFW::Node *node,
COLLADAFW::Transformation::TransformationType tm_type);
- // internal, better make it private
- // warning: evaluates only rotation
- // prerequisites: animlist_map, curve_map
+ /* internal, better make it private
+ * warning: evaluates only rotation
+ * prerequisites: animlist_map, curve_map */
void evaluate_transform_at_frame(float mat[4][4], COLLADAFW::Node *node, float fra);
- // return true to indicate that mat contains a sane value
+ /* return true to indicate that mat contains a sane value */
bool evaluate_animation(COLLADAFW::Transformation *tm,
float mat[4][4],
float fra,
const char *node_id);
- // gives a world-space mat of joint at rest position
+ /* gives a world-space mat of joint at rest position */
void get_joint_rest_mat(float mat[4][4], COLLADAFW::Node *root, COLLADAFW::Node *node);
- // gives a world-space mat, end's mat not included
+ /* gives a world-space mat, end's mat not included */
bool calc_joint_parent_mat_rest(float mat[4][4],
float par[4][4],
COLLADAFW::Node *node,
@@ -239,8 +239,8 @@ class AnimationImporter : private TransformReader, public AnimationImporterBase
#endif
#if 0
- // recursively evaluates joint tree until end is found, mat then is world-space matrix of end
- // mat must be identity on enter, node must be root
+ /* recursively evaluates joint tree until end is found, mat then is world-space matrix of end
+ * mat must be identity on enter, node must be root */
bool evaluate_joint_world_transform_at_frame(
float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end, float fra);
#endif
diff --git a/source/blender/io/collada/ArmatureExporter.cpp b/source/blender/io/collada/ArmatureExporter.cpp
index fc697e1617b..ed043096c7e 100644
--- a/source/blender/io/collada/ArmatureExporter.cpp
+++ b/source/blender/io/collada/ArmatureExporter.cpp
@@ -40,14 +40,14 @@
#include "GeometryExporter.h"
#include "SceneExporter.h"
-// write bone nodes
+/* write bone nodes */
void ArmatureExporter::add_armature_bones(Object *ob_arm,
ViewLayer *view_layer,
SceneExporter *se,
std::vector<Object *> &child_objects)
{
- // write bone nodes
+ /* write bone nodes */
bArmature *armature = (bArmature *)ob_arm->data;
bool is_edited = armature->edbo != NULL;
@@ -95,7 +95,7 @@ bool ArmatureExporter::add_instance_controller(Object *ob)
return false;
}
- // write root bone URLs
+ /* write root bone URLs */
Bone *bone;
for (bone = (Bone *)arm->bonebase.first; bone; bone = bone->next) {
write_bone_URLs(ins, ob_arm, bone);
@@ -144,7 +144,7 @@ void ArmatureExporter::find_objects_using_armature(Object *ob_arm,
}
#endif
-// parent_mat is armature-space
+/* parent_mat is armature-space */
void ArmatureExporter::add_bone_node(Bone *bone,
Object *ob_arm,
SceneExporter *se,
@@ -197,7 +197,7 @@ void ArmatureExporter::add_bone_node(Bone *bone,
add_bone_transform(ob_arm, bone, node);
- // Write nodes of childobjects, remove written objects from list
+ /* Write nodes of childobjects, remove written objects from list */
std::vector<Object *>::iterator iter = child_objects.begin();
while (iter != child_objects.end()) {
@@ -206,20 +206,20 @@ void ArmatureExporter::add_bone_node(Bone *bone,
float backup_parinv[4][4];
copy_m4_m4(backup_parinv, ob->parentinv);
- // crude, temporary change to parentinv
- // so transform gets exported correctly.
+ /* Crude, temporary change to parentinv
+ * so transform gets exported correctly. */
- // Add bone tail- translation... don't know why
- // bone parenting is against the tail of a bone
- // and not it's head, seems arbitrary.
+ /* Add bone tail- translation... don't know why
+ * bone parenting is against the tail of a bone
+ * and not it's head, seems arbitrary. */
ob->parentinv[3][1] += bone->length;
- // OPEN_SIM_COMPATIBILITY
- // TODO: when such objects are animated as
- // single matrix the tweak must be applied
- // to the result.
+ /* OPEN_SIM_COMPATIBILITY
+ * TODO: when such objects are animated as
+ * single matrix the tweak must be applied
+ * to the result. */
if (export_settings.get_open_sim()) {
- // tweak objects parentinverse to match compatibility
+ /* Tweak objects parentinverse to match compatibility. */
float temp[4][4];
copy_m4_m4(temp, bone->arm_mat);
@@ -289,11 +289,11 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW:
mul_m4_m4m4(mat, parent_inverse, bone_rest_mat);
}
- // OPEN_SIM_COMPATIBILITY
+ /* OPEN_SIM_COMPATIBILITY */
if (export_settings.get_open_sim()) {
- // Remove rotations vs armature from transform
- // parent_rest_rot * mat * irest_rot
+ /* Remove rotations vs armature from transform
+ * parent_rest_rot * mat * irest_rot */
Matrix workmat;
copy_m4_m4(workmat, bone_rest_mat);
diff --git a/source/blender/io/collada/ArmatureExporter.h b/source/blender/io/collada/ArmatureExporter.h
index 193dc9cde3a..b994741f342 100644
--- a/source/blender/io/collada/ArmatureExporter.h
+++ b/source/blender/io/collada/ArmatureExporter.h
@@ -22,7 +22,7 @@
#include <list>
#include <string>
-//#include <vector>
+// #include <vector>
#include "COLLADASWInputList.h"
#include "COLLADASWLibraryControllers.h"
@@ -43,16 +43,16 @@
class SceneExporter;
-// XXX exporter writes wrong data for shared armatures. A separate
-// controller should be written for each armature-mesh binding how do
-// we make controller ids then?
+/* XXX exporter writes wrong data for shared armatures. A separate
+ * controller should be written for each armature-mesh binding how do
+ * we make controller ids then? */
class ArmatureExporter : public COLLADASW::LibraryControllers,
protected TransformWriter,
protected InstanceWriter {
public:
- // XXX exporter writes wrong data for shared armatures. A separate
- // controller should be written for each armature-mesh binding how do
- // we make controller ids then?
+ /* XXX exporter writes wrong data for shared armatures. A separate
+ * controller should be written for each armature-mesh binding how do
+ * we make controller ids then? */
ArmatureExporter(BlenderContext &blender_context,
COLLADASW::StreamWriter *sw,
BCExportSettings &export_settings)
@@ -83,8 +83,8 @@ class ArmatureExporter : public COLLADASW::LibraryControllers,
void find_objects_using_armature(Object *ob_arm, std::vector<Object *> &objects, Scene *sce);
#endif
- // Scene, SceneExporter and the list of child_objects
- // are required for writing bone parented objects
+ /* Scene, SceneExporter and the list of child_objects
+ * are required for writing bone parented objects */
void add_bone_node(Bone *bone,
Object *ob_arm,
SceneExporter *se,
diff --git a/source/blender/io/collada/ArmatureImporter.cpp b/source/blender/io/collada/ArmatureImporter.cpp
index dbb0ad328f5..af6558da3b4 100644
--- a/source/blender/io/collada/ArmatureImporter.cpp
+++ b/source/blender/io/collada/ArmatureImporter.cpp
@@ -153,7 +153,7 @@ int ArmatureImporter::create_bone(SkinInfo *skin,
if (layer) {
bone->layer = layer;
}
- arm->layer |= layer; // ensure that all populated bone layers are visible after import
+ arm->layer |= layer; /* ensure that all populated bone layers are visible after import */
float *tail = be.get_tail();
int use_connect = be.get_use_connect();
@@ -504,7 +504,7 @@ void ArmatureImporter::create_armature_bones(Main *bmain, std::vector<Object *>
}
ED_armature_to_edit(armature);
- armature->layer = 0; // layer is set according to imported bone set in create_bone()
+ armature->layer = 0; /* layer is set according to imported bone set in create_bone() */
create_bone(NULL, node, NULL, node->getChildNodes().getCount(), NULL, armature, layer_labels);
if (this->import_settings->find_chains) {
@@ -623,7 +623,7 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo &skin)
ob_arm = skin.set_armature(shared);
}
else {
- ob_arm = skin.create_armature(m_bmain, scene, view_layer); // once for every armature
+ ob_arm = skin.create_armature(m_bmain, scene, view_layer); /* once for every armature */
}
/* enter armature edit mode */
@@ -631,7 +631,7 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo &skin)
ED_armature_to_edit(armature);
totbone = 0;
- // bone_direction_row = 1; // TODO: don't default to Y but use asset and based on it decide on
+ // bone_direction_row = 1; /* TODO: don't default to Y but use asset and based on it decide on */
/* default row */
/* create bones */
diff --git a/source/blender/io/collada/ArmatureImporter.h b/source/blender/io/collada/ArmatureImporter.h
index a1c4a25b80f..16265e66a8e 100644
--- a/source/blender/io/collada/ArmatureImporter.h
+++ b/source/blender/io/collada/ArmatureImporter.h
@@ -61,11 +61,11 @@ class ArmatureImporter : private TransformReader {
// std::map<int, JointData> joint_index_to_joint_info_map;
// std::map<COLLADAFW::UniqueId, int> joint_id_to_joint_index_map;
BoneExtensionManager bone_extension_manager;
- // int bone_direction_row; // XXX not used
+ // int bone_direction_row; /* XXX not used */
float leaf_bone_length;
int totbone;
- // XXX not used
- // float min_angle; // minimum angle between bone head-tail and a row of bone matrix
+ /* XXX not used */
+ // float min_angle; /* minimum angle between bone head-tail and a row of bone matrix */
#if 0
struct ArmatureJoints {
@@ -75,10 +75,10 @@ class ArmatureImporter : private TransformReader {
std::vector<ArmatureJoints> armature_joints;
#endif
- Object *empty; // empty for leaf bones
+ Object *empty; /* empty for leaf bones */
std::map<COLLADAFW::UniqueId, COLLADAFW::UniqueId> geom_uid_by_controller_uid;
- std::map<COLLADAFW::UniqueId, COLLADAFW::Node *> joint_by_uid; // contains all joints
+ std::map<COLLADAFW::UniqueId, COLLADAFW::Node *> joint_by_uid; /* contains all joints */
std::vector<COLLADAFW::Node *> root_joints;
std::vector<COLLADAFW::Node *> finished_joints;
std::vector<COLLADAFW::MorphController *> morph_controllers;
@@ -87,11 +87,12 @@ class ArmatureImporter : private TransformReader {
MeshImporterBase *mesh_importer;
- // This is used to store data passed in write_controller_data.
- // Arrays from COLLADAFW::SkinControllerData lose ownership, so do this class members
- // so that arrays don't get freed until we free them explicitly.
+ /* This is used to store data passed in write_controller_data.
+ * Arrays from COLLADAFW::SkinControllerData lose ownership, so do this class members
+ * so that arrays don't get freed until we free them explicitly. */
- std::map<COLLADAFW::UniqueId, SkinInfo> skin_by_data_uid; // data UID = skin controller data UID
+ std::map<COLLADAFW::UniqueId, SkinInfo>
+ skin_by_data_uid; /* data UID = skin controller data UID */
#if 0
JointData *get_joint_data(COLLADAFW::Node *node);
#endif
@@ -153,13 +154,13 @@ class ArmatureImporter : private TransformReader {
void add_root_joint(COLLADAFW::Node *node, Object *parent);
- // here we add bones to armatures, having armatures previously created in write_controller
+ /* here we add bones to armatures, having armatures previously created in write_controller */
void make_armatures(bContext *C, std::vector<Object *> &objects_to_scale);
void make_shape_keys(bContext *C);
#if 0
- // link with meshes, create vertex groups, assign weights
+ /* link with meshes, create vertex groups, assign weights */
void link_armature(Object *ob_arm,
const COLLADAFW::UniqueId &geom_id,
const COLLADAFW::UniqueId &controller_data_id);
@@ -175,7 +176,7 @@ class ArmatureImporter : private TransformReader {
void get_rna_path_for_joint(COLLADAFW::Node *node, char *joint_path, size_t count);
- // gives a world-space mat
+ /* gives a world-space mat */
bool get_joint_bind_mat(float m[4][4], COLLADAFW::Node *joint);
void set_tags_map(TagsMap &tags_map);
diff --git a/source/blender/io/collada/BCAnimationCurve.cpp b/source/blender/io/collada/BCAnimationCurve.cpp
index 559a17eda9f..46439bb3556 100644
--- a/source/blender/io/collada/BCAnimationCurve.cpp
+++ b/source/blender/io/collada/BCAnimationCurve.cpp
@@ -230,7 +230,7 @@ int BCAnimationCurve::closest_index_above(const float sample_frame, const int st
return -1;
}
- const int cframe = fcurve->bezt[start_at].vec[1][0]; // inaccurate!
+ const int cframe = fcurve->bezt[start_at].vec[1][0]; /* inaccurate! */
if (fabs(cframe - sample_frame) < 0.00001) {
return start_at;
@@ -252,7 +252,7 @@ int BCAnimationCurve::closest_index_below(const float sample_frame) const
for (int fcu_index = 0; fcu_index < fcurve->totvert; fcu_index++) {
upper_index = fcu_index;
- const int cframe = fcurve->bezt[fcu_index].vec[1][0]; // inaccurate!
+ const int cframe = fcurve->bezt[fcu_index].vec[1][0]; /* inaccurate! */
if (cframe <= sample_frame) {
lower_frame = cframe;
lower_index = fcu_index;
@@ -347,7 +347,7 @@ float BCAnimationCurve::get_value(const float frame)
if (fcurve) {
return evaluate_fcurve(fcurve, frame);
}
- return 0; // TODO: handle case where neither sample nor fcu exist
+ return 0; /* TODO: handle case where neither sample nor fcu exist */
}
void BCAnimationCurve::update_range(float val)
diff --git a/source/blender/io/collada/BCAnimationCurve.h b/source/blender/io/collada/BCAnimationCurve.h
index 3f7bcf9a13f..27856dd55f4 100644
--- a/source/blender/io/collada/BCAnimationCurve.h
+++ b/source/blender/io/collada/BCAnimationCurve.h
@@ -119,7 +119,7 @@ class BCAnimationCurve {
std::string get_animation_name(Object *ob) const; /* xxx: this is collada specific */
std::string get_channel_target() const;
std::string get_channel_type() const;
- std::string get_channel_posebone() const; // returns "" if channel is not a bone channel
+ std::string get_channel_posebone() const; /* returns "" if channel is not a bone channel */
int get_channel_index() const;
int get_subindex() const;
diff --git a/source/blender/io/collada/BCAnimationSampler.cpp b/source/blender/io/collada/BCAnimationSampler.cpp
index b8df98e8acb..6bada9950b9 100644
--- a/source/blender/io/collada/BCAnimationSampler.cpp
+++ b/source/blender/io/collada/BCAnimationSampler.cpp
@@ -17,7 +17,7 @@
* All rights reserved.
*/
-#include <algorithm> // std::find
+#include <algorithm> /* std::find */
#include <map>
#include <vector>
@@ -92,7 +92,7 @@ static void get_sample_frames(BCFrameSet &sample_frames,
sample_frames.clear();
if (sampling_rate < 1) {
- return; // no sample frames in this case
+ return; /* no sample frames in this case */
}
float sfra = scene->r.sfra;
@@ -584,7 +584,7 @@ BCSampleFrame *BCSampleFrameContainer::get_frame(int frame_index)
/* Return a list of all frames that need to be sampled */
int BCSampleFrameContainer::get_frames(std::vector<int> &frames) const
{
- frames.clear(); // safety;
+ frames.clear(); /* safety; */
BCSampleFrameMap::const_iterator it;
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
frames.push_back(it->first);
@@ -594,7 +594,7 @@ int BCSampleFrameContainer::get_frames(std::vector<int> &frames) const
int BCSampleFrameContainer::get_frames(Object *ob, BCFrames &frames) const
{
- frames.clear(); // safety;
+ frames.clear(); /* safety; */
BCSampleFrameMap::const_iterator it;
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
const BCSampleFrame &frame = it->second;
@@ -607,7 +607,7 @@ int BCSampleFrameContainer::get_frames(Object *ob, BCFrames &frames) const
int BCSampleFrameContainer::get_frames(Object *ob, Bone *bone, BCFrames &frames) const
{
- frames.clear(); // safety;
+ frames.clear(); /* safety; */
BCSampleFrameMap::const_iterator it;
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
const BCSampleFrame &frame = it->second;
@@ -620,7 +620,7 @@ int BCSampleFrameContainer::get_frames(Object *ob, Bone *bone, BCFrames &frames)
int BCSampleFrameContainer::get_samples(Object *ob, BCFrameSampleMap &samples) const
{
- samples.clear(); // safety;
+ samples.clear(); /* safety; */
BCSampleFrameMap::const_iterator it;
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
const BCSampleFrame &frame = it->second;
@@ -634,7 +634,7 @@ int BCSampleFrameContainer::get_samples(Object *ob, BCFrameSampleMap &samples) c
int BCSampleFrameContainer::get_matrices(Object *ob, BCMatrixSampleMap &samples) const
{
- samples.clear(); // safety;
+ samples.clear(); /* safety; */
BCSampleFrameMap::const_iterator it;
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
const BCSampleFrame &frame = it->second;
@@ -648,7 +648,7 @@ int BCSampleFrameContainer::get_matrices(Object *ob, BCMatrixSampleMap &samples)
int BCSampleFrameContainer::get_matrices(Object *ob, Bone *bone, BCMatrixSampleMap &samples) const
{
- samples.clear(); // safety;
+ samples.clear(); /* safety; */
BCSampleFrameMap::const_iterator it;
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
const BCSampleFrame &frame = it->second;
diff --git a/source/blender/io/collada/BCAnimationSampler.h b/source/blender/io/collada/BCAnimationSampler.h
index f7f2464a637..52c0c8aa29e 100644
--- a/source/blender/io/collada/BCAnimationSampler.h
+++ b/source/blender/io/collada/BCAnimationSampler.h
@@ -134,7 +134,7 @@ class BCSampleFrameContainer {
}
BCSample &add(Object *ob, int frame_index);
- BCSampleFrame *get_frame(int frame_index); // returns NULL if frame does not exist
+ BCSampleFrame *get_frame(int frame_index); /* returns NULL if frame does not exist */
int get_frames(std::vector<int> &frames) const;
int get_frames(Object *ob, BCFrames &frames) const;
diff --git a/source/blender/io/collada/BCMath.cpp b/source/blender/io/collada/BCMath.cpp
index 85d4c212141..8a3fbf3c92c 100644
--- a/source/blender/io/collada/BCMath.cpp
+++ b/source/blender/io/collada/BCMath.cpp
@@ -67,7 +67,8 @@ BCMatrix::BCMatrix(BC_global_forward_axis global_forward_axis, BC_global_up_axis
mat3_from_axis_conversion(
BC_DEFAULT_FORWARD, BC_DEFAULT_UP, global_forward_axis, global_up_axis, mrot);
- transpose_m3(mrot); // TODO: Verify that mat3_from_axis_conversion() returns a transposed matrix
+ transpose_m3(
+ mrot); /* TODO: Verify that mat3_from_axis_conversion() returns a transposed matrix */
copy_m4_m3(mat, mrot);
set_transform(mat);
}
diff --git a/source/blender/io/collada/BCSampleData.h b/source/blender/io/collada/BCSampleData.h
index 463c90ec00b..06d234e2c3e 100644
--- a/source/blender/io/collada/BCSampleData.h
+++ b/source/blender/io/collada/BCSampleData.h
@@ -55,7 +55,7 @@ class BCSample {
bool get_value(std::string channel_target, const int array_index, float *val) const;
const BCMatrix &get_matrix() const;
- const BCMatrix *get_matrix(Bone *bone) const; // returns NULL if bone is not animated
+ const BCMatrix *get_matrix(Bone *bone) const; /* returns NULL if bone is not animated */
};
typedef std::map<Object *, BCSample *> BCSampleMap;
diff --git a/source/blender/io/collada/BlenderContext.cpp b/source/blender/io/collada/BlenderContext.cpp
index 1d3bffacb79..defa875882f 100644
--- a/source/blender/io/collada/BlenderContext.cpp
+++ b/source/blender/io/collada/BlenderContext.cpp
@@ -112,7 +112,7 @@ BlenderContext::BlenderContext(bContext *C)
main = CTX_data_main(C);
scene = CTX_data_scene(C);
view_layer = CTX_data_view_layer(C);
- depsgraph = nullptr; // create only when needed
+ depsgraph = nullptr; /* create only when needed */
}
bContext *BlenderContext::get_context()
diff --git a/source/blender/io/collada/ControllerExporter.cpp b/source/blender/io/collada/ControllerExporter.cpp
index 1b8c859f443..1d8d0f2b389 100644
--- a/source/blender/io/collada/ControllerExporter.cpp
+++ b/source/blender/io/collada/ControllerExporter.cpp
@@ -305,7 +305,7 @@ void ControllerExporter::export_morph_controller(Object *ob, Key *key)
COLLADASW::InputList &input = targets.getInputList();
input.push_back(COLLADASW::Input(
- COLLADASW::InputSemantic::MORPH_TARGET, // constant declared in COLLADASWInputList.h
+ COLLADASW::InputSemantic::MORPH_TARGET, /* constant declared in COLLADASWInputList.h */
COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, targets_id)));
input.push_back(
COLLADASW::Input(COLLADASW::InputSemantic::MORPH_WEIGHT,
@@ -400,7 +400,7 @@ void ControllerExporter::add_joints_element(ListBase *defbase,
COLLADASW::InputList &input = joints.getInputList();
input.push_back(COLLADASW::Input(
- COLLADASW::InputSemantic::JOINT, // constant declared in COLLADASWInputList.h
+ COLLADASW::InputSemantic::JOINT, /* constant declared in COLLADASWInputList.h */
COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, joints_source_id)));
input.push_back(
COLLADASW::Input(COLLADASW::InputSemantic::BINDMATRIX,
@@ -415,7 +415,7 @@ void ControllerExporter::add_bind_shape_mat(Object *ob)
BKE_object_matrix_local_get(ob, f_obmat);
if (export_settings.get_apply_global_orientation()) {
- // do nothing, rotation is going to be applied to the Data
+ /* do nothing, rotation is going to be applied to the Data */
}
else {
bc_add_global_transform(f_obmat, export_settings.get_global_transform());
@@ -615,7 +615,7 @@ void ControllerExporter::add_vertex_weights_element(const std::string &weights_s
int offset = 0;
input.push_back(COLLADASW::Input(
- COLLADASW::InputSemantic::JOINT, // constant declared in COLLADASWInputList.h
+ COLLADASW::InputSemantic::JOINT, /* constant declared in COLLADASWInputList.h */
COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, joints_source_id),
offset++));
input.push_back(
diff --git a/source/blender/io/collada/ControllerExporter.h b/source/blender/io/collada/ControllerExporter.h
index 753538d8e98..6a377a4119e 100644
--- a/source/blender/io/collada/ControllerExporter.h
+++ b/source/blender/io/collada/ControllerExporter.h
@@ -56,9 +56,9 @@ class ControllerExporter : public COLLADASW::LibraryControllers,
BCExportSettings export_settings;
public:
- // XXX exporter writes wrong data for shared armatures. A separate
- // controller should be written for each armature-mesh binding how do
- // we make controller ids then?
+ /* XXX exporter writes wrong data for shared armatures. A separate
+ * controller should be written for each armature-mesh binding how do
+ * we make controller ids then? */
ControllerExporter(BlenderContext &blender_context,
COLLADASW::StreamWriter *sw,
BCExportSettings &export_settings)
@@ -91,8 +91,8 @@ class ControllerExporter : public COLLADASW::LibraryControllers,
std::string get_controller_id(Key *key, Object *ob);
- // ob should be of type OB_MESH
- // both args are required
+ /* ob should be of type OB_MESH
+ * both args are required */
void export_skin_controller(Object *ob, Object *ob_arm);
void export_morph_controller(Object *ob, Key *key);
diff --git a/source/blender/io/collada/DocumentExporter.cpp b/source/blender/io/collada/DocumentExporter.cpp
index 6be441a9e27..65c71b0edef 100644
--- a/source/blender/io/collada/DocumentExporter.cpp
+++ b/source/blender/io/collada/DocumentExporter.cpp
@@ -18,7 +18,7 @@
* \ingroup collada
*/
-#include <algorithm> // std::find
+#include <algorithm> /* std::find */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@@ -79,7 +79,7 @@
#include "BLI_string.h"
#include "BLI_utildefines.h"
-#include "BKE_action.h" // pose functions
+#include "BKE_action.h" /* pose functions */
#include "BKE_animsys.h"
#include "BKE_appdir.h"
#include "BKE_armature.h"
@@ -106,7 +106,7 @@ extern "C" char build_hash[];
#include "collada_internal.h"
#include "collada_utils.h"
-// can probably go after refactor is complete
+/* can probably go after refactor is complete */
#include "InstanceWriter.h"
#include "TransformWriter.h"
@@ -170,9 +170,9 @@ static COLLADABU::NativeString make_temp_filepath(const char *name, const char *
return native_filename;
}
-// TODO: it would be better to instantiate animations rather than create a new one per object
-// COLLADA allows this through multiple <channel>s in <animation>.
-// For this to work, we need to know objects that use a certain action.
+/* TODO: it would be better to instantiate animations rather than create a new one per object
+ * COLLADA allows this through multiple <channel>s in <animation>.
+ * For this to work, we need to know objects that use a certain action. */
int DocumentExporter::exportCurrentScene()
{
@@ -187,10 +187,10 @@ int DocumentExporter::exportCurrentScene()
COLLADABU::NativeString native_filename = make_temp_filepath(NULL, ".dae");
COLLADASW::StreamWriter *writer = new COLLADASW::StreamWriter(native_filename);
- // open <collada>
+ /* open <collada> */
writer->startDocument();
- // <asset>
+ /* <asset> */
COLLADASW::Asset asset(writer);
RNA_id_pointer_create(&(sce->id), &sceneptr);
@@ -254,37 +254,37 @@ int DocumentExporter::exportCurrentScene()
asset.add();
LinkNode *export_set = this->export_settings.get_export_set();
- // <library_cameras>
+ /* <library_cameras> */
if (bc_has_object_type(export_set, OB_CAMERA)) {
CamerasExporter ce(writer, this->export_settings);
ce.exportCameras(sce);
}
- // <library_lights>
+ /* <library_lights> */
if (bc_has_object_type(export_set, OB_LAMP)) {
LightsExporter le(writer, this->export_settings);
le.exportLights(sce);
}
- // <library_effects>
+ /* <library_effects> */
EffectsExporter ee(writer, this->export_settings, key_image_map);
ee.exportEffects(C, sce);
- // <library_images>
+ /* <library_images> */
ImagesExporter ie(writer, this->export_settings, key_image_map);
ie.exportImages(sce);
- // <library_materials>
+ /* <library_materials> */
MaterialsExporter me(writer, this->export_settings);
me.exportMaterials(sce);
- // <library_geometries>
+ /* <library_geometries> */
if (bc_has_object_type(export_set, OB_MESH)) {
GeometryExporter ge(blender_context, writer, this->export_settings);
ge.exportGeom();
}
- // <library_controllers>
+ /* <library_controllers> */
ArmatureExporter arm_exporter(blender_context, writer, this->export_settings);
ControllerExporter controller_exporter(blender_context, writer, this->export_settings);
if (bc_has_object_type(export_set, OB_ARMATURE) ||
@@ -292,28 +292,28 @@ int DocumentExporter::exportCurrentScene()
controller_exporter.export_controllers();
}
- // <library_visual_scenes>
+ /* <library_visual_scenes> */
SceneExporter se(blender_context, writer, &arm_exporter, this->export_settings);
if (this->export_settings.get_include_animations()) {
- // <library_animations>
+ /* <library_animations> */
AnimationExporter ae(writer, this->export_settings);
ae.exportAnimations();
}
se.exportScene();
- // <scene>
+ /* <scene> */
std::string scene_name(translate_id(id_name(sce)));
COLLADASW::Scene scene(writer, COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, scene_name));
scene.add();
- // close <Collada>
+ /* close <Collada> */
writer->endDocument();
delete writer;
- // Finally move the created document into place
+ /* Finally move the created document into place */
fprintf(stdout, "Collada export to: %s\n", this->export_settings.get_filepath());
int status = BLI_rename(native_filename.c_str(), this->export_settings.get_filepath());
if (status != 0) {
diff --git a/source/blender/io/collada/DocumentImporter.cpp b/source/blender/io/collada/DocumentImporter.cpp
index 083d7258d0a..b9f132d04dd 100644
--- a/source/blender/io/collada/DocumentImporter.cpp
+++ b/source/blender/io/collada/DocumentImporter.cpp
@@ -22,7 +22,7 @@
* * name imported objects
* * import object rotation as euler */
-#include <algorithm> // sort()
+#include <algorithm> /* sort() */
#include <map>
#include <string>
@@ -90,7 +90,7 @@
*/
// #define COLLADA_DEBUG
-// creates empties for each imported bone on layer 2, for debugging
+/* creates empties for each imported bone on layer 2, for debugging */
// #define ARMATURE_TEST
DocumentImporter::DocumentImporter(bContext *C, const ImportSettings *import_settings)
@@ -429,7 +429,7 @@ Object *DocumentImporter::create_instance_node(Object *source_ob,
if (source_node) {
COLLADABU::Math::Matrix4 mat4 = source_node->getTransformationMatrix();
COLLADABU::Math::Matrix4 bmat4 =
- mat4.transpose(); // transpose to get blender row-major order
+ mat4.transpose(); /* transpose to get blender row-major order */
float mat[4][4];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
@@ -457,7 +457,7 @@ Object *DocumentImporter::create_instance_node(Object *source_ob,
}
COLLADAFW::InstanceNodePointerArray &inodes = child_node->getInstanceNodes();
Object *new_child = NULL;
- if (inodes.getCount()) { // \todo loop through instance nodes
+ if (inodes.getCount()) { /* \todo loop through instance nodes */
const COLLADAFW::UniqueId &id = inodes[0]->getInstanciatedObjectId();
fprintf(stderr, "Doing %d child nodes\n", (int)node_map.count(id));
new_child = create_instance_node(
@@ -678,7 +678,7 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node,
}
}
- // create_constraints(et,ob);
+ /* create_constraints(et,ob); */
}
for (std::vector<Object *>::iterator it = objects_done->begin(); it != objects_done->end();
@@ -686,7 +686,7 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node,
ob = *it;
if (read_transform) {
- anim_importer.read_node_transform(node, ob); // overwrites location set earlier
+ anim_importer.read_node_transform(node, ob); /* overwrites location set earlier */
}
if (!is_joint) {
@@ -815,7 +815,7 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
/* following mapping still needs to be verified */
#if 0
- // needs rework to be done for 2.81
+ /* needs rework to be done for 2.81 */
matNode.set_shininess(ef->getShininess());
#endif
matNode.set_reflectivity(ef->getReflectivity());
@@ -1127,7 +1127,7 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light)
switch (light->getLightType()) {
case COLLADAFW::Light::AMBIENT_LIGHT: {
- lamp->type = LA_SUN; // TODO needs more thoughts
+ lamp->type = LA_SUN; /* TODO needs more thoughts */
} break;
case COLLADAFW::Light::SPOT_LIGHT: {
lamp->type = LA_SPOT;
diff --git a/source/blender/io/collada/DocumentImporter.h b/source/blender/io/collada/DocumentImporter.h
index e382a44c3c2..a23e983940e 100644
--- a/source/blender/io/collada/DocumentImporter.h
+++ b/source/blender/io/collada/DocumentImporter.h
@@ -46,7 +46,7 @@ struct bContext;
/** Importer class. */
class DocumentImporter : COLLADAFW::IWriter {
public:
- //! Enumeration to denote the stage of import
+ /** Enumeration to denote the stage of import */
enum ImportStage {
Fetching_Scene_data, /* First pass to collect all data except controller */
Fetching_Controller_data, /* Second pass to collect controller data */
@@ -98,7 +98,8 @@ class DocumentImporter : COLLADAFW::IWriter {
bool writeAnimationList(const COLLADAFW::AnimationList *);
#if WITH_OPENCOLLADA_ANIMATION_CLIP
- // Please enable this when building with Collada 1.6.65 or newer (also in DocumentImporter.cpp)
+ /* Please enable this when building with Collada 1.6.65 or newer (also in DocumentImporter.cpp)
+ */
bool writeAnimationClip(const COLLADAFW::AnimationClip *animationClip);
#endif
@@ -160,7 +161,8 @@ class DocumentImporter : COLLADAFW::IWriter {
std::vector<Object *> libnode_ob;
std::map<COLLADAFW::UniqueId, COLLADAFW::Node *>
- root_map; // find root joint by child joint uid, for bone tree evaluation during resampling
+ root_map; /* find root joint by child joint uid, for bone tree evaluation during resampling
+ */
std::map<COLLADAFW::UniqueId, const COLLADAFW::Object *> FW_object_map;
std::string import_from_version;
diff --git a/source/blender/io/collada/EffectExporter.cpp b/source/blender/io/collada/EffectExporter.cpp
index 7f6d3cbdc6f..4108472d1df 100644
--- a/source/blender/io/collada/EffectExporter.cpp
+++ b/source/blender/io/collada/EffectExporter.cpp
@@ -65,7 +65,7 @@ bool EffectsExporter::hasEffects(Scene *sce)
for (a = 0; a < ob->totcol; a++) {
Material *ma = BKE_object_material_get(ob, a + 1);
- // no material, but check all of the slots
+ /* no material, but check all of the slots */
if (!ma) {
continue;
}
@@ -101,7 +101,7 @@ void EffectsExporter::set_transparency(COLLADASW::EffectProfile &ep, Material *m
{
double alpha = bc_get_alpha(ma);
if (alpha < 1) {
- // workaround use <transparent> to avoid wrong handling of <transparency> by other tools
+ /* workaround use <transparent> to avoid wrong handling of <transparency> by other tools */
COLLADASW::ColorOrTexture cot = bc_get_cot(0, 0, 0, alpha);
ep.setTransparent(cot, false, "alpha");
ep.setOpaque(COLLADASW::EffectProfile::A_ONE);
@@ -209,7 +209,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
COLLADASW::EffectProfile ep(mSW);
ep.setProfileType(COLLADASW::EffectProfile::COMMON);
ep.openProfile();
- set_shader_type(ep, ma); // creates a Lambert Shader for now
+ set_shader_type(ep, ma); /* creates a Lambert Shader for now */
COLLADASW::ColorOrTexture cot;
@@ -234,7 +234,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
MTex *t = ma->mtex[tex_indices[a]];
Image *ima = t->tex->ima;
- // Image not set for texture
+ /* Image not set for texture */
if (!ima) {
continue;
}
@@ -242,17 +242,17 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
std::string key(id_name(ima));
key = translate_id(key);
- // create only one <sampler>/<surface> pair for each unique image
+ /* create only one <sampler>/<surface> pair for each unique image */
if (im_samp_map.find(key) == im_samp_map.end()) {
- //<newparam> <sampler> <source>
+ /* <newparam> <sampler> <source> */
COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D,
key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
sampler.setImageId(key);
- // copy values to arrays since they will live longer
+ /* copy values to arrays since they will live longer */
samplers[a] = sampler;
- // store pointers so they can be used later when we create <texture>s
+ /* store pointers so they can be used later when we create <texture>s */
samp_surf[b] = &samplers[a];
//samp_surf[b][1] = &surfaces[a];
@@ -274,12 +274,12 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
int i = im_samp_map[key];
std::string uvname = strlen(t->uvname) ? t->uvname : active_uv;
COLLADASW::Sampler *sampler = (COLLADASW::Sampler *)
- samp_surf[i]; // possibly uninitialized memory ...
+ samp_surf[i]; /* possibly uninitialized memory ... */
writeTextures(ep, key, sampler, t, ima, uvname);
}
#endif
- // performs the actual writing
+ /* performs the actual writing */
ep.addProfileElements();
ep.addExtraTechniques(mSW);
diff --git a/source/blender/io/collada/ErrorHandler.h b/source/blender/io/collada/ErrorHandler.h
index 60253a08cda..1da17dbed42 100644
--- a/source/blender/io/collada/ErrorHandler.h
+++ b/source/blender/io/collada/ErrorHandler.h
@@ -20,7 +20,7 @@
#pragma once
-#include <algorithm> // sort()
+#include <algorithm> /* sort() */
#include <map>
#include <string>
#include <vector>
diff --git a/source/blender/io/collada/ExtraHandler.h b/source/blender/io/collada/ExtraHandler.h
index 8f98e1dec1b..4b13aaca2aa 100644
--- a/source/blender/io/collada/ExtraHandler.h
+++ b/source/blender/io/collada/ExtraHandler.h
@@ -20,7 +20,7 @@
#pragma once
-#include <algorithm> // sort()
+#include <algorithm> /* sort() */
#include <map>
#include <string>
#include <vector>
diff --git a/source/blender/io/collada/GeometryExporter.cpp b/source/blender/io/collada/GeometryExporter.cpp
index c7fcc51d42f..332390845c7 100644
--- a/source/blender/io/collada/GeometryExporter.cpp
+++ b/source/blender/io/collada/GeometryExporter.cpp
@@ -386,7 +386,7 @@ void GeometryExporter::create_mesh_primitive_list(short material_index,
COLLADASW::Input texcoord_input(
COLLADASW::InputSemantic::TEXCOORD,
makeUrl(makeTexcoordSourceId(geom_id, i, this->export_settings.get_active_uv_only())),
- 2, // this is only until we have optimized UV sets
+ 2, /* this is only until we have optimized UV sets */
(this->export_settings.get_active_uv_only()) ? 0 : layer_index - 1 /* set (0,1,2,...) */
);
til.push_back(texcoord_input);
@@ -401,8 +401,8 @@ void GeometryExporter::create_mesh_primitive_list(short material_index,
char *layer_name = bc_CustomData_get_layer_name(&me->ldata, CD_MLOOPCOL, a);
COLLADASW::Input input4(COLLADASW::InputSemantic::COLOR,
makeUrl(makeVertexColorSourceId(geom_id, layer_name)),
- (has_uvs) ? 3 : 2, // all color layers have same index order
- map_index // set number equals color map index
+ (has_uvs) ? 3 : 2, /* all color layers have same index order */
+ map_index /* set number equals color map index */
);
til.push_back(input4);
map_index++;
diff --git a/source/blender/io/collada/LightExporter.cpp b/source/blender/io/collada/LightExporter.cpp
index 463981ceefa..2f50a603ca3 100644
--- a/source/blender/io/collada/LightExporter.cpp
+++ b/source/blender/io/collada/LightExporter.cpp
@@ -76,7 +76,7 @@ void LightsExporter::operator()(Object *ob)
quadatt = 1.0f / (d * d);
}
- // sun
+ /* sun */
if (la->type == LA_SUN) {
COLLADASW::DirectionalLight cla(mSW, la_id, la_name);
cla.setColor(col, false, "color");
@@ -85,7 +85,7 @@ void LightsExporter::operator()(Object *ob)
addLight(cla);
}
- // spot
+ /* spot */
else if (la->type == LA_SPOT) {
COLLADASW::SpotLight cla(mSW, la_id, la_name);
cla.setColor(col, false, "color");
@@ -97,7 +97,7 @@ void LightsExporter::operator()(Object *ob)
exportBlenderProfile(cla, la);
addLight(cla);
}
- // lamp
+ /* lamp */
else if (la->type == LA_LOCAL) {
COLLADASW::PointLight cla(mSW, la_id, la_name);
cla.setColor(col, false, "color");
@@ -107,8 +107,8 @@ void LightsExporter::operator()(Object *ob)
exportBlenderProfile(cla, la);
addLight(cla);
}
- // area light is not supported
- // it will be exported as a local lamp
+ /* area light is not supported
+ * it will be exported as a local lamp */
else {
COLLADASW::PointLight cla(mSW, la_id, la_name);
cla.setColor(col, false, "color");
@@ -138,7 +138,7 @@ bool LightsExporter::exportBlenderProfile(COLLADASW::Light &cla, Light *la)
cla.addExtraTechniqueParameter("blender", "spotblend", la->spotblend);
cla.addExtraTechniqueParameter("blender", "att1", la->att1);
cla.addExtraTechniqueParameter("blender", "att2", la->att2);
- // \todo figure out how we can have falloff curve supported here
+ /* \todo figure out how we can have falloff curve supported here */
cla.addExtraTechniqueParameter("blender", "falloff_type", la->falloff_type);
cla.addExtraTechniqueParameter("blender", "clipsta", la->clipsta);
cla.addExtraTechniqueParameter("blender", "clipend", la->clipend);
diff --git a/source/blender/io/collada/MaterialExporter.cpp b/source/blender/io/collada/MaterialExporter.cpp
index 488d1833e48..72669e9d8d2 100644
--- a/source/blender/io/collada/MaterialExporter.cpp
+++ b/source/blender/io/collada/MaterialExporter.cpp
@@ -51,7 +51,7 @@ bool MaterialsExporter::hasMaterials(Scene *sce)
for (a = 0; a < ob->totcol; a++) {
Material *ma = BKE_object_material_get(ob, a + 1);
- // no material, but check all of the slots
+ /* no material, but check all of the slots */
if (!ma) {
continue;
}
diff --git a/source/blender/io/collada/MaterialExporter.h b/source/blender/io/collada/MaterialExporter.h
index 7d40347097c..c684e96be19 100644
--- a/source/blender/io/collada/MaterialExporter.h
+++ b/source/blender/io/collada/MaterialExporter.h
@@ -51,7 +51,7 @@ class MaterialsExporter : COLLADASW::LibraryMaterials {
// used in forEachMaterialInScene
template<class Functor> class ForEachMaterialFunctor {
std::vector<std::string>
- mMat; // contains list of material names, to avoid duplicate calling of f
+ mMat; /* contains list of material names, to avoid duplicate calling of f */
Functor *f;
public:
@@ -81,8 +81,8 @@ template<class Functor> class ForEachMaterialFunctor {
};
struct MaterialFunctor {
- // calls f for each unique material linked to each object in sce
- // f should have
+ /* calls f for each unique material linked to each object in sce
+ * f should have */
// void operator()(Material *ma)
template<class Functor>
void forEachMaterialInExportSet(Scene *sce, Functor &f, LinkNode *export_set)
diff --git a/source/blender/io/collada/Materials.cpp b/source/blender/io/collada/Materials.cpp
index 1e02e151d97..a97b7dfcfd6 100644
--- a/source/blender/io/collada/Materials.cpp
+++ b/source/blender/io/collada/Materials.cpp
@@ -53,7 +53,7 @@ MaterialNode::MaterialNode(bContext *C,
add_link(ntree, nmap["transparent"], 0, nmap["mix"], 2);
add_link(ntree, nmap["mix"], 0, nmap["out"], 0);
- // experimental, probably not used.
+ /* experimental, probably not used. */
make_group(C, ntree, nmap);
#else
shader_node = add_node(SH_NODE_BSDF_PRINCIPLED, 0, 300, "");
@@ -66,24 +66,24 @@ void MaterialNode::setShaderType()
{
#if 0
COLLADAFW::EffectCommon::ShaderType shader = ef->getShaderType();
- // Currently we only support PBR based shaders
- // TODO: simulate the effects with PBR
+ /* Currently we only support PBR based shaders */
+ /* TODO: simulate the effects with PBR */
- // blinn
+ /* blinn */
if (shader == COLLADAFW::EffectCommon::SHADER_BLINN) {
ma->spec_shader = MA_SPEC_BLINN;
ma->spec = ef->getShininess().getFloatValue();
}
- // phong
+ /* phong */
else if (shader == COLLADAFW::EffectCommon::SHADER_PHONG) {
ma->spec_shader = MA_SPEC_PHONG;
ma->har = ef->getShininess().getFloatValue();
}
- // lambert
+ /* lambert */
else if (shader == COLLADAFW::EffectCommon::SHADER_LAMBERT) {
ma->diff_shader = MA_DIFF_LAMBERT;
}
- // default - lambert
+ /* default - lambert */
else {
ma->diff_shader = MA_DIFF_LAMBERT;
fprintf(stderr, "Current shader type is not supported, default to lambert.\n");
@@ -91,7 +91,7 @@ void MaterialNode::setShaderType()
#endif
}
-// returns null if material already has a node tree
+/* returns null if material already has a node tree */
bNodeTree *MaterialNode::prepare_material_nodetree()
{
if (material->nodetree) {
@@ -139,7 +139,7 @@ void MaterialNode::set_reflectivity(COLLADAFW::FloatOrParam &val)
}
#if 0
-// needs rework to be done for 2.81
+/* needs rework to be done for 2.81 */
void MaterialNode::set_shininess(COLLADAFW::FloatOrParam &val)
{
float roughness = val.getFloatValue();
@@ -177,7 +177,7 @@ void MaterialNode::set_alpha(COLLADAFW::EffectCommon::OpaqueMode mode,
}
if (cot.isColor() || !cot.isValid()) {
- // transparent_cot is either a color or not defined
+ /* transparent_cot is either a color or not defined */
float transparent_alpha;
if (cot.isValid()) {
@@ -185,14 +185,14 @@ void MaterialNode::set_alpha(COLLADAFW::EffectCommon::OpaqueMode mode,
transparent_alpha = col.getAlpha();
}
else {
- // no transparent color defined
+ /* no transparent color defined */
transparent_alpha = 1;
}
float transparency_alpha = val.getFloatValue();
if (transparency_alpha < 0) {
- // transparency is not defined
- transparency_alpha = 1; // set to opaque
+ /* transparency is not defined */
+ transparency_alpha = 1; /* set to opaque */
}
float alpha = transparent_alpha * transparency_alpha;
@@ -279,12 +279,12 @@ void MaterialNode::set_ambient(COLLADAFW::ColorOrTexture &cot)
COLLADAFW::Color col = cot.getColor();
bNode *node = add_node(SH_NODE_RGB, -300, locy, "Ambient");
set_color(node, col);
- // TODO: Connect node
+ /* TODO: Connect node */
}
- // texture
+ /* texture */
else if (cot.isTexture()) {
add_texture_node(cot, -300, locy, "Ambient");
- // TODO: Connect node
+ /* TODO: Connect node */
}
}
@@ -295,12 +295,12 @@ void MaterialNode::set_reflective(COLLADAFW::ColorOrTexture &cot)
COLLADAFW::Color col = cot.getColor();
bNode *node = add_node(SH_NODE_RGB, -300, locy, "Reflective");
set_color(node, col);
- // TODO: Connect node
+ /* TODO: Connect node */
}
- // texture
+ /* texture */
else if (cot.isTexture()) {
add_texture_node(cot, -300, locy, "Reflective");
- // TODO: Connect node
+ /* TODO: Connect node */
}
}
@@ -343,16 +343,16 @@ void MaterialNode::set_opacity(COLLADAFW::ColorOrTexture &cot)
float alpha = effect->getTransparency().getFloatValue();
if (col.isValid()) {
- alpha *= col.getAlpha(); // Assuming A_ONE opaque mode
+ alpha *= col.getAlpha(); /* Assuming A_ONE opaque mode */
}
bNodeSocket *socket = nodeFindSocket(shader_node, SOCK_IN, "Alpha");
((bNodeSocketValueFloat *)socket->default_value)->value = alpha;
}
- // texture
+ /* texture */
else if (cot.isTexture()) {
add_texture_node(cot, -300, locy, "Alpha");
- // TODO: Connect node
+ /* TODO: Connect node */
}
}
@@ -363,12 +363,12 @@ void MaterialNode::set_specular(COLLADAFW::ColorOrTexture &cot)
COLLADAFW::Color col = cot.getColor();
bNode *node = add_node(SH_NODE_RGB, -300, locy, "Specular");
set_color(node, col);
- // TODO: Connect node
+ /* TODO: Connect node */
}
- // texture
+ /* texture */
else if (cot.isTexture()) {
add_texture_node(cot, -300, locy, "Specular");
- // TODO: Connect node
+ /* TODO: Connect node */
}
}
diff --git a/source/blender/io/collada/MeshImporter.cpp b/source/blender/io/collada/MeshImporter.cpp
index 3d9c4d3ad6f..b0e3270a899 100644
--- a/source/blender/io/collada/MeshImporter.cpp
+++ b/source/blender/io/collada/MeshImporter.cpp
@@ -47,7 +47,7 @@
#include "MeshImporter.h"
#include "collada_utils.h"
-// get node name, or fall back to original id if not present (name is optional)
+/* get node name, or fall back to original id if not present (name is optional) */
template<class T> static std::string bc_get_dae_name(T *node)
{
return node->getName().empty() ? node->getOriginalId() : node->getName();
@@ -170,7 +170,7 @@ void VCOLDataWrapper::get_vcol(int v_index, MLoopCol *mloopcol)
case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT: {
COLLADAFW::ArrayPrimitiveType<float> *values = mVData->getFloatValues();
if (values->empty() || values->getCount() <= (v_index * stride + 2)) {
- return; // xxx need to create an error instead
+ return; /* xxx need to create an error instead */
}
mloopcol->r = unit_float_to_uchar_clamp((*values)[v_index * stride]);
@@ -181,7 +181,7 @@ void VCOLDataWrapper::get_vcol(int v_index, MLoopCol *mloopcol)
case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
if (values->empty() || values->getCount() <= (v_index * stride + 2)) {
- return; // xxx need to create an error instead
+ return; /* xxx need to create an error instead */
}
mloopcol->r = unit_float_to_uchar_clamp((*values)[v_index * stride]);
@@ -216,7 +216,7 @@ bool MeshImporter::set_poly_indices(
if (!broken_loop) {
for (int i = 0; i < index; i++) {
if (indices[i] == indices[index]) {
- // duplicate index -> not good
+ /* duplicate index -> not good */
broken_loop = true;
}
}
@@ -247,7 +247,7 @@ void MeshImporter::set_face_uv(MLoopUV *mloopuv,
COLLADAFW::IndexList &index_list,
int count)
{
- // per face vertex indices, this means for quad we have 4 indices, not 8
+ /* per face vertex indices, this means for quad we have 4 indices, not 8 */
COLLADAFW::UIntValuesArray &indices = index_list.getIndices();
for (int index = 0; index < count; index++) {
@@ -281,7 +281,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)
const char *type_str = bc_primTypeToStr(type);
- // OpenCollada passes POLYGONS type for <polylist>
+ /* OpenCollada passes POLYGONS type for <polylist> */
if (type == COLLADAFW::MeshPrimitive::POLYLIST || type == COLLADAFW::MeshPrimitive::POLYGONS) {
COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
@@ -319,7 +319,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)
}
else if (type == COLLADAFW::MeshPrimitive::LINES) {
- // TODO: Add Checker for line syntax here
+ /* TODO: Add Checker for line syntax here */
}
else if (type != COLLADAFW::MeshPrimitive::TRIANGLES &&
@@ -334,7 +334,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)
void MeshImporter::read_vertices(COLLADAFW::Mesh *mesh, Mesh *me)
{
- // vertices
+ /* vertices */
COLLADAFW::MeshVertexData &pos = mesh->getPositions();
if (pos.empty()) {
return;
@@ -356,12 +356,12 @@ void MeshImporter::read_vertices(COLLADAFW::Mesh *mesh, Mesh *me)
}
}
-// =====================================================================
-// condition 1: The Primitive has normals
-// condition 2: The number of normals equals the number of faces.
-// return true if both conditions apply.
-// return false otherwise.
-// =====================================================================
+/* =====================================================================
+ * condition 1: The Primitive has normals
+ * condition 2: The number of normals equals the number of faces.
+ * return true if both conditions apply.
+ * return false otherwise.
+ * ===================================================================== */
bool MeshImporter::primitive_has_useable_normals(COLLADAFW::MeshPrimitive *mp)
{
@@ -385,10 +385,10 @@ bool MeshImporter::primitive_has_useable_normals(COLLADAFW::MeshPrimitive *mp)
return has_useable_normals;
}
-// =====================================================================
-// Assume that only TRIANGLES, TRIANGLE_FANS, POLYLIST and POLYGONS
-// have faces. (to be verified)
-// =====================================================================
+/* =====================================================================
+ * Assume that only TRIANGLES, TRIANGLE_FANS, POLYLIST and POLYGONS
+ * have faces. (to be verified)
+ * ===================================================================== */
bool MeshImporter::primitive_has_faces(COLLADAFW::MeshPrimitive *mp)
{
@@ -420,19 +420,19 @@ static std::string extract_vcolname(const COLLADAFW::String &collada_id)
return colname;
}
-// =================================================================
-// Return the number of faces by summing up
-// the facecounts of the parts.
-// hint: This is done because mesh->getFacesCount() does
-// count loose edges as extra faces, which is not what we want here.
-// =================================================================
+/* =================================================================
+ * Return the number of faces by summing up
+ * the facecounts of the parts.
+ * hint: This is done because mesh->getFacesCount() does
+ * count loose edges as extra faces, which is not what we want here.
+ * ================================================================= */
void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
{
COLLADAFW::MeshPrimitiveArray &prim_arr = collada_mesh->getMeshPrimitives();
int total_poly_count = 0;
int total_loop_count = 0;
- // collect edge_count and face_count from all parts
+ /* collect edge_count and face_count from all parts */
for (int i = 0; i < prim_arr.getCount(); i++) {
COLLADAFW::MeshPrimitive *mp = prim_arr[i];
int type = mp->getPrimitiveType();
@@ -452,7 +452,7 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
total_poly_count++;
}
else {
- // TODO: this is a hole and not another polygon!
+ /* TODO: this is a hole and not another polygon! */
}
}
@@ -465,7 +465,7 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
}
}
- // Add the data containers
+ /* Add the data containers */
if (total_poly_count > 0) {
me->totpoly = total_poly_count;
me->totloop = total_loop_count;
@@ -485,11 +485,11 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
COLLADAFW::MeshVertexData::InputInfos *info =
collada_mesh->getUVCoords().getInputInfosArray()[i];
COLLADAFW::String &uvname = info->mName;
- // Allocate space for UV_data
+ /* Allocate space for UV_data */
CustomData_add_layer_named(
&me->ldata, CD_MLOOPUV, CD_DEFAULT, NULL, me->totloop, uvname.c_str());
}
- // activate the first uv map
+ /* activate the first uv map */
me->mloopuv = (MLoopUV *)CustomData_get_layer_n(&me->ldata, CD_MLOOPUV, 0);
}
@@ -535,7 +535,7 @@ unsigned int MeshImporter::get_loose_edge_count(COLLADAFW::Mesh *mesh)
COLLADAFW::MeshPrimitiveArray &prim_arr = mesh->getMeshPrimitives();
int loose_edge_count = 0;
- // collect edge_count and face_count from all parts
+ /* collect edge_count and face_count from all parts */
for (int i = 0; i < prim_arr.getCount(); i++) {
COLLADAFW::MeshPrimitive *mp = prim_arr[i];
int type = mp->getPrimitiveType();
@@ -552,13 +552,13 @@ unsigned int MeshImporter::get_loose_edge_count(COLLADAFW::Mesh *mesh)
return loose_edge_count;
}
-// =================================================================
-// This function is copied from source/blender/editors/mesh/mesh_data.c
-//
-// TODO: (As discussed with sergey-) :
-// Maybe move this function to blenderkernel/intern/mesh.c
-// and add definition to BKE_mesh.c
-// =================================================================
+/* =================================================================
+ * This function is copied from source/blender/editors/mesh/mesh_data.c
+ *
+ * TODO: (As discussed with sergey-) :
+ * Maybe move this function to blenderkernel/intern/mesh.c
+ * and add definition to BKE_mesh.c
+ * ================================================================= */
void MeshImporter::mesh_add_edges(Mesh *mesh, int len)
{
CustomData edata;
@@ -592,12 +592,12 @@ void MeshImporter::mesh_add_edges(Mesh *mesh, int len)
mesh->totedge = totedge;
}
-// =================================================================
-// Read all loose edges.
-// Important: This function assumes that all edges from existing
-// faces have already been generated and added to me->medge
-// So this function MUST be called after read_faces() (see below)
-// =================================================================
+/* =================================================================
+ * Read all loose edges.
+ * Important: This function assumes that all edges from existing
+ * faces have already been generated and added to me->medge
+ * So this function MUST be called after read_faces() (see below)
+ * ================================================================= */
void MeshImporter::read_lines(COLLADAFW::Mesh *mesh, Mesh *me)
{
unsigned int loose_edge_count = get_loose_edge_count(mesh);
@@ -631,13 +631,13 @@ void MeshImporter::read_lines(COLLADAFW::Mesh *mesh, Mesh *me)
}
}
-// =======================================================================
-// Read all faces from TRIANGLES, TRIANGLE_FANS, POLYLIST, POLYGON
-// Important: This function MUST be called before read_lines()
-// Otherwise we will loose all edges from faces (see read_lines() above)
-//
-// TODO: import uv set names
-// ========================================================================
+/* =======================================================================
+ * Read all faces from TRIANGLES, TRIANGLE_FANS, POLYLIST, POLYGON
+ * Important: This function MUST be called before read_lines()
+ * Otherwise we will loose all edges from faces (see read_lines() above)
+ *
+ * TODO: import uv set names
+ * ======================================================================== */
void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
{
unsigned int i;
@@ -660,7 +660,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
COLLADAFW::MeshPrimitive *mp = prim_arr[i];
- // faces
+ /* faces */
size_t prim_totpoly = mp->getFaceCount();
unsigned int *position_indices = mp->getPositionIndices().getData();
unsigned int *normal_indices = mp->getNormalIndices().getData();
@@ -670,28 +670,28 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
int collada_meshtype = mp->getPrimitiveType();
- // since we cannot set mpoly->mat_nr here, we store a portion of me->mpoly in Primitive
+ /* since we cannot set mpoly->mat_nr here, we store a portion of me->mpoly in Primitive */
Primitive prim = {mpoly, 0};
- // If MeshPrimitive is TRIANGLE_FANS we split it into triangles
- // The first trifan vertex will be the first vertex in every triangle
- // XXX The proper function of TRIANGLE_FANS is not tested!!!
- // XXX In particular the handling of the normal_indices looks very wrong to me
+ /* If MeshPrimitive is TRIANGLE_FANS we split it into triangles
+ * The first trifan vertex will be the first vertex in every triangle
+ * XXX The proper function of TRIANGLE_FANS is not tested!!!
+ * XXX In particular the handling of the normal_indices looks very wrong to me */
if (collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
unsigned int grouped_vertex_count = mp->getGroupedVertexElementsCount();
for (unsigned int group_index = 0; group_index < grouped_vertex_count; group_index++) {
- unsigned int first_vertex = position_indices[0]; // Store first trifan vertex
- unsigned int first_normal = normal_indices[0]; // Store first trifan vertex normal
+ unsigned int first_vertex = position_indices[0]; /* Store first trifan vertex */
+ unsigned int first_normal = normal_indices[0]; /* Store first trifan vertex normal */
unsigned int vertex_count = mp->getGroupedVerticesVertexCount(group_index);
for (unsigned int vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++) {
- // For each triangle store indices of its 3 vertices
+ /* For each triangle store indices of its 3 vertices */
unsigned int triangle_vertex_indices[3] = {
first_vertex, position_indices[1], position_indices[2]};
set_poly_indices(mpoly, mloop, loop_index, triangle_vertex_indices, 3);
- if (mp_has_normals) { // vertex normals, same implementation as for the triangles
- // the same for vertces normals
+ if (mp_has_normals) { /* vertex normals, same implementation as for the triangles */
+ /* the same for vertces normals */
unsigned int vertex_normal_indices[3] = {
first_normal, normal_indices[1], normal_indices[2]};
if (!is_flat_face(vertex_normal_indices, nor, 3)) {
@@ -706,7 +706,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
prim.totpoly++;
}
- // Moving cursor to the next triangle fan.
+ /* Moving cursor to the next triangle fan. */
if (mp_has_normals) {
normal_indices += 2;
}
@@ -727,10 +727,10 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
int invalid_loop_holes = 0;
for (unsigned int j = 0; j < prim_totpoly; j++) {
- // Vertices in polygon:
+ /* Vertices in polygon: */
int vcount = get_vertex_count(mpvc, j);
if (vcount < 0) {
- continue; // TODO: add support for holes
+ continue; /* TODO: add support for holes */
}
bool broken_loop = set_poly_indices(mpoly, mloop, loop_index, position_indices, vcount);
@@ -740,7 +740,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
for (unsigned int uvset_index = 0; uvset_index < index_list_array_uvcoord.getCount();
uvset_index++) {
- // get mtface by face index and uv set index
+ /* get mtface by face index and uv set index */
COLLADAFW::IndexList &index_list = *index_list_array_uvcoord[uvset_index];
MLoopUV *mloopuv = (MLoopUV *)CustomData_get_layer_named(
&me->ldata, CD_MLOOPUV, index_list.getName().c_str());
@@ -808,7 +808,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
}
else if (collada_meshtype == COLLADAFW::MeshPrimitive::LINES) {
- continue; // read the lines later after all the rest is done
+ continue; /* read the lines later after all the rest is done */
}
if (mp_has_faces) {
@@ -915,21 +915,21 @@ std::string *MeshImporter::get_geometry_name(const std::string &mesh_name)
static bool bc_has_same_material_configuration(Object *ob1, Object *ob2)
{
if (ob1->totcol != ob2->totcol) {
- return false; // not same number of materials
+ return false; /* not same number of materials */
}
if (ob1->totcol == 0) {
- return false; // no material at all
+ return false; /* no material at all */
}
for (int index = 0; index < ob1->totcol; index++) {
if (ob1->matbits[index] != ob2->matbits[index]) {
- return false; // shouldn't happen
+ return false; /* shouldn't happen */
}
if (ob1->matbits[index] == 0) {
- return false; // shouldn't happen
+ return false; /* shouldn't happen */
}
if (ob1->mat[index] != ob2->mat[index]) {
- return false; // different material assignment
+ return false; /* different material assignment */
}
}
return true;
@@ -1055,28 +1055,28 @@ void MeshImporter::assign_material_to_geom(
{
const COLLADAFW::UniqueId &ma_uid = cmaterial.getReferencedMaterial();
- // do we know this material?
+ /* do we know this material? */
if (uid_material_map.find(ma_uid) == uid_material_map.end()) {
fprintf(stderr, "Cannot find material by UID.\n");
return;
}
- // first time we get geom_uid, ma_uid pair. Save for later check.
+ /* first time we get geom_uid, ma_uid pair. Save for later check. */
materials_mapped_to_geom.insert(
std::pair<COLLADAFW::UniqueId, COLLADAFW::UniqueId>(*geom_uid, ma_uid));
Material *ma = uid_material_map[ma_uid];
- // Attention! This temporarily assigns material to object on purpose!
- // See note above.
+ /* Attention! This temporarily assigns material to object on purpose!
+ * See note above. */
ob->actcol = 0;
BKE_object_material_assign(m_bmain, ob, ma, mat_index + 1, BKE_MAT_ASSIGN_OBJECT);
MaterialIdPrimitiveArrayMap &mat_prim_map = geom_uid_mat_mapping_map[*geom_uid];
COLLADAFW::MaterialId mat_id = cmaterial.getMaterialId();
- // assign material indices to mesh faces
+ /* assign material indices to mesh faces */
if (mat_prim_map.find(mat_id) != mat_prim_map.end()) {
std::vector<Primitive> &prims = mat_prim_map[mat_id];
@@ -1102,7 +1102,7 @@ Object *MeshImporter::create_mesh_object(
{
const COLLADAFW::UniqueId *geom_uid = &geom->getInstanciatedObjectId();
- // check if node instantiates controller or geometry
+ /* check if node instantiates controller or geometry */
if (isController) {
geom_uid = armature_importer->get_geometry_uid(*geom_uid);
@@ -1115,8 +1115,8 @@ Object *MeshImporter::create_mesh_object(
else {
if (uid_mesh_map.find(*geom_uid) == uid_mesh_map.end()) {
- // this could happen if a mesh was not created
- // (e.g. if it contains unsupported geometry)
+ /* this could happen if a mesh was not created
+ * (e.g. if it contains unsupported geometry) */
fprintf(stderr, "Couldn't find a mesh by UID.\n");
return NULL;
}
@@ -1125,19 +1125,19 @@ Object *MeshImporter::create_mesh_object(
return NULL;
}
- // name Object
+ /* name Object */
const std::string &id = node->getName().empty() ? node->getOriginalId() : node->getName();
const char *name = (id.length()) ? id.c_str() : NULL;
- // add object
+ /* add object */
Object *ob = bc_add_object(m_bmain, scene, view_layer, OB_MESH, name);
- bc_set_mark(ob); // used later for material assignment optimization
+ bc_set_mark(ob); /* used later for material assignment optimization */
- // store object pointer for ArmatureImporter
+ /* store object pointer for ArmatureImporter */
uid_object_map[*geom_uid] = ob;
imported_objects.push_back(ob);
- // replace ob->data freeing the old one
+ /* replace ob->data freeing the old one */
Mesh *old_mesh = (Mesh *)ob->data;
Mesh *new_mesh = uid_mesh_map[*geom_uid];
@@ -1151,7 +1151,7 @@ Object *MeshImporter::create_mesh_object(
COLLADAFW::MaterialBindingArray &mat_array = geom->getMaterialBindings();
- // loop through geom's materials
+ /* loop through geom's materials */
for (unsigned int i = 0; i < mat_array.getCount(); i++) {
if (mat_array[i].getReferencedMaterial().isValid()) {
@@ -1162,18 +1162,18 @@ Object *MeshImporter::create_mesh_object(
}
}
- // clean up the mesh
+ /* clean up the mesh */
BKE_mesh_validate((Mesh *)ob->data, false, false);
return ob;
}
-// create a mesh storing a pointer in a map so it can be retrieved later by geometry UID
+/* create a mesh storing a pointer in a map so it can be retrieved later by geometry UID */
bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom)
{
if (geom->getType() != COLLADAFW::Geometry::GEO_TYPE_MESH) {
- // TODO: report warning
+ /* TODO: report warning */
fprintf(stderr, "Mesh type %s is not supported\n", bc_geomTypeToStr(geom->getType()));
return true;
}
@@ -1188,18 +1188,18 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom)
const std::string &str_geom_id = mesh->getName().empty() ? mesh->getOriginalId() :
mesh->getName();
Mesh *me = BKE_mesh_add(m_bmain, (char *)str_geom_id.c_str());
- id_us_min(&me->id); // is already 1 here, but will be set later in BKE_mesh_assign_object
+ id_us_min(&me->id); /* is already 1 here, but will be set later in BKE_mesh_assign_object */
- // store the Mesh pointer to link it later with an Object
- // mesh_geom_map needed to map mesh to its geometry name (for shape key naming)
+ /* store the Mesh pointer to link it later with an Object
+ * mesh_geom_map needed to map mesh to its geometry name (for shape key naming) */
this->uid_mesh_map[mesh->getUniqueId()] = me;
this->mesh_geom_map[std::string(me->id.name)] = str_geom_id;
read_vertices(mesh, me);
read_polys(mesh, me);
BKE_mesh_calc_edges(me, false, false);
- // read_lines() must be called after the face edges have been generated.
- // Otherwise the loose edges will be silently deleted again.
+ /* read_lines() must be called after the face edges have been generated.
+ * Otherwise the loose edges will be silently deleted again. */
read_lines(mesh, me);
return true;
diff --git a/source/blender/io/collada/SkinInfo.h b/source/blender/io/collada/SkinInfo.h
index 3b94e403b6d..7ce66b22a5f 100644
--- a/source/blender/io/collada/SkinInfo.h
+++ b/source/blender/io/collada/SkinInfo.h
@@ -35,28 +35,28 @@
#include "TransformReader.h"
#include "collada_internal.h"
-// This is used to store data passed in write_controller_data.
-// Arrays from COLLADAFW::SkinControllerData lose ownership, so do this class members
-// so that arrays don't get freed until we free them explicitly.
+/* This is used to store data passed in write_controller_data.
+ * Arrays from COLLADAFW::SkinControllerData lose ownership, so do this class members
+ * so that arrays don't get freed until we free them explicitly. */
class SkinInfo {
private:
- // to build armature bones from inverse bind matrices
+ /* to build armature bones from inverse bind matrices */
struct JointData {
- float inv_bind_mat[4][4]; // joint inverse bind matrix
- COLLADAFW::UniqueId joint_uid; // joint node UID
- // Object *ob_arm; // armature object
+ float inv_bind_mat[4][4]; /* joint inverse bind matrix */
+ COLLADAFW::UniqueId joint_uid; /* joint node UID */
+ // Object *ob_arm; /* armature object */
};
float bind_shape_matrix[4][4];
- // data from COLLADAFW::SkinControllerData, each array should be freed
+ /* data from COLLADAFW::SkinControllerData, each array should be freed */
COLLADAFW::UIntValuesArray joints_per_vertex;
COLLADAFW::UIntValuesArray weight_indices;
COLLADAFW::IntValuesArray joint_indices;
- // COLLADAFW::FloatOrDoubleArray weights;
+ /* COLLADAFW::FloatOrDoubleArray weights; */
std::vector<float> weights;
- std::vector<JointData> joint_data; // index to this vector is joint index
+ std::vector<JointData> joint_data; /* index to this vector is joint index */
UnitConverter *unit_converter;
@@ -69,10 +69,10 @@ class SkinInfo {
SkinInfo(const SkinInfo &skin);
SkinInfo(UnitConverter *conv);
- // nobody owns the data after this, so it should be freed manually with releaseMemory
+ /* nobody owns the data after this, so it should be freed manually with releaseMemory */
template<typename T> void transfer_array_data(T &src, T &dest);
- // when src is const we cannot src.yieldOwnerShip, this is used by copy constructor
+ /* when src is const we cannot src.yieldOwnerShip, this is used by copy constructor */
void transfer_int_array_data_const(const COLLADAFW::IntValuesArray &src,
COLLADAFW::IntValuesArray &dest);
@@ -83,14 +83,14 @@ class SkinInfo {
void free();
- // using inverse bind matrices to construct armature
- // it is safe to invert them to get the original matrices
- // because if they are inverse matrices, they can be inverted
+ /* using inverse bind matrices to construct armature
+ * it is safe to invert them to get the original matrices
+ * because if they are inverse matrices, they can be inverted */
void add_joint(const COLLADABU::Math::Matrix4 &matrix);
void set_controller(const COLLADAFW::SkinController *co);
- // called from write_controller
+ /* called from write_controller */
Object *create_armature(Main *bmain, Scene *scene, ViewLayer *view_layer);
Object *set_armature(Object *ob_arm);
@@ -101,11 +101,11 @@ class SkinInfo {
const COLLADAFW::UniqueId &get_controller_uid();
- // check if this skin controller references a joint or any descendant of it
- //
- // some nodes may not be referenced by SkinController,
- // in this case to determine if the node belongs to this armature,
- // we need to search down the tree
+ /* check if this skin controller references a joint or any descendant of it
+ *
+ * some nodes may not be referenced by SkinController,
+ * in this case to determine if the node belongs to this armature,
+ * we need to search down the tree */
bool uses_joint_or_descendant(COLLADAFW::Node *node);
void link_armature(bContext *C,
diff --git a/source/blender/io/collada/TransformReader.cpp b/source/blender/io/collada/TransformReader.cpp
index 87b8763fb6a..393393be65b 100644
--- a/source/blender/io/collada/TransformReader.cpp
+++ b/source/blender/io/collada/TransformReader.cpp
@@ -54,9 +54,9 @@ void TransformReader::get_node_mat(float mat[4][4],
switch (type) {
case COLLADAFW::Transformation::MATRIX:
- // When matrix AND Trans/Rot/Scale are defined for a node,
- // then this is considered as redundant information.
- // So if we find a Matrix we use that and return.
+ /* When matrix AND Trans/Rot/Scale are defined for a node,
+ * then this is considered as redundant information.
+ * So if we find a Matrix we use that and return. */
dae_matrix_to_mat4(tm, mat);
if (parent_mat) {
mul_m4_m4m4(mat, parent_mat, mat);
@@ -83,10 +83,10 @@ void TransformReader::get_node_mat(float mat[4][4],
mul_m4_m4m4(mat, copy, cur);
if (animation_map) {
- // AnimationList that drives this Transformation
+ /* AnimationList that drives this Transformation */
const COLLADAFW::UniqueId &anim_list_id = tm->getAnimationList();
- // store this so later we can link animation data with ob
+ /* store this so later we can link animation data with ob */
Animation anim = {ob, node, tm};
(*animation_map)[anim_list_id] = anim;
}
diff --git a/source/blender/io/collada/TransformReader.h b/source/blender/io/collada/TransformReader.h
index f8a73ce3912..9b87f56699e 100644
--- a/source/blender/io/collada/TransformReader.h
+++ b/source/blender/io/collada/TransformReader.h
@@ -44,7 +44,7 @@ class TransformReader {
struct Animation {
Object *ob;
COLLADAFW::Node *node;
- COLLADAFW::Transformation *tm; // which transform is animated by an AnimationList->id
+ COLLADAFW::Transformation *tm; /* which transform is animated by an AnimationList->id */
};
TransformReader(UnitConverter *conv);
diff --git a/source/blender/io/collada/collada_internal.cpp b/source/blender/io/collada/collada_internal.cpp
index 66810685979..091bd2cd7c2 100644
--- a/source/blender/io/collada/collada_internal.cpp
+++ b/source/blender/io/collada/collada_internal.cpp
@@ -71,12 +71,12 @@ void UnitConverter::convertVector3(COLLADABU::Math::Vector3 &vec, float *v)
v[2] = vec.z;
}
-// TODO need also for angle conversion, time conversion...
+/* TODO need also for angle conversion, time conversion... */
void UnitConverter::dae_matrix_to_mat4_(float out[4][4], const COLLADABU::Math::Matrix4 &in)
{
- // in DAE, matrices use columns vectors, (see comments in COLLADABUMathMatrix4.h)
- // so here, to make a blender matrix, we swap columns and rows
+ /* in DAE, matrices use columns vectors, (see comments in COLLADABUMathMatrix4.h)
+ * so here, to make a blender matrix, we swap columns and rows. */
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
out[i][j] = in[j][i];
@@ -138,7 +138,7 @@ void UnitConverter::calculate_scale(Scene &sce)
switch (type) {
case USER_UNIT_NONE:
- bl_scale = 1.0; // map 1 Blender unit to 1 Meter
+ bl_scale = 1.0; /* map 1 Blender unit to 1 Meter. */
break;
case USER_UNIT_METRIC:
@@ -147,8 +147,8 @@ void UnitConverter::calculate_scale(Scene &sce)
default:
bl_scale = RNA_property_float_get(&unit_settings, scale_ptr);
- // it looks like the conversion to Imperial is done implicitly.
- // So nothing to do here.
+ /* It looks like the conversion to Imperial is done implicitly.
+ * So nothing to do here. */
break;
}
@@ -231,9 +231,9 @@ std::string translate_id(const std::string &id)
for (unsigned int i = 1; i < id_translated.size(); i++) {
id_translated[i] = translate_name_map[(unsigned int)id_translated[i]];
}
- // It's so much workload now, the if () should speed up things.
+ /* It's so much workload now, the if () should speed up things. */
if (id_translated != id) {
- // Search duplicates
+ /* Search duplicates. */
map_string_list::iterator iter = global_id_map.find(id_translated);
if (iter != global_id_map.end()) {
unsigned int i = 0;
diff --git a/source/blender/io/collada/collada_internal.h b/source/blender/io/collada/collada_internal.h
index de4e1d7e0d4..1d2ed11bfe6 100644
--- a/source/blender/io/collada/collada_internal.h
+++ b/source/blender/io/collada/collada_internal.h
@@ -51,7 +51,7 @@ class UnitConverter {
Imperial,
};
- // Initialize with Z_UP, since Blender uses right-handed, z-up
+ /* Initialize with Z_UP, since Blender uses right-handed, z-up */
UnitConverter();
void read_asset(const COLLADAFW::FileInfo *asset);
@@ -62,7 +62,7 @@ class UnitConverter {
float getLinearMeter(void);
- // TODO need also for angle conversion, time conversion...
+ /* TODO need also for angle conversion, time conversion... */
static void dae_matrix_to_mat4_(float out[4][4], const COLLADABU::Math::Matrix4 &in);
static void mat4_to_dae(float out[4][4], float in[4][4]);
diff --git a/source/blender/io/common/IO_abstract_hierarchy_iterator.h b/source/blender/io/common/IO_abstract_hierarchy_iterator.h
index e3ed3dd70a2..e066ca8ba8f 100644
--- a/source/blender/io/common/IO_abstract_hierarchy_iterator.h
+++ b/source/blender/io/common/IO_abstract_hierarchy_iterator.h
@@ -86,9 +86,9 @@ struct HierarchyContext {
bool animation_check_include_parent;
/*********** Determined during writer creation: ***************/
- float parent_matrix_inv_world[4][4]; // Inverse of the parent's world matrix.
- std::string export_path; // Hierarchical path, such as "/grandparent/parent/objectname".
- ParticleSystem *particle_system; // Only set for particle/hair writers.
+ float parent_matrix_inv_world[4][4]; /* Inverse of the parent's world matrix. */
+ std::string export_path; /* Hierarchical path, such as "/grandparent/parent/objectname". */
+ ParticleSystem *particle_system; /* Only set for particle/hair writers. */
/* Hierarchical path of the object this object is duplicating; only set when this object should
* be stored as a reference to its original. It can happen that the original is not part of the
@@ -127,9 +127,9 @@ class AbstractHierarchyWriter {
public:
virtual ~AbstractHierarchyWriter();
virtual void write(HierarchyContext &context) = 0;
- // TODO(Sybren): add function like absent() that's called when a writer was previously created,
- // but wasn't used while exporting the current frame (for example, a particle-instanced mesh of
- // which the particle is no longer alive).
+ /* TODO(Sybren): add function like absent() that's called when a writer was previously created,
+ * but wasn't used while exporting the current frame (for example, a particle-instanced mesh of
+ * which the particle is no longer alive). */
protected:
/* Return true if the data written by this writer changes over time.
* Note that this function assumes this is an object data writer. Transform writers should not
diff --git a/source/blender/io/common/intern/abstract_hierarchy_iterator.cc b/source/blender/io/common/intern/abstract_hierarchy_iterator.cc
index 6e763c29631..6077fc89b91 100644
--- a/source/blender/io/common/intern/abstract_hierarchy_iterator.cc
+++ b/source/blender/io/common/intern/abstract_hierarchy_iterator.cc
@@ -57,7 +57,7 @@ bool HierarchyContext::operator<(const HierarchyContext &other) const
return object < other.object;
}
if (duplicator != nullptr && duplicator == other.duplicator) {
- // Only resort to string comparisons when both objects are created by the same duplicator.
+ /* Only resort to string comparisons when both objects are created by the same duplicator. */
return export_name < other.export_name;
}
@@ -291,16 +291,16 @@ void AbstractHierarchyIterator::export_graph_construct()
object,
DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY |
DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET) {
- // Non-instanced objects always have their object-parent as export-parent.
+ /* Non-instanced objects always have their object-parent as export-parent. */
const bool weak_export = mark_as_weak_export(object);
visit_object(object, object->parent, weak_export);
if (weak_export) {
- // If a duplicator shouldn't be exported, its duplilist also shouldn't be.
+ /* If a duplicator shouldn't be exported, its duplilist also shouldn't be. */
continue;
}
- // Export the duplicated objects instanced by this object.
+ /* Export the duplicated objects instanced by this object. */
ListBase *lb = object_duplilist(depsgraph_, scene, object);
if (lb) {
DupliParentFinder dupli_parent_finder;
@@ -328,29 +328,29 @@ void AbstractHierarchyIterator::export_graph_construct()
void AbstractHierarchyIterator::connect_loose_objects()
{
- // Find those objects whose parent is not part of the export graph; these
- // objects would be skipped when traversing the graph as a hierarchy.
- // These objects will have to be re-attached to some parent object in order to
- // fit into the hierarchy.
+ /* Find those objects whose parent is not part of the export graph; these
+ * objects would be skipped when traversing the graph as a hierarchy.
+ * These objects will have to be re-attached to some parent object in order to
+ * fit into the hierarchy. */
ExportGraph loose_objects_graph = export_graph_;
for (const ExportGraph::value_type &map_iter : export_graph_) {
for (const HierarchyContext *child : map_iter.second) {
- // An object that is marked as a child of another object is not considered 'loose'.
+ /* An object that is marked as a child of another object is not considered 'loose'. */
ObjectIdentifier child_oid = ObjectIdentifier::for_hierarchy_context(child);
loose_objects_graph.erase(child_oid);
}
}
- // The root of the hierarchy is always found, so it's never considered 'loose'.
+ /* The root of the hierarchy is always found, so it's never considered 'loose'. */
loose_objects_graph.erase(ObjectIdentifier::for_graph_root());
- // Iterate over the loose objects and connect them to their export parent.
+ /* Iterate over the loose objects and connect them to their export parent. */
for (const ExportGraph::value_type &map_iter : loose_objects_graph) {
const ObjectIdentifier &graph_key = map_iter.first;
Object *object = graph_key.object;
while (true) {
- // Loose objects will all be real objects, as duplicated objects always have
- // their duplicator or other exported duplicated object as ancestor.
+ /* Loose objects will all be real objects, as duplicated objects always have
+ * their duplicator or other exported duplicated object as ancestor. */
ExportGraph::iterator found_parent_iter = export_graph_.find(
ObjectIdentifier::for_real_object(object->parent));
@@ -358,8 +358,8 @@ void AbstractHierarchyIterator::connect_loose_objects()
if (found_parent_iter != export_graph_.end()) {
break;
}
- // 'object->parent' will never be nullptr here, as the export graph contains the
- // root as nullptr and thus will cause a break above.
+ /* 'object->parent' will never be nullptr here, as the export graph contains the
+ * root as nullptr and thus will cause a break above. */
BLI_assert(object->parent != nullptr);
object = object->parent;
@@ -383,7 +383,7 @@ static bool remove_weak_subtrees(const HierarchyContext *context,
all_is_weak &= child_tree_is_weak;
if (child_tree_is_weak) {
- // This subtree is all weak, so we can remove it from the current object's children.
+ /* This subtree is all weak, so we can remove it from the current object's children. */
clean_graph[map_key].erase(child_context);
delete child_context;
}
@@ -391,7 +391,7 @@ static bool remove_weak_subtrees(const HierarchyContext *context,
}
if (all_is_weak) {
- // This node and all its children are weak, so it can be removed from the export graph.
+ /* This node and all its children are weak, so it can be removed from the export graph. */
clean_graph.erase(map_key);
}
@@ -400,7 +400,7 @@ static bool remove_weak_subtrees(const HierarchyContext *context,
void AbstractHierarchyIterator::export_graph_prune()
{
- // Take a copy of the map so that we can modify while recursing.
+ /* Take a copy of the map so that we can modify while recursing. */
ExportGraph unpruned_export_graph = export_graph_;
remove_weak_subtrees(HierarchyContext::root(), export_graph_, unpruned_export_graph);
}
@@ -435,14 +435,14 @@ void AbstractHierarchyIterator::visit_object(Object *object,
ExportGraph::key_type graph_index = determine_graph_index_object(context);
context_update_for_graph_index(context, graph_index);
- // Store this HierarchyContext as child of the export parent.
+ /* Store this HierarchyContext as child of the export parent. */
export_graph_[graph_index].insert(context);
- // Create an empty entry for this object to indicate it is part of the export. This will be used
- // by connect_loose_objects(). Having such an "indicator" will make it possible to do an O(log n)
- // check on whether an object is part of the export, rather than having to check all objects in
- // the map. Note that it's not possible to simply search for (object->parent, nullptr), as the
- // object's parent in Blender may not be the same as its export-parent.
+ /* Create an empty entry for this object to indicate it is part of the export. This will be used
+ * by connect_loose_objects(). Having such an "indicator" will make it possible to do an O(log n)
+ * check on whether an object is part of the export, rather than having to check all objects in
+ * the map. Note that it's not possible to simply search for (object->parent, nullptr), as the
+ * object's parent in Blender may not be the same as its export-parent. */
ExportGraph::key_type object_key = ObjectIdentifier::for_real_object(object);
if (export_graph_.find(object_key) == export_graph_.end()) {
export_graph_[object_key] = ExportChildren();
@@ -471,7 +471,7 @@ void AbstractHierarchyIterator::visit_dupli_object(DupliObject *dupli_object,
copy_m4_m4(context->matrix_world, dupli_object->mat);
- // Construct export name for the dupli-instance.
+ /* Construct export name for the dupli-instance. */
std::stringstream export_name_stream;
export_name_stream << get_object_name(context->object) << "-"
<< context->persistent_id.as_object_name_suffix();
@@ -500,7 +500,7 @@ AbstractHierarchyIterator::ExportGraph::key_type AbstractHierarchyIterator::
void AbstractHierarchyIterator::context_update_for_graph_index(
HierarchyContext *context, const ExportGraph::key_type &graph_index) const
{
- // Update the HierarchyContext so that it is consistent with the graph index.
+ /* Update the HierarchyContext so that it is consistent with the graph index. */
context->export_parent = graph_index.object;
if (context->export_parent != context->object->parent) {
/* The parent object in Blender is NOT used as the export parent. This means
@@ -550,7 +550,7 @@ void AbstractHierarchyIterator::determine_duplication_references(
const ExportPathMap::const_iterator &it = duplisource_export_path_.find(source_id);
if (it == duplisource_export_path_.end()) {
- // The original was not found, so mark this instance as "the original".
+ /* The original was not found, so mark this instance as "the original". */
context->mark_as_not_instanced();
duplisource_export_path_[source_id] = context->export_path;
}
@@ -563,7 +563,7 @@ void AbstractHierarchyIterator::determine_duplication_references(
const ExportPathMap::const_iterator &it = duplisource_export_path_.find(source_data_id);
if (it == duplisource_export_path_.end()) {
- // The original was not found, so mark this instance as "original".
+ /* The original was not found, so mark this instance as "original". */
std::string data_path = get_object_data_path(context);
context->mark_as_not_instanced();
duplisource_export_path_[source_id] = context->export_path;
@@ -588,19 +588,19 @@ void AbstractHierarchyIterator::make_writers(const HierarchyContext *parent_cont
}
for (HierarchyContext *context : graph_children(parent_context)) {
- // Update the context so that it is correct for this parent-child relation.
+ /* Update the context so that it is correct for this parent-child relation. */
copy_m4_m4(context->parent_matrix_inv_world, parent_matrix_inv_world);
if (parent_context != nullptr) {
context->higher_up_export_path = parent_context->export_path;
}
- // Get or create the transform writer.
+ /* Get or create the transform writer. */
EnsuredWriter transform_writer = ensure_writer(
context, &AbstractHierarchyIterator::create_transform_writer);
if (!transform_writer) {
- // Unable to export, so there is nothing to attach any children to; just abort this entire
- // branch of the export hierarchy.
+ /* Unable to export, so there is nothing to attach any children to; just abort this entire
+ * branch of the export hierarchy. */
return;
}
@@ -617,11 +617,12 @@ void AbstractHierarchyIterator::make_writers(const HierarchyContext *parent_cont
make_writer_object_data(context);
}
- // Recurse into this object's children.
+ /* Recurse into this object's children. */
make_writers(context);
}
- // TODO(Sybren): iterate over all unused writers and call unused_during_iteration() or something.
+ /* TODO(Sybren): iterate over all unused writers and call unused_during_iteration() or something.
+ */
}
HierarchyContext AbstractHierarchyIterator::context_for_object_data(
@@ -750,7 +751,7 @@ bool AbstractHierarchyIterator::mark_as_weak_export(const Object * /*object*/) c
}
bool AbstractHierarchyIterator::should_visit_dupli_object(const DupliObject *dupli_object) const
{
- // Removing dupli_object->no_draw hides things like custom bone shapes.
+ /* Removing dupli_object->no_draw hides things like custom bone shapes. */
return !dupli_object->no_draw;
}
diff --git a/source/blender/io/common/intern/abstract_hierarchy_iterator_test.cc b/source/blender/io/common/intern/abstract_hierarchy_iterator_test.cc
index 27196994a3c..6e4509afd30 100644
--- a/source/blender/io/common/intern/abstract_hierarchy_iterator_test.cc
+++ b/source/blender/io/common/intern/abstract_hierarchy_iterator_test.cc
@@ -145,7 +145,7 @@ TEST_F(AbstractHierarchyIteratorTest, ExportHierarchyTest)
iterator->iterate_and_write();
- // Mapping from object name to set of export paths.
+ /* Mapping from object name to set of export paths. */
used_writers expected_transforms = {
{"OBCamera", {"/Camera"}},
{"OBDupli1", {"/Dupli1"}},
@@ -196,12 +196,12 @@ TEST_F(AbstractHierarchyIteratorTest, ExportHierarchyTest)
EXPECT_EQ(expected_data, iterator->data_writers);
- // The scene has no hair or particle systems.
+ /* The scene has no hair or particle systems. */
EXPECT_EQ(0, iterator->hair_writers.size());
EXPECT_EQ(0, iterator->particle_writers.size());
- // On the second iteration, everything should be written as well.
- // This tests the default value of iterator->export_subset_.
+ /* On the second iteration, everything should be written as well.
+ * This tests the default value of iterator->export_subset_. */
iterator->transform_writers.clear();
iterator->data_writers.clear();
iterator->iterate_and_write();
@@ -211,8 +211,8 @@ TEST_F(AbstractHierarchyIteratorTest, ExportHierarchyTest)
TEST_F(AbstractHierarchyIteratorTest, ExportSubsetTest)
{
- // The scene has no hair or particle systems, and this is already covered by ExportHierarchyTest,
- // so not included here. Update this test when hair & particle systems are included.
+ /* The scene has no hair or particle systems, and this is already covered by ExportHierarchyTest,
+ * so not included here. Update this test when hair & particle systems are included. */
/* Load the test blend file. */
if (!blendfile_load("usd/usd_hierarchy_export_test.blend")) {
@@ -221,7 +221,7 @@ TEST_F(AbstractHierarchyIteratorTest, ExportSubsetTest)
depsgraph_create(DAG_EVAL_RENDER);
iterator_create();
- // Mapping from object name to set of export paths.
+ /* Mapping from object name to set of export paths. */
used_writers expected_transforms = {
{"OBCamera", {"/Camera"}},
{"OBDupli1", {"/Dupli1"}},
@@ -269,8 +269,8 @@ TEST_F(AbstractHierarchyIteratorTest, ExportSubsetTest)
{"OBParentOfDupli2", {"/ParentOfDupli2/Icosphere"}},
};
- // Even when only asking an export of transforms, on the first frame everything should be
- // exported.
+ /* Even when only asking an export of transforms, on the first frame everything should be
+ * exported. */
{
ExportSubset export_subset = {0};
export_subset.transforms = true;
@@ -281,20 +281,20 @@ TEST_F(AbstractHierarchyIteratorTest, ExportSubsetTest)
EXPECT_EQ(expected_transforms, iterator->transform_writers);
EXPECT_EQ(expected_data, iterator->data_writers);
- // Clear data to prepare for the next iteration.
+ /* Clear data to prepare for the next iteration. */
iterator->transform_writers.clear();
iterator->data_writers.clear();
- // Second iteration, should only write transforms now.
+ /* Second iteration, should only write transforms now. */
iterator->iterate_and_write();
EXPECT_EQ(expected_transforms, iterator->transform_writers);
EXPECT_EQ(0, iterator->data_writers.size());
- // Clear data to prepare for the next iteration.
+ /* Clear data to prepare for the next iteration. */
iterator->transform_writers.clear();
iterator->data_writers.clear();
- // Third iteration, should only write data now.
+ /* Third iteration, should only write data now. */
{
ExportSubset export_subset = {0};
export_subset.transforms = false;
@@ -305,11 +305,11 @@ TEST_F(AbstractHierarchyIteratorTest, ExportSubsetTest)
EXPECT_EQ(0, iterator->transform_writers.size());
EXPECT_EQ(expected_data, iterator->data_writers);
- // Clear data to prepare for the next iteration.
+ /* Clear data to prepare for the next iteration. */
iterator->transform_writers.clear();
iterator->data_writers.clear();
- // Fourth iteration, should export everything now.
+ /* Fourth iteration, should export everything now. */
{
ExportSubset export_subset = {0};
export_subset.transforms = true;
@@ -343,7 +343,7 @@ TEST_F(AbstractHierarchyIteratorInvisibleTest, ExportInvisibleTest)
iterator->iterate_and_write();
- // Mapping from object name to set of export paths.
+ /* Mapping from object name to set of export paths. */
used_writers expected_transforms = {{"OBInvisibleAnimatedCube", {"/InvisibleAnimatedCube"}},
{"OBInvisibleCube", {"/InvisibleCube"}},
{"OBVisibleCube", {"/VisibleCube"}}};
@@ -355,7 +355,7 @@ TEST_F(AbstractHierarchyIteratorInvisibleTest, ExportInvisibleTest)
EXPECT_EQ(expected_data, iterator->data_writers);
- // The scene has no hair or particle systems.
+ /* The scene has no hair or particle systems. */
EXPECT_EQ(0, iterator->hair_writers.size());
EXPECT_EQ(0, iterator->particle_writers.size());
}
diff --git a/source/blender/io/common/intern/object_identifier_test.cc b/source/blender/io/common/intern/object_identifier_test.cc
index 2b565876f22..30e1e43d076 100644
--- a/source/blender/io/common/intern/object_identifier_test.cc
+++ b/source/blender/io/common/intern/object_identifier_test.cc
@@ -175,7 +175,7 @@ TEST_F(ObjectIdentifierOrderTest, map_copy_and_update)
AbstractHierarchyIterator::ExportGraph graph_copy = graph;
EXPECT_EQ(5, graph_copy.size());
- // Updating a value in a copy should not update the original.
+ /* Updating a value in a copy should not update the original. */
HierarchyContext ctx1;
HierarchyContext ctx2;
ctx1.object = fake_pointer(1);
@@ -184,7 +184,7 @@ TEST_F(ObjectIdentifierOrderTest, map_copy_and_update)
graph_copy[id_root].insert(&ctx1);
EXPECT_EQ(0, graph[id_root].size());
- // Deleting a key in the copy should not update the original.
+ /* Deleting a key in the copy should not update the original. */
graph_copy.erase(id_dupli_c);
EXPECT_EQ(4, graph_copy.size());
EXPECT_EQ(5, graph.size());
diff --git a/source/blender/io/usd/intern/usd_capi.cc b/source/blender/io/usd/intern/usd_capi.cc
index 4717f27dbd9..7b375689543 100644
--- a/source/blender/io/usd/intern/usd_capi.cc
+++ b/source/blender/io/usd/intern/usd_capi.cc
@@ -88,7 +88,7 @@ static void export_startjob(void *customdata,
WM_set_locked_interface(data->wm, true);
G.is_break = false;
- // Construct the depsgraph for exporting.
+ /* Construct the depsgraph for exporting. */
Scene *scene = DEG_get_input_scene(data->depsgraph);
if (data->params.visible_objects_only) {
DEG_graph_build_from_view_layer(data->depsgraph);
@@ -101,7 +101,7 @@ static void export_startjob(void *customdata,
*progress = 0.0f;
*do_update = true;
- // For restoring the current frame after exporting animation is done.
+ /* For restoring the current frame after exporting animation is done. */
const int orig_frame = CFRA;
pxr::UsdStageRefPtr usd_stage = pxr::UsdStage::CreateNew(data->filename);
@@ -120,7 +120,7 @@ static void export_startjob(void *customdata,
usd_stage->GetRootLayer()->SetDocumentation(std::string("Blender v") +
BKE_blender_version_string());
- // Set up the stage for animated data.
+ /* Set up the stage for animated data. */
if (data->params.export_animation) {
usd_stage->SetTimeCodesPerSecond(FPS);
usd_stage->SetStartTimeCode(scene->r.sfra);
@@ -130,7 +130,7 @@ static void export_startjob(void *customdata,
USDHierarchyIterator iter(data->depsgraph, usd_stage, data->params);
if (data->params.export_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. */
float progress_per_frame = 1.0f / std::max(1, (scene->r.efra - scene->r.sfra + 1));
for (float frame = scene->r.sfra; frame <= scene->r.efra; frame++) {
@@ -138,7 +138,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);
@@ -151,14 +151,14 @@ 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();
usd_stage->GetRootLayer()->Save();
- // 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/usd/intern/usd_writer_abstract.cc b/source/blender/io/usd/intern/usd_writer_abstract.cc
index 3f5babdee56..17d51c9b7cc 100644
--- a/source/blender/io/usd/intern/usd_writer_abstract.cc
+++ b/source/blender/io/usd/intern/usd_writer_abstract.cc
@@ -25,7 +25,7 @@
/* TfToken objects are not cheap to construct, so we do it once. */
namespace usdtokens {
-// Materials
+/* Materials */
static const pxr::TfToken diffuse_color("diffuseColor", pxr::TfToken::Immortal);
static const pxr::TfToken metallic("metallic", pxr::TfToken::Immortal);
static const pxr::TfToken preview_shader("previewShader", pxr::TfToken::Immortal);
@@ -58,8 +58,8 @@ pxr::UsdTimeCode USDAbstractWriter::get_export_time_code() const
if (is_animated_) {
return usd_export_context_.hierarchy_iterator->get_export_time_code();
}
- // By using the default timecode USD won't even write a single `timeSample` for non-animated
- // data. Instead, it writes it as non-timesampled.
+ /* By using the default timecode USD won't even write a single `timeSample` for non-animated
+ * data. Instead, it writes it as non-timesampled. */
static pxr::UsdTimeCode default_timecode = pxr::UsdTimeCode::Default();
return default_timecode;
}
@@ -90,7 +90,7 @@ pxr::UsdShadeMaterial USDAbstractWriter::ensure_usd_material(Material *material)
static pxr::SdfPath material_library_path("/_materials");
pxr::UsdStageRefPtr stage = usd_export_context_.stage;
- // Construct the material.
+ /* Construct the material. */
pxr::TfToken material_name(usd_export_context_.hierarchy_iterator->get_id_name(&material->id));
pxr::SdfPath usd_path = material_library_path.AppendChild(material_name);
pxr::UsdShadeMaterial usd_material = pxr::UsdShadeMaterial::Get(stage, usd_path);
@@ -99,7 +99,7 @@ pxr::UsdShadeMaterial USDAbstractWriter::ensure_usd_material(Material *material)
}
usd_material = pxr::UsdShadeMaterial::Define(stage, usd_path);
- // Construct the shader.
+ /* Construct the shader. */
pxr::SdfPath shader_path = usd_path.AppendChild(usdtokens::preview_shader);
pxr::UsdShadeShader shader = pxr::UsdShadeShader::Define(stage, shader_path);
shader.CreateIdAttr(pxr::VtValue(usdtokens::preview_surface));
@@ -108,7 +108,7 @@ pxr::UsdShadeMaterial USDAbstractWriter::ensure_usd_material(Material *material)
shader.CreateInput(usdtokens::roughness, pxr::SdfValueTypeNames->Float).Set(material->roughness);
shader.CreateInput(usdtokens::metallic, pxr::SdfValueTypeNames->Float).Set(material->metallic);
- // Connect the shader and the material together.
+ /* Connect the shader and the material together. */
usd_material.CreateSurfaceOutput().ConnectToSource(shader, usdtokens::surface);
return usd_material;
diff --git a/source/blender/io/usd/intern/usd_writer_camera.cc b/source/blender/io/usd/intern/usd_writer_camera.cc
index f21a0444888..677be9a7fc4 100644
--- a/source/blender/io/usd/intern/usd_writer_camera.cc
+++ b/source/blender/io/usd/intern/usd_writer_camera.cc
@@ -96,7 +96,7 @@ void USDCameraWriter::do_write(HierarchyContext &context)
usd_camera.CreateClippingRangeAttr().Set(
pxr::VtValue(pxr::GfVec2f(camera->clip_start, camera->clip_end)), timecode);
- // Write DoF-related attributes.
+ /* Write DoF-related attributes. */
if (camera->dof.flag & CAM_DOF_ENABLED) {
usd_camera.CreateFStopAttr().Set(camera->dof.aperture_fstop, timecode);
diff --git a/source/blender/io/usd/intern/usd_writer_hair.cc b/source/blender/io/usd/intern/usd_writer_hair.cc
index df09aa2f187..5de8f3cefef 100644
--- a/source/blender/io/usd/intern/usd_writer_hair.cc
+++ b/source/blender/io/usd/intern/usd_writer_hair.cc
@@ -44,7 +44,7 @@ void USDHairWriter::do_write(HierarchyContext &context)
pxr::UsdGeomBasisCurves curves = pxr::UsdGeomBasisCurves::Define(usd_export_context_.stage,
usd_export_context_.usd_path);
- // TODO(Sybren): deal with (psys->part->flag & PART_HAIR_BSPLINE)
+ /* TODO(Sybren): deal with (psys->part->flag & PART_HAIR_BSPLINE) */
curves.CreateBasisAttr(pxr::VtValue(pxr::UsdGeomTokens->bspline));
curves.CreateTypeAttr(pxr::VtValue(pxr::UsdGeomTokens->cubic));
diff --git a/source/blender/io/usd/intern/usd_writer_mesh.cc b/source/blender/io/usd/intern/usd_writer_mesh.cc
index 3f9cb78ea3b..17c41e0edc1 100644
--- a/source/blender/io/usd/intern/usd_writer_mesh.cc
+++ b/source/blender/io/usd/intern/usd_writer_mesh.cc
@@ -180,8 +180,8 @@ void USDGenericMeshWriter::write_mesh(HierarchyContext &context, Mesh *mesh)
true);
if (!attr_points.HasValue()) {
- // Provide the initial value as default. This makes USD write the value as constant if they
- // don't change over time.
+ /* Provide the initial value as default. This makes USD write the value as constant if they
+ * don't change over time. */
attr_points.Set(usd_mesh_data.points, defaultTime);
attr_face_vertex_counts.Set(usd_mesh_data.face_vertex_counts, defaultTime);
attr_face_vertex_indices.Set(usd_mesh_data.face_indices, defaultTime);
@@ -221,7 +221,7 @@ void USDGenericMeshWriter::write_mesh(HierarchyContext &context, Mesh *mesh)
}
write_surface_velocity(context.object, mesh, usd_mesh);
- // TODO(Sybren): figure out what happens when the face groups change.
+ /* TODO(Sybren): figure out what happens when the face groups change. */
if (frame_has_been_written_) {
return;
}
@@ -342,7 +342,7 @@ void USDGenericMeshWriter::assign_materials(const HierarchyContext &context,
return;
}
- // Define a geometry subset per material.
+ /* Define a geometry subset per material. */
for (const MaterialFaceGroups::value_type &face_group : usd_face_groups) {
short material_number = face_group.first;
const pxr::VtIntArray &face_indices = face_group.second;
diff --git a/source/blender/io/usd/intern/usd_writer_transform.cc b/source/blender/io/usd/intern/usd_writer_transform.cc
index 632a6dd0f3f..136b5c477a2 100644
--- a/source/blender/io/usd/intern/usd_writer_transform.cc
+++ b/source/blender/io/usd/intern/usd_writer_transform.cc
@@ -36,10 +36,10 @@ USDTransformWriter::USDTransformWriter(const USDExporterContext &ctx) : USDAbstr
void USDTransformWriter::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);
- // Write the transform relative to the parent.
+ /* Write the transform relative to the parent. */
pxr::UsdGeomXform xform = pxr::UsdGeomXform::Define(usd_export_context_.stage,
usd_export_context_.usd_path);
if (!xformOp_) {