[Bf-blender-cvs] [5d7ee02b17f] master: Cleanup: comments (long lines) in collada
Campbell Barton
noreply at git.blender.org
Tue Apr 30 06:53:28 CEST 2019
Commit: 5d7ee02b17f2afad574609be3450eb8e5c0f18d2
Author: Campbell Barton
Date: Tue Apr 30 13:41:21 2019 +1000
Branches: master
https://developer.blender.org/rB5d7ee02b17f2afad574609be3450eb8e5c0f18d2
Cleanup: comments (long lines) in collada
===================================================================
M source/blender/collada/AnimationExporter.cpp
M source/blender/collada/AnimationImporter.cpp
M source/blender/collada/ArmatureExporter.cpp
M source/blender/collada/ArmatureImporter.cpp
M source/blender/collada/BCAnimationCurve.cpp
M source/blender/collada/ControllerExporter.cpp
M source/blender/collada/DocumentExporter.cpp
M source/blender/collada/DocumentImporter.cpp
M source/blender/collada/DocumentImporter.h
M source/blender/collada/EffectExporter.cpp
M source/blender/collada/ExtraHandler.cpp
M source/blender/collada/ExtraHandler.h
M source/blender/collada/GeometryExporter.cpp
M source/blender/collada/GeometryExporter.h
M source/blender/collada/ImageExporter.cpp
M source/blender/collada/MeshImporter.cpp
M source/blender/collada/MeshImporter.h
M source/blender/collada/SceneExporter.cpp
M source/blender/collada/SkinInfo.cpp
M source/blender/collada/TransformReader.h
M source/blender/collada/TransformWriter.cpp
M source/blender/collada/collada_utils.cpp
===================================================================
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index 826306fa789..a34f92f66d6 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -130,7 +130,7 @@ void AnimationExporter::exportAnimation(Object *ob, BCAnimationSampler &sampler)
{
bool container_is_open = false;
- //Transform animations (trans, rot, scale)
+ /* Transform animations (trans, rot, scale). */
container_is_open = open_animation_container(container_is_open, ob);
/* Now take care of the Object Animations
@@ -141,8 +141,8 @@ void AnimationExporter::exportAnimation(Object *ob, BCAnimationSampler &sampler)
BC_TRANSFORMATION_TYPE_MATRIX;
if (export_as_matrix) {
- export_matrix_animation(
- ob, sampler); // export all transform_curves as one single matrix animation
+ /* export all transform_curves as one single matrix animation */
+ export_matrix_animation(ob, sampler);
}
export_curve_animation_set(ob, sampler, export_as_matrix);
@@ -237,7 +237,7 @@ void AnimationExporter::export_matrix_animation(Object *ob, BCAnimationSampler &
}
}
-//write bone animations in transform matrix sources
+/* Write bone animations in transform matrix sources. */
void AnimationExporter::export_bone_animations_recursive(Object *ob,
Bone *bone,
BCAnimationSampler &sampler)
@@ -280,7 +280,7 @@ BCAnimationCurve *AnimationExporter::get_modified_export_curve(Object *ob,
BCCurveKey key(BC_ANIMATION_TYPE_CAMERA, "xfov", 0);
mcurve = new BCAnimationCurve(key, ob);
- // now tricky part: transform the fcurve
+ /* now tricky part: transform the fcurve */
BCValueMap lens_values;
curve.get_value_map(lens_values);
@@ -306,7 +306,8 @@ BCAnimationCurve *AnimationExporter::get_modified_export_curve(Object *ob,
float value = RAD2DEGF(focallength_to_fov(lens_value, sensor_value));
mcurve->add_value(value, frame);
}
- mcurve->clean_handles(); // to reset the handles
+ /* to reset the handles */
+ mcurve->clean_handles();
}
return mcurve;
}
@@ -322,7 +323,8 @@ void AnimationExporter::export_curve_animation(Object *ob, BCAnimationCurve &cur
*/
int channel_index = curve.get_channel_index();
- std::string axis = get_axis_name(channel_target, channel_index); // RGB or XYZ or ""
+ /* RGB or XYZ or "" */
+ std::string axis = get_axis_name(channel_target, channel_index);
std::string action_name;
bAction *action = bc_getSceneObjectAction(ob);
@@ -365,19 +367,19 @@ void AnimationExporter::export_bone_animation(Object *ob,
bool AnimationExporter::is_bone_deform_group(Bone *bone)
{
bool is_def;
- //Check if current bone is deform
+ /* Check if current bone is deform */
if ((bone->flag & BONE_NO_DEFORM) == 0)
return true;
- //Check child bones
+ /* Check child bones */
else {
for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
- //loop through all the children until deform bone is found, and then return
+ /* loop through all the children until deform bone is found, and then return */
is_def = is_bone_deform_group(child);
if (is_def)
return true;
}
}
- //no deform bone found in children also
+ /* no deform bone found in children also */
return false;
}
@@ -466,7 +468,7 @@ void AnimationExporter::export_collada_matrix_animation(std::string id,
sampler.addInput(COLLADASW::InputSemantic::INTERPOLATION,
COLLADABU::URI(EMPTY_STRING, interpolation_id));
- // Matrix animation has no tangents
+ /* Matrix animation has no tangents */
addSampler(sampler);
addChannel(COLLADABU::URI(EMPTY_STRING, sampler_id), target);
@@ -514,7 +516,8 @@ void AnimationExporter::add_source_parameters(COLLADASW::SourceBase::ParameterNa
else if (transform) {
param.push_back("TRANSFORM");
}
- else { //assumes if axis isn't specified all axises are added
+ else {
+ /* assumes if axis isn't specified all axises are added */
param.push_back("X");
param.push_back("Y");
param.push_back("Z");
@@ -641,7 +644,8 @@ std::string AnimationExporter::collada_source_from_values(BCMatrixSampleMap &sam
source.prepareToAppendValues();
BCMatrixSampleMap::iterator it;
- int precision = (this->export_settings->limit_precision) ? 6 : -1; // could be made configurable
+ /* could be made configurable */
+ int precision = (this->export_settings->limit_precision) ? 6 : -1;
for (it = samples.begin(); it != samples.end(); it++) {
const BCMatrix *sample = it->second;
double daemat[4][4];
@@ -686,11 +690,12 @@ std::string AnimationExporter::collada_interpolation_source(const BCAnimationCur
else if (ipo == BEZT_IPO_CONST) {
source.appendValues(STEP_NAME);
}
- else { // BEZT_IPO_LIN
+ else {
+ /* BEZT_IPO_LIN */
source.appendValues(LINEAR_NAME);
}
}
- // unsupported? -- HERMITE, CARDINAL, BSPLINE, NURBS
+ /* unsupported? -- HERMITE, CARDINAL, BSPLINE, NURBS */
source.finish();
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 8a9a8e5eb7b..3ab859bdb00 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -48,7 +48,7 @@
#include <algorithm>
-// first try node name, if not available (since is optional), fall back to original id
+/* first try node name, if not available (since is optional), fall back to original id */
template<class T> static const char *bc_get_joint_name(T *node)
{
const std::string &id = node->getName();
@@ -69,7 +69,7 @@ void AnimationImporter::add_bezt(FCurve *fcu,
float value,
eBezTriple_Interpolation ipo)
{
- //float fps = (float)FPS;
+ // float fps = (float)FPS;
BezTriple bez;
memset(&bez, 0, sizeof(BezTriple));
bez.vec[1][0] = frame;
@@ -81,7 +81,7 @@ void AnimationImporter::add_bezt(FCurve *fcu,
calchandles_fcurve(fcu);
}
-// 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 AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
{
COLLADAFW::FloatOrDoubleArray &input = curve->getInputValues();
@@ -94,10 +94,10 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
std::vector<FCurve *> &fcurves = curve_map[curve->getUniqueId()];
switch (dim) {
- case 1: // X, Y, Z or angle
- case 3: // XYZ
+ case 1: /* X, Y, Z or angle */
+ case 3: /* XYZ */
case 4:
- case 16: // matrix
+ case 16: /* matrix */
{
for (i = 0; i < dim; i++) {
FCurve *fcu = (FCurve *)MEM_callocN(sizeof(FCurve), "FCurve");
@@ -110,7 +110,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
BezTriple bez;
memset(&bez, 0, sizeof(BezTriple));
- // input, output
+ /* input, output */
bez.vec[1][0] = bc_get_float_value(input, j) * fps;
bez.vec[1][1] = bc_get_float_value(output, j * dim + i);
bez.h1 = bez.h2 = HD_AUTO;
@@ -120,11 +120,11 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
COLLADAFW::FloatOrDoubleArray &intan = curve->getInTangentValues();
COLLADAFW::FloatOrDoubleArray &outtan = curve->getOutTangentValues();
- // intangent
+ /* intangent */
bez.vec[0][0] = bc_get_float_value(intan, (j * 2 * dim) + (2 * i)) * fps;
bez.vec[0][1] = bc_get_float_value(intan, (j * 2 * dim) + (2 * i) + 1);
- // outtangent
+ /* outtangent */
bez.vec[2][0] = bc_get_float_value(outtan, (j * 2 * dim) + (2 * i)) * fps;
bez.vec[2][1] = bc_get_float_value(outtan, (j * 2 * dim) + (2 * i) + 1);
if (curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER) {
@@ -138,7 +138,9 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
else {
bez.ipo = BEZT_IPO_LIN;
}
- // bez.ipo = U.ipo_new; /* use default interpolation mode here... */
+#if 0
+ bez.ipo = U.ipo_new; /* use default interpolation mode here... */
+#endif
bez.f1 = bez.f2 = bez.f3 = SELECT;
insert_bezt_fcurve(fcu, &bez, INSERTKEY_NOFLAGS);
@@ -161,7 +163,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
void AnimationImporter::fcurve_deg_to_rad(FCurve *cu)
{
for (unsigned int i = 0; i < cu->totvert; i++) {
- // TODO convert handles too
+ /* TODO convert handles too */
cu->bezt[i].vec[1][1] *= DEG2RADF(1.0f);
cu->bezt[i].vec[0][1] *= DEG2RADF(1.0f);
cu->bezt[i].vec[2][1] *= DEG2RADF(1.0f);
@@ -195,7 +197,7 @@ void AnimationImporter::add_fcurves_to_object(Main *bmain,
char *p = strstr(rna_path, "rotation_euler");
bool is_rotation = p && *(p + strlen("rotation_euler")) == '\0';
- // convert degrees to radians for rotation
+ /* convert degrees to radians for rotation */
if (is_rotation)
fcurve_deg_to_rad(fcu);
#endif
@@ -253,7 +255,7 @@ void AnimationImporter::add_fcurves_to_object(Main *bmain,
AnimationImporter::~AnimationImporter()
{
- // free unused FCurves
+ /* free unused FCurves */
for (std::vector<FCurve *>::iterator it = unused_curves.begin(); it != unused_curves.end(); it++)
free_fcurve(*it);
@@ -266,15 +268,15 @@ bool AnimationImporter::write_animation(const COLLADAFW::Animation *anim)
if (anim->getAnimationType() == COLLADAFW::Animation::ANIMATION_CURVE) {
COLLADAFW::AnimationCurve *curve = (COLLADAFW::AnimationCurve *)anim;
- // XXX Don't know if it's necessary
- // Should we check outPhysicalDimension?
+ /* XXX Don't know if it's necessary
+ * S
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list