[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38087] branches/soc-2011-pepper/source/ blender/collada: light SpotLight blend and size parameters animation export .
Sukhitha Jayathilake
pr.jayathilake at gmail.com
Mon Jul 4 17:33:39 CEST 2011
Revision: 38087
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38087
Author: phabtar
Date: 2011-07-04 15:33:39 +0000 (Mon, 04 Jul 2011)
Log Message:
-----------
light SpotLight blend and size parameters animation export. on going.
Modified Paths:
--------------
branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
branches/soc-2011-pepper/source/blender/collada/LightExporter.cpp
Modified: branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp 2011-07-04 15:09:02 UTC (rev 38086)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp 2011-07-04 15:33:39 UTC (rev 38087)
@@ -88,7 +88,8 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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;
Modified: branches/soc-2011-pepper/source/blender/collada/LightExporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/LightExporter.cpp 2011-07-04 15:09:02 UTC (rev 38086)
+++ branches/soc-2011-pepper/source/blender/collada/LightExporter.cpp 2011-07-04 15:33:39 UTC (rev 38087)
@@ -103,8 +103,8 @@
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);
More information about the Bf-blender-cvs
mailing list