diff options
author | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-04 19:33:39 +0400 |
---|---|---|
committer | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-04 19:33:39 +0400 |
commit | ab369227fbbfc40756fb49b9d795bd2a8ef7fcd6 (patch) | |
tree | abd74000db2ba27c374a09db0023c394fd676e93 /source | |
parent | a552d8e6104db06d94e2a51d533d7f34cfd3aa47 (diff) |
light SpotLight blend and size parameters animation export. on going.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 21 | ||||
-rw-r--r-- | source/blender/collada/LightExporter.cpp | 4 |
2 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 243b661e6eb..fdd59c40ea5 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -88,7 +88,8 @@ void AnimationExporter::exportAnimations(Scene *sce) if ((!strcmp(transformName, "location") || !strcmp(transformName, "scale")) || (!strcmp(transformName, "rotation_euler") && ob->rotmode == ROT_MODE_EUL)|| (!strcmp(transformName, "rotation_quaternion")) || - (!strcmp(transformName, "color"))) + (!strcmp(transformName, "color")) || + (!strcmp(transformName, "spot_size"))) dae_animation(ob ,fcu, transformName ); @@ -164,6 +165,10 @@ void AnimationExporter::exportAnimations(Scene *sce) if (fcu->array_index < 4) axis_name = axis_names[fcu->array_index];*/ } + else if ( !strcmp(transformName, "spot_size")||!strcmp(transformName, "spot_blend") ) + { + axis_name = ""; + } else if ( !strcmp(transformName, "color") ) { const char *axis_names[] = {"R", "G", "B"}; @@ -246,7 +251,7 @@ void AnimationExporter::exportAnimations(Scene *sce) std::string target ; - if ( !strcmp( transformName, "color" ) ) + if ( ob->type == OB_LAMP ) target = get_light_id(ob) + "/" + get_transform_sid(fcu->rna_path, -1, axis_name, true); else @@ -546,7 +551,7 @@ void AnimationExporter::exportAnimations(Scene *sce) values[1] = 0; } else if (rotation) { - values[1] = (bezt->vec[0][1]) * 180.0f/M_PI; + values[1] = (bezt->vec[2][1]) * 180.0f/M_PI; } else { values[1] = bezt->vec[2][1]; } @@ -767,6 +772,10 @@ void AnimationExporter::exportAnimations(Scene *sce) tm_type = 3; else if (!strcmp(name, "color")) tm_type = 4; + else if (!strcmp(name, "spot_size")) + tm_type = 5; + else if (!strcmp(name, "spot_blend")) + tm_type = 6; else tm_type = -1; } @@ -786,6 +795,12 @@ void AnimationExporter::exportAnimations(Scene *sce) case 4: tm_name = "color"; break; + case 5: + tm_name = "fall_off_angle"; + break; + case 6: + tm_name = "fall_off_exponent"; + break; default: tm_name = ""; break; diff --git a/source/blender/collada/LightExporter.cpp b/source/blender/collada/LightExporter.cpp index 860a2ae5a67..c3f850dd0cb 100644 --- a/source/blender/collada/LightExporter.cpp +++ b/source/blender/collada/LightExporter.cpp @@ -103,8 +103,8 @@ void LightsExporter::operator()(Object *ob) else if (la->type == LA_SPOT) { COLLADASW::SpotLight cla(mSW, la_id, la_name); cla.setColor(col,false,"color"); - cla.setFallOffAngle(la->spotsize); - cla.setFallOffExponent(la->spotblend); + cla.setFallOffAngle(la->spotsize,false,"fall_off_angle"); + cla.setFallOffExponent(la->spotblend,false,"fall_off_exponent"); cla.setConstantAttenuation(constatt); cla.setLinearAttenuation(linatt); cla.setQuadraticAttenuation(quadatt); |