Commit: f4cb3ee7291cb918c95f10824d91d00ddcb88b83
Author: Kévin Dietrich
Date:   Thu Jun 9 18:36:45 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBf4cb3ee7291cb918c95f10824d91d00ddcb88b83

Cleanup.

===================================================================

M       source/blender/alembic/intern/abc_camera.cc
M       source/blender/alembic/intern/abc_exporter.cc
M       source/blender/alembic/intern/abc_object.cc
M       source/blender/alembic/intern/abc_util.cc

===================================================================

diff --git a/source/blender/alembic/intern/abc_camera.cc 
b/source/blender/alembic/intern/abc_camera.cc
index 1fe9926..5928777 100644
--- a/source/blender/alembic/intern/abc_camera.cc
+++ b/source/blender/alembic/intern/abc_camera.cc
@@ -101,8 +101,8 @@ void AbcCameraWriter::do_write()
                m_camera_sample.setFocusDistance(cam->gpu_dof.focus_distance);
        }
 
-       /* blender camera does not have an fstop param, so try to find a custom 
prop
-        * instead */
+       /* Blender camera does not have an fstop param, so try to find a custom 
prop
+        * instead. */
        m_camera_sample.setFStop(cam->gpu_dof.fstop);
 
        m_camera_sample.setLensSqueezeRatio(1.0);
diff --git a/source/blender/alembic/intern/abc_exporter.cc 
b/source/blender/alembic/intern/abc_exporter.cc
index d338511..42a9585 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -46,7 +46,7 @@ extern "C" {
 
 #ifdef WIN32
 /* needed for MSCV because of snprintf from BLI_string */
-#include "BLI_winstuff.h"
+#      include "BLI_winstuff.h"
 #endif
 
 #include "BKE_anim.h"
@@ -138,7 +138,6 @@ void AbcExporter::getFrameSet(double step, std::set<double> 
&frames)
 
 void AbcExporter::operator()(Main *bmain, float &progress)
 {
-       /* Create archive here */
        std::string scene_name;
 
        if (bmain->name[0] != '\0') {
@@ -170,7 +169,8 @@ void AbcExporter::operator()(Main *bmain, float &progress)
                                                               scene_name, 
Alembic::Abc::ErrorHandler::kThrowPolicy, arg);
        }
 
-       /* Create time samplings for transforms and shapes */
+       /* Create time samplings for transforms and shapes. */
+
        TimeSamplingPtr trans_time = 
createTimeSampling(m_settings.xform_frame_step);
 
        m_trans_sampling_index = m_archive.addTimeSampling(*trans_time);
@@ -199,18 +199,20 @@ void AbcExporter::operator()(Main *bmain, float &progress)
 
        createShapeWriters(bmain->eval_ctx);
 
-       /* make a list of frames to export */
+       /* Make a list of frames to export. */
+
        std::set<double> xform_frames;
        getFrameSet(m_settings.xform_frame_step, xform_frames);
 
        std::set<double> shape_frames;
        getFrameSet(m_settings.shape_frame_step, shape_frames);
 
-       /* merge all frames needed */
+       /* Merge all frames needed. */
+
        std::set<double> frames(xform_frames);
        frames.insert(shape_frames.begin(), shape_frames.end());
 
-       /* export all frames */
+       /* Export all frames. */
 
        std::set<double>::const_iterator begin = frames.begin();
        std::set<double>::const_iterator end = frames.end();
@@ -264,7 +266,7 @@ void 
AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx)
                                case OB_LATTICE:
                                case OB_MBALL:
                                case OB_SPEAKER:
-                                       /* we do not export transforms for 
objects of these classes */
+                                       /* We do not export transforms for 
objects of these classes. */
                                        break;
 
                                default:
@@ -417,7 +419,7 @@ void AbcExporter::createShapeWriter(Object *ob, Object 
*dupliObParent)
        ID *id = reinterpret_cast<ID *>(ob);
        IDProperty *xport_props = IDP_GetProperties(id, 0);
 
-       /* Check for special export object flags */
+       /* Check for special export object flags. */
        if (xport_props) {
                IDProperty *enable_prop = IDP_GetPropertyFromGroup(xport_props, 
"abc_hair");
                if (enable_prop) {
diff --git a/source/blender/alembic/intern/abc_object.cc 
b/source/blender/alembic/intern/abc_object.cc
index 4576491..410a3f0 100644
--- a/source/blender/alembic/intern/abc_object.cc
+++ b/source/blender/alembic/intern/abc_object.cc
@@ -196,7 +196,7 @@ void AbcObjectWriter::writeArrayProperty(IDProperty *p, 
const OCompoundProperty
 {
        std::string name(p->name);
 
-       switch(p->subtype) {
+       switch (p->subtype) {
                case IDP_INT:
                {
                        OInt32ArrayProperty op(abcProps, name);
@@ -220,8 +220,7 @@ void AbcObjectWriter::writeArrayProperty(IDProperty *p, 
const OCompoundProperty
 
 void AbcObjectWriter::writeProperty(IDProperty *p, const std::string &name, 
const OCompoundProperty &abcProps)
 {
-       /* TODO: check this... */
-       switch(p->type) {
+       switch (p->type) {
                case IDP_STRING:
                {
                        OStringProperty op(abcProps, name);
@@ -260,7 +259,7 @@ void AbcObjectWriter::writeProperty(IDProperty *p, const 
std::string &name, cons
 
 void AbcObjectWriter::writeGeomProperty(IDProperty *p, const std::string 
&name, const OCompoundProperty &abcProps)
 {
-       switch(p->type) {
+       switch (p->type) {
                case IDP_STRING:
                {
                        std::string val = IDP_String(p);
@@ -319,7 +318,7 @@ bool AbcObjectWriter::getPropertyValue(ID *id, const 
std::string &name, double &
        IDProperty *prop = IDP_GetPropertyFromGroup(idgroup, name.c_str());
 
        if (prop) {
-               switch(prop->type) {
+               switch (prop->type) {
                        case IDP_FLOAT:
                                val = IDP_Float(prop);
                                return true;
diff --git a/source/blender/alembic/intern/abc_util.cc 
b/source/blender/alembic/intern/abc_util.cc
index 1071272..9e5a149 100644
--- a/source/blender/alembic/intern/abc_util.cc
+++ b/source/blender/alembic/intern/abc_util.cc
@@ -126,7 +126,7 @@ void split(const std::string &s, const char delim, 
std::vector<std::string> &tok
  * Euler angles are swaped to change coordinate system. */
 static void create_rotation_matrix(
         float rot_x_mat[3][3], float rot_y_mat[3][3],
-float rot_z_mat[3][3], const float euler[3], const bool to_yup)
+        float rot_z_mat[3][3], const float euler[3], const bool to_yup)
 {
        const float rx = euler[0];
        const float ry = (to_yup) ?  euler[2] : -euler[2];
@@ -169,36 +169,36 @@ void create_transform_matrix(float r_mat[4][4])
        unit_m4(transform_mat);
        unit_m4(invmat);
 
-       /* compute rotation matrix */
+       /* Compute rotation matrix. */
 
-       /* extract location, rotation, and scale from matrix */
+       /* Extract location, rotation, and scale from matrix. */
        mat4_to_loc_rot_size(loc, rot, scale, r_mat);
 
-       /* get euler angles from rotation matrix */
+       /* Get euler angles from rotation matrix. */
        mat3_to_eulO(euler, ROT_MODE_XYZ, rot);
 
-       /* create X, Y, Z rotation matrices from euler angles */
+       /* Create X, Y, Z rotation matrices from euler angles. */
        create_rotation_matrix(rot_x_mat, rot_y_mat, rot_z_mat, euler, false);
 
-       /* concatenate rotation matrices */
+       /* Concatenate rotation matrices. */
        mul_m3_m3m3(rot_mat, rot_mat, rot_y_mat);
        mul_m3_m3m3(rot_mat, rot_mat, rot_z_mat);
        mul_m3_m3m3(rot_mat, rot_mat, rot_x_mat);
 
-       /* add rotation matrix to transformation matrix */
+       /* Add rotation matrix to transformation matrix. */
        copy_m4_m3(transform_mat, rot_mat);
 
-       /* add translation to transformation matrix */
+       /* Add translation to transformation matrix. */
        transform_mat[3][0] = loc[0];
        transform_mat[3][1] = -loc[2];
        transform_mat[3][2] = loc[1];
 
-       /* create scale matrix */
+       /* Create scale matrix. */
        scale_mat[0][0] = scale[0];
        scale_mat[1][1] = scale[2];
        scale_mat[2][2] = scale[1];
 
-       /* add scale to transformation matrix */
+       /* Add scale to transformation matrix. */
        mul_m4_m4m4(transform_mat, transform_mat, scale_mat);
 
        copy_m4_m4(r_mat, transform_mat);
@@ -248,7 +248,7 @@ void create_input_transform(const 
Alembic::AbcGeom::ISampleSelector &sample_sel,
        }
 }
 
-/* recompute transform matrix of object in new coordinate system (from Z-Up to 
Y-Up) */
+/* Recompute transform matrix of object in new coordinate system (from Z-Up to 
Y-Up). */
 void create_transform_matrix(Object *obj, float transform_mat[4][4])
 {
        float rot_mat[3][3], rot[3][3], scale_mat[4][4], invmat[4][4], 
mat[4][4];
@@ -265,7 +265,7 @@ void create_transform_matrix(Object *obj, float 
transform_mat[4][4])
        unit_m4(invmat);
        unit_m4(mat);
 
-       /* get local matrix */
+       /* get local matrix. */
        if (obj->parent) {
                invert_m4_m4(invmat, obj->parent->obmat);
                mul_m4_m4m4(mat, invmat, obj->obmat);
@@ -274,153 +274,145 @@ void create_transform_matrix(Object *obj, float 
transform_mat[4][4])
                copy_m4_m4(mat, obj->obmat);
        }
 
-       /* compute rotation matrix */
-       switch(obj->rotmode)
-       {
+       /* Compute rotation matrix. */
+       switch (obj->rotmode) {
                case ROT_MODE_AXISANGLE:
                {
-                       /* get euler angles from axis angle rotation */
+                       /* Get euler angles from axis angle rotation. */
                        axis_angle_to_eulO(euler, ROT_MODE_XYZ, obj->rotAxis, 
obj->rotAngle);
 
-                       /* create X, Y, Z rotation matrices from euler angles */
+                       /* Create X, Y, Z rotation matrices from euler angles. 
*/
                        create_rotation_matrix(rot_x_mat, rot_y_mat, rot_z_mat, 
euler, true);
 
-                       /* concatenate rotation matrices */
+                       /* Concatenate rotation matrices. */
                        mul_m3_m3m3(rot_mat, rot_mat, rot_y_mat);
                        mul_m3_m3m3(rot_mat, rot_mat, rot_z_mat);
                        mul_m3_m3m3(rot_mat, rot_mat, rot_x_mat);
 
-                       /* extract location and scale from matrix */
+                       /* Extract location and scale from matrix. */
                        mat4_to_loc_rot_size(loc, rot, scale, mat);
 
                        break;
                }
-
                case ROT_MODE_QUAT:
                {
                        float q[4];
                        copy_v4_v4(q, obj->quat);
 
-                       /* swap axis */
+                       /* Swap axis. */
                        q[2] = obj->quat[3];
                        q[3] = -obj->quat[2];
 
-                       /* compute rotation matrix from quaternion */
+                       /* Compute rotation matrix from quaternion. */
                        quat_to_mat3(rot_mat, q);
 
-                       /* extract location and scale from matrix */
+                       /* Extract location and scale from matrix. */
                        mat4_to_loc_rot_size(loc, rot, scale, mat);
 
                        break;
                }
-
                case ROT_MODE_XYZ:
                {
-                       /* extract location, rotation, and scale form matrix */
+                       /* Extract location, rotation, and scale form matrix. */
                        mat4_to_loc_rot_size(loc, rot, scale, mat);
 
-                       /* get euler angles from rotation matrix */
+                       /* Get euler angles from rotation matrix. */
                        mat3_to_eulO(euler, ROT_MODE_XYZ, rot);
 
-                       /* create X, Y, Z rotation matrices from euler angles */
+                       /* Create X, Y, Z rotation matrices from euler angles. 
*/
                        create_rotation_matrix(rot_x_mat, rot_y_mat, rot_z_mat, 
euler, true);
 
-                       /* concatenate rotation matrices */
+                       /* Concatenate rotation matrices. */
                        mul_m3_m3m3(rot_mat, rot_mat, rot_y_mat);
                        mul_m3_m3m3(rot_mat, rot_mat, rot_z_mat);
                        mul_m3_m3m3(rot_mat, rot_mat, rot_x_mat);
 
                        break;
                }
-
                case ROT_MODE_XZY:
                {
-                       /* extract location, rotation, and scale form matrix */
+                       /* Extract location, rotation, and scale form matrix. */
                        mat4_to_loc_rot_size(loc, rot, scale, mat);
 
-                       /* get euler angles from rotation matrix */
+               

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to