diff options
Diffstat (limited to 'source/blender/collada/AnimationExporter.cpp')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index fc4bbea108b..95298986f5a 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -270,7 +270,7 @@ void AnimationExporter::export_sampled_transrotloc_animation(Object *ob, std::ve create_sampled_animation(3, ctimes, baked_curves[SCALE], ob_name, "scale", "", false); create_sampled_animation(3, ctimes, baked_curves[LOC], ob_name, "location", "", false); - /* Not sure how to export rotation as a 3channel animation, + /* Not sure how to export rotation as a 3channel animation, * so separate into 3 single animations for now: */ @@ -314,7 +314,7 @@ void AnimationExporter::operator()(Object *ob) //This needs to be handled by extra profiles, so postponed for now //export_morph_animation(ob); - + //Export Lamp parameter animations if ( (ob->type == OB_LAMP) && ((Lamp *)ob->data)->adt && ((Lamp *)ob->data)->adt->action) { FCurve *fcu = (FCurve *)(((Lamp *)ob->data)->adt->action->curves.first); @@ -338,7 +338,7 @@ void AnimationExporter::operator()(Object *ob) if ((STREQ(transformName, "lens")) || (STREQ(transformName, "ortho_scale")) || - (STREQ(transformName, "clip_end")) || + (STREQ(transformName, "clip_end")) || (STREQ(transformName, "clip_start"))) { create_keyframed_animation(ob, fcu, transformName, true); @@ -380,7 +380,7 @@ void AnimationExporter::export_object_constraint_animation(Object *ob) } void AnimationExporter::export_morph_animation(Object *ob) -{ +{ FCurve *fcu; char *transformName; Key *key = BKE_key_from_object(ob); @@ -388,12 +388,12 @@ void AnimationExporter::export_morph_animation(Object *ob) if (key->adt && key->adt->action) { fcu = (FCurve *)key->adt->action->curves.first; - + while (fcu) { transformName = extract_transform_name(fcu->rna_path); create_keyframed_animation(ob, fcu, transformName, true); - + fcu = fcu->next; } } @@ -407,17 +407,17 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl bConstraint *con; for (con = (bConstraint *)conlist->first; con; con = con->next) { ListBase targets = {NULL, NULL}; - + const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); - + if (!validateConstraints(con)) continue; if (cti && cti->get_constraint_targets) { bConstraintTarget *ct; Object *obtar; - /* get targets + /* get targets * - constraints should use ct->matrix, not directly accessing values - * - ct->matrix members have not yet been calculated here! + * - ct->matrix members have not yet been calculated here! */ cti->get_constraint_targets(con, &targets); @@ -438,7 +438,7 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl float *AnimationExporter::get_eul_source_for_quat(Object *ob) { FCurve *fcu = (FCurve *)ob->adt->action->curves.first; - const int keys = fcu->totvert; + const int keys = fcu->totvert; float *quat = (float *)MEM_callocN(sizeof(float) * fcu->totvert * 4, "quat output source values"); float *eul = (float *)MEM_callocN(sizeof(float) * fcu->totvert * 3, "quat output source values"); float temp_quat[4]; @@ -520,11 +520,11 @@ void AnimationExporter::create_keyframed_animation(Object *ob, FCurve *fcu, char /* * Note: Handle transformation animations separately (to apply matrix inverse to fcurves) - * We will use the object to evaluate the animation on all keyframes and calculate the + * We will use the object to evaluate the animation on all keyframes and calculate the * resulting object matrix. We need this to incorporate the * effects of the parent inverse matrix (when it contains a rotation component) * - * TODO: try to combine exported fcurves into 3 channel animations like done + * TODO: try to combine exported fcurves into 3 channel animations like done * in export_sampled_animation(). For now each channel is exported as separate <Animation>. */ @@ -648,7 +648,7 @@ void AnimationExporter::create_keyframed_animation(Object *ob, FCurve *fcu, char "/common/" /*profile common is only supported */ + get_transform_sid(fcu->rna_path, -1, axis_name, true); //if shape key animation, this is the main problem, how to define the channel targets. /*target = get_morph_id(ob) + - "/value" +*/ + "/value" +*/ } addChannel(COLLADABU::URI(empty, sampler_id), target); @@ -673,7 +673,7 @@ void AnimationExporter::write_bone_animation_matrix(Object *ob_arm, Bone *bone) } bool AnimationExporter::is_bone_deform_group(Bone *bone) -{ +{ bool is_def; //Check if current bone is deform if ((bone->flag & BONE_NO_DEFORM) == 0) return true; @@ -707,7 +707,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B fcu = fcu->next; } - if (!(fcu)) return;*/ + if (!(fcu)) return;*/ bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name); if (!pchan) @@ -728,7 +728,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B dae_baked_animation(fra, ob_arm, bone); } - if (flag & ARM_RESTPOS) + if (flag & ARM_RESTPOS) arm->flag = flag; BKE_pose_where_is(depsgraph, scene, ob_arm); } @@ -921,7 +921,7 @@ void AnimationExporter::add_source_parameters(COLLADASW::SourceBase::ParameterNa if (axis) { param.push_back(axis); } - else + else if (transform) { param.push_back("TRANSFORM"); } @@ -1307,7 +1307,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj enable_fcurves(ob->adt->action, bone->name); } - + std::vector<float>::iterator it; int j = 0; for (it = frames.begin(); it != frames.end(); it++) { @@ -1326,7 +1326,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj else { BKE_pose_where_is_bone(depsgraph, scene, ob, pchan, ctime, 1); } - + // compute bone local mat if (bone->parent) { invert_m4_m4(ipar, parchan->pose_mat); @@ -1334,7 +1334,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj } else copy_m4_m4(mat, pchan->pose_mat); - + /* OPEN_SIM_COMPATIBILITY * AFAIK animation to second life is via BVH, but no * reason to not have the collada-animation be correct @@ -1359,7 +1359,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj else { copy_m4_m4(mat, ob->obmat); } - + UnitConverter converter; double outmat[4][4]; @@ -1515,7 +1515,7 @@ std::string AnimationExporter::get_light_param_sid(char *rna_path, int tm_type, if (tm_name.size()) { if (axis_name[0]) return tm_name + "." + std::string(axis_name); - else + else return tm_name; } @@ -1564,7 +1564,7 @@ std::string AnimationExporter::get_camera_param_sid(char *rna_path, int tm_type, if (tm_name.size()) { if (axis_name[0]) return tm_name + "." + std::string(axis_name); - else + else return tm_name; } @@ -1751,7 +1751,7 @@ void AnimationExporter::find_sampleframes(Object *ob, std::vector<float> &fra) } while (true); } -/* +/* * find keyframes of all the objects animations */ void AnimationExporter::find_keyframes(Object *ob, std::vector<float> &fra) @@ -1844,7 +1844,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo arm->flag &= ~ARM_RESTPOS; BKE_pose_where_is(depsgraph, scene, ob_arm); } - //v array will hold all values which will be exported. + //v array will hold all values which will be exported. if (fra.size()) { float *values = (float *)MEM_callocN(sizeof(float) * 3 * fra.size(), "temp. anim frames"); sample_animation(values, fra, transform_type, bone, ob_arm, pchan); @@ -1870,7 +1870,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo } // restore restpos - if (flag & ARM_RESTPOS) + if (flag & ARM_RESTPOS) arm->flag = flag; BKE_pose_where_is(depsgraph, scene, ob_arm); } |