light SpotLight blend and size parameters animation export. on going.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user