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)"
This commit is contained in:
Joshua Leung 2009-12-28 03:45:24 +00:00
parent 03c1e4374b
commit 860e46082f
4 changed files with 16 additions and 3 deletions

@ -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"

@ -98,7 +98,7 @@ static void rna_def_dopesheet(BlenderRNA *brna)
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);

@ -1428,6 +1428,8 @@ static void rna_def_object(BlenderRNA *brna)
{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 @@ static void rna_def_object(BlenderRNA *brna)
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 @@ static void rna_def_object(BlenderRNA *brna)
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 @@ static void rna_def_object(BlenderRNA *brna)
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

@ -639,6 +639,9 @@ static void rna_def_pose_channel(BlenderRNA *brna)
{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 @@ static void rna_def_pose_channel(BlenderRNA *brna)
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 @@ static void rna_def_pose_channel(BlenderRNA *brna)
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 @@ static void rna_def_pose_channel(BlenderRNA *brna)
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");