[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25585] trunk/blender/source/blender: Assorted Animation/RNA fixes:

Joshua Leung aligorith at gmail.com
Mon Dec 28 04:45:25 CET 2009


Revision: 25585
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25585
Author:   aligorith
Date:     2009-12-28 04:45:24 +0100 (Mon, 28 Dec 2009)

Log Message:
-----------
Assorted Animation/RNA fixes:
* Fix for compiler warning in mesh.c from previous commit
* Fix for wrong name for dopesheet filter button used for meshes
* Added RNA defines for the default values for quaternion and axis-angle rotations, so that clearing these to their default values "does the right thing (TM)"

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/mesh.c
    trunk/blender/source/blender/makesrna/intern/rna_action.c
    trunk/blender/source/blender/makesrna/intern/rna_object.c
    trunk/blender/source/blender/makesrna/intern/rna_pose.c

Modified: trunk/blender/source/blender/blenkernel/intern/mesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mesh.c	2009-12-28 01:31:47 UTC (rev 25584)
+++ trunk/blender/source/blender/blenkernel/intern/mesh.c	2009-12-28 03:45:24 UTC (rev 25585)
@@ -41,6 +41,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "DNA_ID.h"
+#include "DNA_anim_types.h"
 #include "DNA_curve_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_material_types.h"
@@ -51,6 +52,7 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_ipo_types.h"
 
+#include "BKE_animsys.h"
 #include "BKE_customdata.h"
 #include "BKE_depsgraph.h"
 #include "BKE_main.h"

Modified: trunk/blender/source/blender/makesrna/intern/rna_action.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_action.c	2009-12-28 01:31:47 UTC (rev 25584)
+++ trunk/blender/source/blender/makesrna/intern/rna_action.c	2009-12-28 03:45:24 UTC (rev 25585)
@@ -98,7 +98,7 @@
 	RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0);
 	RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
 
-	prop= RNA_def_property(srna, "display_meshes", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "display_mesh", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH);
 	RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of Mesh related Animation data.");
 	RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0);

Modified: trunk/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object.c	2009-12-28 01:31:47 UTC (rev 25584)
+++ trunk/blender/source/blender/makesrna/intern/rna_object.c	2009-12-28 03:45:24 UTC (rev 25585)
@@ -1427,7 +1427,9 @@
 		{ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
 		{ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."},
 		{0, NULL, 0, NULL, NULL}};
-
+	
+	static float default_quat[4] = {1,0,0,0};	/* default quaternion values */
+	static float default_axisAngle[4] = {0,0,1,0};	/* default axis-angle rotation values */
 	int matrix_dimsize[]= {4, 4};
 
 	srna= RNA_def_struct(brna, "Object", "ID");
@@ -1549,6 +1551,7 @@
 	prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
 	RNA_def_property_float_sdna(prop, NULL, "quat");
 	RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
+	RNA_def_property_float_array_default(prop, default_quat);
 	RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions.");
 	RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
 	
@@ -1559,6 +1562,7 @@
 	RNA_def_property_array(prop, 4); // TODO: maybe we'll need to define the 'default value' getter too...
 	RNA_def_property_float_funcs(prop, "rna_Object_rotation_axis_angle_get", "rna_Object_rotation_axis_angle_set", NULL);
 	RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
+	RNA_def_property_float_array_default(prop, default_axisAngle);
 	RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation.");
 	RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
 	
@@ -1601,12 +1605,14 @@
 	
 	prop= RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
 	RNA_def_property_float_sdna(prop, NULL, "dquat");
+	RNA_def_property_float_array_default(prop, default_quat);
 	RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)", "Extra added rotation to the rotation of the object (when using Quaternion rotations).");
 	RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
 	
 #if 0 // XXX not supported well yet...
 	prop= RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
 	RNA_def_property_float_sdna(prop, NULL, "dquat"); // FIXME: this is not a single field any more! (drotAxis and drotAngle)
+	RNA_def_property_float_array_default(prop, default_axisAngle);
 	RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)", "Extra added rotation to the rotation of the object (when using Axis-Angle rotations).");
 	RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
 #endif

Modified: trunk/blender/source/blender/makesrna/intern/rna_pose.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_pose.c	2009-12-28 01:31:47 UTC (rev 25584)
+++ trunk/blender/source/blender/makesrna/intern/rna_pose.c	2009-12-28 03:45:24 UTC (rev 25585)
@@ -638,6 +638,9 @@
 		{ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
 		{ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."},
 		{0, NULL, 0, NULL, NULL}};
+		
+	static float default_quat[4] = {1,0,0,0};	/* default quaternion values */
+	static float default_axisAngle[4] = {0,0,1,0};	/* default axis-angle rotation values */
 	
 	StructRNA *srna;
 	PropertyRNA *prop;
@@ -665,7 +668,7 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED);
 	RNA_def_property_ui_text(prop, "Selected", "");
 
-	/* Baked Bone Path cache data s*/
+	/* Baked Bone Path cache data */
 	prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_TIME);
 	RNA_def_property_int_sdna(prop, NULL, "pathsf");
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -711,6 +714,7 @@
 	prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
 	RNA_def_property_float_sdna(prop, NULL, "quat");
 	RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
+	RNA_def_property_float_array_default(prop, default_quat);
 	RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions.");
 	RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
 	
@@ -721,6 +725,7 @@
 	RNA_def_property_array(prop, 4); // TODO: maybe we'll need to define the 'default value' getter too...
 	RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get", "rna_PoseChannel_rotation_axis_angle_set", NULL);
 	RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
+	RNA_def_property_float_array_default(prop, default_axisAngle);
 	RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation.");
 	RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
 	





More information about the Bf-blender-cvs mailing list