diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-15 00:53:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-15 01:54:30 +0300 |
commit | 35b78d9807c49ba37e038eda85c672c72dee0247 (patch) | |
tree | a081042c85b98d0ac9116c0c4ba99ded6ae5de84 /source/blender/collada | |
parent | 395a0acdb88338b9790ecefd142f4010df6b955d (diff) |
Cleanup: indentation, wrapping
Mostly functions wrapping args, not confirming to our style guide.
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 10 | ||||
-rw-r--r-- | source/blender/collada/AnimationExporter.h | 89 | ||||
-rw-r--r-- | source/blender/collada/AnimationImporter.h | 11 | ||||
-rw-r--r-- | source/blender/collada/ArmatureExporter.h | 16 | ||||
-rw-r--r-- | source/blender/collada/ArmatureImporter.h | 5 | ||||
-rw-r--r-- | source/blender/collada/BCAnimationSampler.h | 10 | ||||
-rw-r--r-- | source/blender/collada/BCSampleData.cpp | 6 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 16 | ||||
-rw-r--r-- | source/blender/collada/EffectExporter.cpp | 14 | ||||
-rw-r--r-- | source/blender/collada/EffectExporter.h | 11 | ||||
-rw-r--r-- | source/blender/collada/ExtraHandler.h | 14 | ||||
-rw-r--r-- | source/blender/collada/GeometryExporter.cpp | 8 | ||||
-rw-r--r-- | source/blender/collada/MeshImporter.h | 37 | ||||
-rw-r--r-- | source/blender/collada/SceneExporter.cpp | 15 | ||||
-rw-r--r-- | source/blender/collada/TransformWriter.h | 16 |
15 files changed, 144 insertions, 134 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index ebb2a9da10c..e9babea7b3d 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -92,11 +92,11 @@ bool AnimationExporter::exportAnimations() try { animation_sampler.sample_scene( - export_settings->sampling_rate, - /*keyframe_at_end = */ true, - export_settings->open_sim, - export_settings->keep_keyframes, - export_settings->export_animation_type + export_settings->sampling_rate, + /*keyframe_at_end = */ true, + export_settings->open_sim, + export_settings->keep_keyframes, + export_settings->export_animation_type ); openLibrary(); diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h index 295ec66a4e8..7af4777331d 100644 --- a/source/blender/collada/AnimationExporter.h +++ b/source/blender/collada/AnimationExporter.h @@ -145,48 +145,48 @@ protected: /* export animation as separate trans/rot/scale curves */ void export_curve_animation_set( - Object *ob, - BCAnimationSampler &sampler, - bool export_tm_curves); + Object *ob, + BCAnimationSampler &sampler, + bool export_tm_curves); /* export one single curve */ void export_curve_animation( - Object *ob, - BCAnimationCurve &curve); + Object *ob, + BCAnimationCurve &curve); /* export animation as matrix data */ void export_matrix_animation( - Object *ob, - BCAnimationSampler &sampler); + Object *ob, + BCAnimationSampler &sampler); /* step through the bone hierarchy */ void export_bone_animations_recursive( - Object *ob_arm, - Bone *bone, - BCAnimationSampler &sampler); + Object *ob_arm, + Bone *bone, + BCAnimationSampler &sampler); /* Export for one bone */ void export_bone_animation( - Object *ob, - Bone *bone, - BCFrames &frames, - BCMatrixSampleMap &outmats); + Object *ob, + Bone *bone, + BCFrames &frames, + BCMatrixSampleMap &outmats); /* call to the low level collada exporter */ void export_collada_curve_animation( - std::string id, - std::string name, - std::string target, - std::string axis, - BCAnimationCurve &curve); + std::string id, + std::string name, + std::string target, + std::string axis, + BCAnimationCurve &curve); /* call to the low level collada exporter */ void export_collada_matrix_animation( - std::string id, - std::string name, - std::string target, - BCFrames &frames, - BCMatrixSampleMap &outmats); + std::string id, + std::string name, + std::string target, + BCFrames &frames, + BCMatrixSampleMap &outmats); BCAnimationCurve *get_modified_export_curve(Object *ob, BCAnimationCurve &curve, BCAnimationCurveMap &curves); @@ -197,40 +197,41 @@ protected: /* Input and Output sources (single valued) */ std::string collada_source_from_values( - BC_animation_source_type tm_channel, - COLLADASW::InputSemantic::Semantics semantic, - std::vector<float> &values, - const std::string& anim_id, - const std::string axis_name); + BC_animation_source_type tm_channel, + COLLADASW::InputSemantic::Semantics semantic, + std::vector<float> &values, + const std::string& anim_id, + const std::string axis_name); /* Output sources (matrix data) */ std::string collada_source_from_values( - BCMatrixSampleMap &samples, - const std::string& anim_id); + BCMatrixSampleMap &samples, + const std::string& anim_id); /* Interpolation sources */ std::string collada_linear_interpolation_source( - int tot, - const std::string& anim_id); + int tot, + const std::string& anim_id); /* source ID = animation_name + semantic_suffix */ std::string get_semantic_suffix(COLLADASW::InputSemantic::Semantics semantic); - void add_source_parameters(COLLADASW::SourceBase::ParameterNameList& param, - COLLADASW::InputSemantic::Semantics semantic, - bool is_rot, - const std::string axis, - bool transform); + void add_source_parameters( + COLLADASW::SourceBase::ParameterNameList& param, + COLLADASW::InputSemantic::Semantics semantic, + bool is_rot, + const std::string axis, + bool transform); int get_point_in_curve(BCBezTriple &bezt, COLLADASW::InputSemantic::Semantics semantic, bool is_angle, float *values); int get_point_in_curve(const BCAnimationCurve &curve, float sample_frame, COLLADASW::InputSemantic::Semantics semantic, bool is_angle, float *values); std::string collada_tangent_from_curve( - COLLADASW::InputSemantic::Semantics semantic, - BCAnimationCurve &curve, - const std::string& anim_id, - const std::string axis_name); + COLLADASW::InputSemantic::Semantics semantic, + BCAnimationCurve &curve, + const std::string& anim_id, + const std::string axis_name); std::string collada_interpolation_source(const BCAnimationCurve &curve, const std::string& anim_id, std::string axis_name, bool *has_tangents); @@ -251,8 +252,8 @@ protected: #ifdef WITH_MORPH_ANIMATION void export_morph_animation( - Object *ob, - BCAnimationSampler &sampler); + Object *ob, + BCAnimationSampler &sampler); #endif }; diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h index e5d431a05c0..dfb3f5cfe33 100644 --- a/source/blender/collada/AnimationImporter.h +++ b/source/blender/collada/AnimationImporter.h @@ -180,11 +180,12 @@ public: // 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, - COLLADAFW::Transformation::TransformationType tm_type, - Object *par_job = NULL); + Object *translate_animation_OLD( + COLLADAFW::Node *node, + std::map<COLLADAFW::UniqueId, Object *>& object_map, + std::map<COLLADAFW::UniqueId, COLLADAFW::Node *>& root_map, + COLLADAFW::Transformation::TransformationType tm_type, + Object *par_job = NULL); void find_frames( std::vector<float>* frames, std::vector<FCurve*>* curves ); void find_frames_old( std::vector<float>* frames, COLLADAFW::Node * node, COLLADAFW::Transformation::TransformationType tm_type ); diff --git a/source/blender/collada/ArmatureExporter.h b/source/blender/collada/ArmatureExporter.h index d5f808155f4..11f853621a0 100644 --- a/source/blender/collada/ArmatureExporter.h +++ b/source/blender/collada/ArmatureExporter.h @@ -61,10 +61,10 @@ public: {} void add_armature_bones( - Object *ob_arm, - ViewLayer *view_layer, - SceneExporter *se, - std::vector<Object *>& child_objects); + Object *ob_arm, + ViewLayer *view_layer, + SceneExporter *se, + std::vector<Object *>& child_objects); bool add_instance_controller(Object *ob); @@ -85,10 +85,10 @@ private: // 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, - std::vector<Object *>& child_objects); + Bone *bone, + Object *ob_arm, + SceneExporter *se, + std::vector<Object *>& child_objects); void add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& node); diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h index 4715b31fe62..4c82b1e55e3 100644 --- a/source/blender/collada/ArmatureImporter.h +++ b/source/blender/collada/ArmatureImporter.h @@ -100,8 +100,9 @@ private: JointData *get_joint_data(COLLADAFW::Node *node); #endif - int create_bone(SkinInfo* skin, COLLADAFW::Node *node, EditBone *parent, int totchild, - float parent_mat[4][4], bArmature *arm, std::vector<std::string> &layer_labels); + int create_bone( + SkinInfo* skin, COLLADAFW::Node *node, EditBone *parent, int totchild, + float parent_mat[4][4], bArmature *arm, std::vector<std::string> &layer_labels); BoneExtended &add_bone_extended(EditBone *bone, COLLADAFW::Node * node, int sibcount, std::vector<std::string> &layer_labels, BoneExtensionMap &extended_bones); diff --git a/source/blender/collada/BCAnimationSampler.h b/source/blender/collada/BCAnimationSampler.h index 19ccb88fa9e..95ec642ef33 100644 --- a/source/blender/collada/BCAnimationSampler.h +++ b/source/blender/collada/BCAnimationSampler.h @@ -175,11 +175,11 @@ public: void add_object(Object *ob); void sample_scene( - int sampling_rate, - int keyframe_at_end, - bool for_opensim, - bool keep_keyframes, - BC_export_animation_type export_animation_type); + int sampling_rate, + int keyframe_at_end, + bool for_opensim, + bool keep_keyframes, + BC_export_animation_type export_animation_type); BCAnimationCurveMap *get_curves(Object *ob); void get_object_frames(BCFrames &frames, Object *ob); diff --git a/source/blender/collada/BCSampleData.cpp b/source/blender/collada/BCSampleData.cpp index 936d48ccaca..812ac3c2a5a 100644 --- a/source/blender/collada/BCSampleData.cpp +++ b/source/blender/collada/BCSampleData.cpp @@ -95,9 +95,9 @@ const bool BCSample::get_value(std::string channel_target, const int array_index else if (channel_target == "scale") { *val = obmat.scale()[array_index]; } - else if ( - channel_target == "rotation" || - channel_target == "rotation_euler") { + else if (channel_target == "rotation" || + channel_target == "rotation_euler") + { *val = obmat.rotation()[array_index]; } else if (channel_target == "rotation_quat") { diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 97d4f056d0b..f784c811c26 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -474,10 +474,10 @@ void DocumentImporter::report_unknown_reference(const COLLADAFW::Node &node, con std::string id = node.getOriginalId(); std::string name = node.getName(); fprintf(stderr, - "error: node id=\"%s\", name=\"%s\" refers to an undefined %s.\n", - id.c_str(), - name.c_str(), - object_type.c_str()); + "error: node id=\"%s\", name=\"%s\" refers to an undefined %s.\n", + id.c_str(), + name.c_str(), + object_type.c_str()); } std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent_node, Scene *sce, Object *par, bool is_library_node) @@ -496,10 +496,10 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node, COLLA std::vector<Object *> *root_objects = new std::vector<Object *>(); fprintf(stderr, - "| %s id='%s', name='%s'\n", - is_joint ? "JOINT" : "NODE ", - id.c_str(), - name.c_str() ); + "| %s id='%s', name='%s'\n", + is_joint ? "JOINT" : "NODE ", + id.c_str(), + name.c_str() ); if (is_joint) { if (parent_node == NULL && !is_library_node) { diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp index 3494cdbada4..94e86af521f 100644 --- a/source/blender/collada/EffectExporter.cpp +++ b/source/blender/collada/EffectExporter.cpp @@ -156,9 +156,10 @@ void EffectsExporter::create_image_samplers(COLLADASW::EffectProfile &ep, KeyIma std::string uid(id_name(image)); std::string key = translate_id(uid); - COLLADASW::Sampler *sampler = new COLLADASW::Sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D, - key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX, - key + COLLADASW::Sampler::SURFACE_SID_SUFFIX); + COLLADASW::Sampler *sampler = new COLLADASW::Sampler( + COLLADASW::Sampler::SAMPLER_TYPE_2D, + key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX, + key + COLLADASW::Sampler::SURFACE_SID_SUFFIX); sampler->setImageId(key); @@ -203,9 +204,10 @@ void EffectsExporter::operator()(Material *ma, Object *ob) // create only one <sampler>/<surface> pair for each unique image if (im_samp_map.find(key) == im_samp_map.end()) { //<newparam> <sampler> <source> - COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D, - key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX, - key + COLLADASW::Sampler::SURFACE_SID_SUFFIX); + 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 samplers[a] = sampler; diff --git a/source/blender/collada/EffectExporter.h b/source/blender/collada/EffectExporter.h index 3ba642088a1..6d42a3d69ba 100644 --- a/source/blender/collada/EffectExporter.h +++ b/source/blender/collada/EffectExporter.h @@ -60,11 +60,12 @@ private: void get_images(Material *ma, KeyImageMap &uid_image_map); void create_image_samplers(COLLADASW::EffectProfile &ep, KeyImageMap &uid_image_map, std::string &active_uv); - void writeTextures(COLLADASW::EffectProfile &ep, - std::string &key, - COLLADASW::Sampler *sampler, - MTex *t, Image *ima, - std::string &uvname ); + void writeTextures( + COLLADASW::EffectProfile &ep, + std::string &key, + COLLADASW::Sampler *sampler, + MTex *t, Image *ima, + std::string &uvname ); bool hasEffects(Scene *sce); diff --git a/source/blender/collada/ExtraHandler.h b/source/blender/collada/ExtraHandler.h index 4e1e0415714..fef1d5c9b7f 100644 --- a/source/blender/collada/ExtraHandler.h +++ b/source/blender/collada/ExtraHandler.h @@ -53,16 +53,16 @@ public: /** Method to ask, if the current callback handler want to read the data of the given extra element. */ bool parseElement ( - const char* profileName, - const unsigned long& elementHash, - const COLLADAFW::UniqueId& uniqueId, - COLLADAFW::Object* object); + const char* profileName, + const unsigned long& elementHash, + const COLLADAFW::UniqueId& uniqueId, + COLLADAFW::Object* object); /** For backwards compatibility with older OpenCollada, new version added object parameter */ bool parseElement ( - const char* profileName, - const unsigned long& elementHash, - const COLLADAFW::UniqueId& uniqueId); + const char* profileName, + const unsigned long& elementHash, + const COLLADAFW::UniqueId& uniqueId); private: /** Disable default copy constructor. */ ExtraHandler(const ExtraHandler& pre); diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index ba9ba7998e0..f589e99f84b 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -519,10 +519,10 @@ void GeometryExporter::createVertexColorSource(std::string geom_id, Mesh *me) MLoopCol *mlc = mloopcol + mpoly->loopstart; for (int j = 0; j < mpoly->totloop; j++, mlc++) { source.appendValues( - mlc->r / 255.0f, - mlc->g / 255.0f, - mlc->b / 255.0f, - mlc->a / 255.0f + mlc->r / 255.0f, + mlc->g / 255.0f, + mlc->b / 255.0f, + mlc->a / 255.0f ); } } diff --git a/source/blender/collada/MeshImporter.h b/source/blender/collada/MeshImporter.h index 163ecfce9ea..08b7edd2a3b 100644 --- a/source/blender/collada/MeshImporter.h +++ b/source/blender/collada/MeshImporter.h @@ -105,23 +105,26 @@ private: std::map<COLLADAFW::UniqueId, MaterialIdPrimitiveArrayMap> geom_uid_mat_mapping_map; // crazy name! std::multimap<COLLADAFW::UniqueId, COLLADAFW::UniqueId> materials_mapped_to_geom; //< materials that have already been mapped to a geometry. A pair of geom uid and mat uid, one geometry can have several materials - bool set_poly_indices(MPoly *mpoly, - MLoop *mloop, - int loop_index, - unsigned int *indices, - int loop_count); - - void set_face_uv(MLoopUV *mloopuv, - UVDataWrapper &uvs, - int loop_index, - COLLADAFW::IndexList& index_list, - int count); - - void set_vcol(MLoopCol *mloopcol, - VCOLDataWrapper &vob, - int loop_index, - COLLADAFW::IndexList& index_list, - int count); + bool set_poly_indices( + MPoly *mpoly, + MLoop *mloop, + int loop_index, + unsigned int *indices, + int loop_count); + + void set_face_uv( + MLoopUV *mloopuv, + UVDataWrapper &uvs, + int loop_index, + COLLADAFW::IndexList& index_list, + int count); + + void set_vcol( + MLoopCol *mloopcol, + VCOLDataWrapper &vob, + int loop_index, + COLLADAFW::IndexList& index_list, + int count); #ifdef COLLADA_DEBUG void print_index_list(COLLADAFW::IndexList& index_list); diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp index f09fae73efd..9031aa1ed9f 100644 --- a/source/blender/collada/SceneExporter.cpp +++ b/source/blender/collada/SceneExporter.cpp @@ -131,10 +131,10 @@ void SceneExporter::writeNodes(Object *ob) } else { TransformWriter::add_node_transform_ob( - colladaNode, - ob, - this->export_settings->export_transformation_type, - this->export_settings->limit_precision + colladaNode, + ob, + this->export_settings->export_transformation_type, + this->export_settings->limit_precision ); } @@ -148,9 +148,10 @@ void SceneExporter::writeNodes(Object *ob) COLLADASW::InstanceGeometry instGeom(mSW); instGeom.setUrl(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, get_geometry_id(ob, this->export_settings->use_object_instantiation))); instGeom.setName(encode_xml(id_name(ob))); - InstanceWriter::add_material_bindings(instGeom.getBindMaterial(), - ob, - this->export_settings->active_uv_only); + InstanceWriter::add_material_bindings( + instGeom.getBindMaterial(), + ob, + this->export_settings->active_uv_only); instGeom.add(); } } diff --git a/source/blender/collada/TransformWriter.h b/source/blender/collada/TransformWriter.h index 49ed22ef3f8..3792ce840ee 100644 --- a/source/blender/collada/TransformWriter.h +++ b/source/blender/collada/TransformWriter.h @@ -33,16 +33,16 @@ class TransformWriter { protected: void add_node_transform( - COLLADASW::Node& node, - float mat[4][4], - float parent_mat[4][4], - bool limit_precision=false); + COLLADASW::Node& node, + float mat[4][4], + float parent_mat[4][4], + bool limit_precision=false); void add_node_transform_ob( - COLLADASW::Node& node, - Object *ob, - BC_export_transformation_type transformation_type, - bool limit_precision = false); + COLLADASW::Node& node, + Object *ob, + BC_export_transformation_type transformation_type, + bool limit_precision = false); void add_node_transform_identity(COLLADASW::Node& node); |