From e701f9b67010279db02ceb51f7d08078cb34170a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 29 Apr 2012 15:47:02 +0000 Subject: style cleanup: whitespace / commas --- source/blender/collada/AnimationExporter.cpp | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'source/blender/collada/AnimationExporter.cpp') diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index c93ee832fe6..6565a9e0c2e 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -80,7 +80,7 @@ void AnimationExporter::operator() (Object *ob) (!strcmp(transformName, "rotation_euler") && ob->rotmode == ROT_MODE_EUL)|| (!strcmp(transformName, "rotation_quaternion"))) { - dae_animation(ob ,fcu, transformName, false); + dae_animation(ob, fcu, transformName, false); } fcu = fcu->next; } @@ -96,7 +96,7 @@ void AnimationExporter::operator() (Object *ob) if ((!strcmp(transformName, "color")) || (!strcmp(transformName, "spot_size"))|| (!strcmp(transformName, "spot_blend")) || (!strcmp(transformName, "distance"))) { - dae_animation(ob , fcu, transformName, true); + dae_animation(ob, fcu, transformName, true); } fcu = fcu->next; } @@ -112,7 +112,7 @@ void AnimationExporter::operator() (Object *ob) (!strcmp(transformName, "ortho_scale"))|| (!strcmp(transformName, "clip_end"))||(!strcmp(transformName, "clip_start"))) { - dae_animation(ob , fcu, transformName, true); + dae_animation(ob, fcu, transformName, true); } fcu = fcu->next; } @@ -132,7 +132,7 @@ void AnimationExporter::operator() (Object *ob) (!strcmp(transformName, "diffuse_color"))||(!strcmp(transformName, "alpha")) || (!strcmp(transformName, "ior"))) { - dae_animation(ob ,fcu, transformName, true, ma ); + dae_animation(ob, fcu, transformName, true, ma ); } fcu = fcu->next; } @@ -165,7 +165,7 @@ float * AnimationExporter::get_eul_source_for_quat(Object *ob ) for ( int j = 0;j<4;j++) temp_quat[j] = quat[(i*4)+j]; - quat_to_eul(temp_eul,temp_quat); + quat_to_eul(temp_eul, temp_quat); for (int k = 0;k<3;k++) eul[i*3 + k] = temp_eul[k]; @@ -177,13 +177,13 @@ float * AnimationExporter::get_eul_source_for_quat(Object *ob ) } //Get proper name for bones -std::string AnimationExporter::getObjectBoneName( Object* ob,const FCurve* fcu ) +std::string AnimationExporter::getObjectBoneName( Object* ob, const FCurve* fcu ) { //hard-way to derive the bone name from rna_path. Must find more compact method std::string rna_path = std::string(fcu->rna_path); char* boneName = strtok((char *)rna_path.c_str(), "\""); - boneName = strtok(NULL,"\""); + boneName = strtok(NULL, "\""); if ( boneName != NULL ) return /*id_name(ob) + "_" +*/ std::string(boneName); @@ -192,7 +192,7 @@ std::string AnimationExporter::getObjectBoneName( Object* ob,const FCurve* fcu ) } //convert f-curves to animation curves and write -void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformName , bool is_param, Material * ma ) +void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformName, bool is_param, Material * ma ) { const char *axis_name = NULL; char anim_id[200]; @@ -232,7 +232,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa //Create anim Id if (ob->type == OB_ARMATURE) { - ob_name = getObjectBoneName( ob , fcu); + ob_name = getObjectBoneName(ob, fcu); BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s.%s", (char*)translate_id(ob_name).c_str(), transformName, axis_name); } @@ -260,7 +260,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa for (int i = 0 ; i< fcu->totvert ; i++) { eul_axis[i] = eul[i*3 + fcu->array_index]; } - output_id= create_source_from_array(COLLADASW::InputSemantic::OUTPUT, eul_axis , fcu->totvert, quatRotation, anim_id, axis_name); + output_id= create_source_from_array(COLLADASW::InputSemantic::OUTPUT, eul_axis, fcu->totvert, quatRotation, anim_id, axis_name); MEM_freeN(eul); MEM_freeN(eul_axis); } @@ -364,8 +364,8 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B FCurve* fcu = (FCurve*)ob_arm->adt->action->curves.first; while (fcu) { - std::string bone_name = getObjectBoneName(ob_arm,fcu); - int val = BLI_strcasecmp((char*)bone_name.c_str(),bone->name); + std::string bone_name = getObjectBoneName(ob_arm, fcu); + int val = BLI_strcasecmp((char*)bone_name.c_str(), bone->name); if (val==0) break; fcu = fcu->next; } @@ -383,7 +383,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B } if (fra.size()) { - dae_baked_animation(fra ,ob_arm, bone ); + dae_baked_animation(fra, ob_arm, bone ); } if (flag & ARM_RESTPOS) @@ -391,7 +391,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B where_is_pose(scene, ob_arm); } -void AnimationExporter::dae_baked_animation(std::vector &fra, Object *ob_arm , Bone *bone) +void AnimationExporter::dae_baked_animation(std::vector &fra, Object *ob_arm, Bone *bone) { std::string ob_name = id_name(ob_arm); std::string bone_name = bone->name; @@ -410,7 +410,7 @@ void AnimationExporter::dae_baked_animation(std::vector &fra, Object *ob_ // create output source std::string output_id; - output_id = create_4x4_source( fra, ob_arm , bone , anim_id); + output_id = create_4x4_source( fra, ob_arm, bone, anim_id); // create interpolations source std::string interpolation_id = fake_interpolation_source(fra.size(), anim_id, ""); @@ -719,7 +719,7 @@ std::string AnimationExporter::create_source_from_vector(COLLADASW::InputSemanti return source_id; } -std::string AnimationExporter::create_4x4_source(std::vector &frames , Object * ob_arm, Bone *bone , const std::string& anim_id) +std::string AnimationExporter::create_4x4_source(std::vector &frames, Object * ob_arm, Bone *bone, const std::string& anim_id) { COLLADASW::InputSemantic::Semantics semantic = COLLADASW::InputSemantic::OUTPUT; std::string source_id = anim_id + get_semantic_suffix(semantic); @@ -755,7 +755,7 @@ std::string AnimationExporter::create_4x4_source(std::vector &frames , Ob float ctime = BKE_frame_to_ctime(scene, *it); - BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM); + BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM); where_is_pose_bone(scene, ob_arm, pchan, ctime, 1); // compute bone local mat @@ -787,7 +787,7 @@ std::string AnimationExporter::create_4x4_source(std::vector &frames , Ob } float outmat[4][4]; - converter.mat4_to_dae(outmat,mat); + converter.mat4_to_dae(outmat, mat); source.appendValues(outmat); @@ -1281,7 +1281,7 @@ void AnimationExporter::sample_animation(float *v, std::vector &frames, i float ctime = BKE_frame_to_ctime(scene, *it); - BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM); + BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM); where_is_pose_bone(scene, ob_arm, pchan, ctime, 1); // compute bone local mat -- cgit v1.2.3