Changeset View
Changeset View
Standalone View
Standalone View
source/blender/collada/AnimationImporter.cpp
| Show First 20 Lines • Show All 642 Lines • ▼ Show 20 Lines | for (unsigned int j = 0; j < bindings.getCount(); j++) { | ||||
| animcurves = curve_map[bindings[j].animation]; | animcurves = curve_map[bindings[j].animation]; | ||||
| BLI_strncpy(rna_path, anim_type, sizeof(rna_path)); | BLI_strncpy(rna_path, anim_type, sizeof(rna_path)); | ||||
| modify_fcurve(&animcurves, rna_path, 0); | modify_fcurve(&animcurves, rna_path, 0); | ||||
| std::vector<FCurve *>::iterator iter; | std::vector<FCurve *>::iterator iter; | ||||
| //Add the curves of the current animation to the object | //Add the curves of the current animation to the object | ||||
| for (iter = animcurves.begin(); iter != animcurves.end(); iter++) { | for (iter = animcurves.begin(); iter != animcurves.end(); iter++) { | ||||
| FCurve *fcu = *iter; | FCurve *fcu = *iter; | ||||
| /* All anim_types whose values are to be converted from Degree to Radians can be ORed here | /* All anim_types whose values are to be converted from Degree to Radians can be ORed here */ | ||||
| *XXX What About " rotation " ? */ | if (strcmp("spot_size", anim_type)==0) { | ||||
| if (BLI_strcaseeq("spot_size", anim_type)) { | /* NOTE: Do NOT convert if imported file was made by blender <= 2.69.10 | ||||
| /* Convert current values to Radians */ | * Reason: old blender versions stored spot_size in radians (was a bug) | ||||
| */ | |||||
| if (this->import_from_version == "" || BLI_natstrcmp(this->import_from_version.c_str(), "2.69.10") != -1) { | |||||
| fcurve_deg_to_rad(fcu); | fcurve_deg_to_rad(fcu); | ||||
| } | } | ||||
| } | |||||
| /** XXX What About animtype "rotation" ? */ | |||||
| BLI_addtail(AnimCurves, fcu); | BLI_addtail(AnimCurves, fcu); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* | /* | ||||
| ▲ Show 20 Lines • Show All 1,341 Lines • ▼ Show 20 Lines | void AnimationImporter::add_bezt(FCurve *fcu, float fra, float value) | ||||
| bez.vec[1][1] = value; | bez.vec[1][1] = value; | ||||
| bez.ipo = BEZT_IPO_LIN; /* use default interpolation mode here... */ | bez.ipo = BEZT_IPO_LIN; /* use default interpolation mode here... */ | ||||
| bez.f1 = bez.f2 = bez.f3 = SELECT; | bez.f1 = bez.f2 = bez.f3 = SELECT; | ||||
| bez.h1 = bez.h2 = HD_AUTO; | bez.h1 = bez.h2 = HD_AUTO; | ||||
| insert_bezt_fcurve(fcu, &bez, 0); | insert_bezt_fcurve(fcu, &bez, 0); | ||||
| calchandles_fcurve(fcu); | calchandles_fcurve(fcu); | ||||
| } | } | ||||
| void AnimationImporter::set_import_from_version(std::string import_from_version) | |||||
| { | |||||
| this->import_from_version = import_from_version; | |||||
| } | |||||