[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18394] branches/blender2.5/blender/source /blender: 2.5
Joshua Leung
aligorith at gmail.com
Wed Jan 7 10:41:35 CET 2009
Revision: 18394
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18394
Author: aligorith
Date: 2009-01-07 10:41:32 +0100 (Wed, 07 Jan 2009)
Log Message:
-----------
2.5
* Compiling fixes for RNA - removed duplicate RNA wrapping for posechannels, removed some irrelevant code, and fixed some errors.
* Commented out/removed some evil old stuff from pose-code
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/armature/poseobject.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c
Modified: branches/blender2.5/blender/source/blender/editors/armature/poseobject.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/poseobject.c 2009-01-07 04:38:30 UTC (rev 18393)
+++ branches/blender2.5/blender/source/blender/editors/armature/poseobject.c 2009-01-07 09:41:32 UTC (rev 18394)
@@ -462,6 +462,7 @@
curbone->flag &= ~BONE_ACTIVE;
pabone->flag |= (BONE_ACTIVE|BONE_SELECTED);
+ // XXX this is evil... this sort of stuff is to be handled in one go as a result of a notifier
select_actionchannel_by_name (ob->action, pchan->name, 0);
select_actionchannel_by_name (ob->action, pchan->parent->name, 1);
break;
@@ -477,6 +478,7 @@
curbone->flag &= ~BONE_ACTIVE;
chbone->flag |= (BONE_ACTIVE|BONE_SELECTED);
+ // XXX this is evil... this sort of stuff is to be handled in one go as a result of a notifier
select_actionchannel_by_name (ob->action, pchan->name, 0);
select_actionchannel_by_name (ob->action, pchan->child->name, 1);
break;
@@ -1325,6 +1327,7 @@
DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA);
}
+ // XXX this is evil... this sort of stuff is to be handled in one go as a result of a notifier
select_actionchannel_by_name(ob->action, name, 1);
}
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c 2009-01-07 04:38:30 UTC (rev 18393)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c 2009-01-07 09:41:32 UTC (rev 18394)
@@ -30,195 +30,11 @@
#include "rna_internal.h"
#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
#ifdef RNA_RUNTIME
-static float rna_IK_Min_X_get(PointerRNA *ptr)
-{
- bPoseChannel *pchan= (bPoseChannel*)ptr->id.data;
+#else
- return pchan->limitmin[0];
-}
-
-static float rna_IK_Min_Y_get(PointerRNA *ptr)
-{
- bPoseChannel *pchan= (bPoseChannel*)ptr->id.data;
-
- return pchan->limitmin[1];
-}
-
-static float rna_IK_Min_Z_get(PointerRNA *ptr)
-{
- bPoseChannel *pchan= (bPoseChannel*)ptr->id.data;
-
- return pchan->limitmin[2];
-}
-
-static void rna_IK_Min_X_set(PointerRNA *ptr, float value)
-{
- bPoseChannel *pchan= (bPoseChannel*)ptr->id.data;
-
- pchan->limitmin[0] = value;
-}
-
-static void rna_IK_Min_Y_set(PointerRNA *ptr, float value)
-{
- bPoseChannel *pchan= (bPoseChannel*)ptr->id.data;
-
- pchan->limitmin[1] = value;
-}
-
-static void rna_IK_Min_Z_set(PointerRNA *ptr, float value)
-{
- bPoseChannel *pchan= (bPoseChannel*)ptr->id.data;
-
- pchan->limitmin[2] = value;
-}
-
-#else
-
-/* users shouldn't be editing pose channel data directly -- better to set ipos and let blender calc pose_channel stuff */
-/* it's going to be weird for users to find IK flags and other such here, instead of in bone where they would expect them
- -- is there any way to put a doc in bone, pointing them here? */
-
-static void RNA_def_pose_channel(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- static EnumPropertyItem prop_iklimit_items[] = {
- {BONE_IK_NO_XDOF, "IKNOXDOF", "No X DoF", "Prevent motion around X axis."},
- {BONE_IK_NO_YDOF, "IKNOYDOF", "No Y DoF", "Prevent motion around Y axis."},
- {BONE_IK_NO_ZDOF, "IKNOZDOF", "No Z DoF", "Prevent motion around Z axis."},
- {BONE_IK_XLIMIT, "IKXLIMIT", "X Limit", "Limit motion around X axis."},
- {BONE_IK_YLIMIT, "IKYLIMIT", "Y Limit", "Limit motion around Y axis."},
- {BONE_IK_ZLIMIT, "IKZLIMIT", "Z Limit", "Limit motion around Z axis."},
- {0, NULL, NULL, NULL}};
-
- srna= RNA_def_struct(brna, "bPoseChannel", NULL);
- RNA_def_struct_ui_text(srna, "Pose Channel", "Member of the 'Pose' type.");
-
- /* cosntraints (collection) */
- prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_sdna(prop, NULL, "constraints", NULL);
- RNA_def_property_struct_type(prop, "bConstraint");
- RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this PoseChannel.");
-
- prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Name", "");
- RNA_def_struct_name_property(srna, prop);
-
- prop= RNA_def_property(srna, "ikflag", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_iklimit_items);
- RNA_def_property_ui_text(prop, "IK Limits", "");
-
- prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED);
- RNA_def_property_ui_text(prop, "Selected", "");
-
- prop= RNA_def_property(srna, "protected", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "protectflag", POSE_LOCKED);
- RNA_def_property_ui_text(prop, "Protected", "Protect channel from being transformed.");
-
- prop= RNA_def_property(srna, "action_group_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "agrp_index");
- RNA_def_property_ui_text(prop, "Action Group Index", "Action Group this pose channel belogs to (0=no group).");
-
- prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "pathsf");
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Bone Paths Calculation Start Frame", "Starting frame of range of frames to use for Bone Path calculations.");
-
- prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "pathef");
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Bone Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
-
- prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Bone");
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Bone", "Bone associated with this Pose Channel.");
-
- prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "bPoseChannel");
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Parent", "Parent of this pose channel.");
-
- prop= RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "bPoseChannel");
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Parent", "Child of this pose channel.");
-
- prop= RNA_def_property(srna, "channel_matrix", PROP_FLOAT, PROP_MATRIX);
- RNA_def_property_struct_type(prop, "chan_mat");
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Channel Matrix", "4x4 matrix, before constraints.");
-
- /* kaito says this should be not user-editable; I disagree; power users should be able to force this in python; he's the boss. */
- prop= RNA_def_property(srna, "pose_matrix", PROP_FLOAT, PROP_MATRIX);
- RNA_def_property_struct_type(prop, "pose_mat");
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Pose Matrix", "Final 4x4 matrix for this channel.");
-
- prop= RNA_def_property(srna, "constraint_inverse_matrix", PROP_FLOAT, PROP_MATRIX);
- RNA_def_property_struct_type(prop, "constinv");
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position.");
-
- prop= RNA_def_property(srna, "pose_head", PROP_FLOAT, PROP_VECTOR);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Pose Head Position", "Location of head of the channel's bone.");
-
- prop= RNA_def_property(srna, "pose_tail", PROP_FLOAT, PROP_VECTOR);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
- RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone.");
-
- prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "limitmin");
- RNA_def_property_range(prop, -180.0f, 180.0f);
- RNA_def_property_float_funcs(prop, "rna_IK_Min_X_get", "rna_IK_Min_X_set", NULL);
- RNA_def_property_ui_text(prop, "IK Minimum Limit X", "Minimum X angle for IK Limit");
-
- prop= RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "limitmin");
- RNA_def_property_range(prop, -180.0f, 180.0f);
- RNA_def_property_float_funcs(prop, "rna_IK_Min_Y_get", "rna_IK_Min_Y_set", NULL);
- RNA_def_property_ui_text(prop, "IK Minimum Limit Y", "Minimum Y angle for IK Limit");
-
- prop= RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "limitmin");
- RNA_def_property_range(prop, -180.0f, 180.0f);
- RNA_def_property_float_funcs(prop, "rna_IK_Min_Z_get", "rna_IK_Min_Z_set", NULL);
- RNA_def_property_ui_text(prop, "IK Minimum Limit Z", "Minimum Z angle for IK Limit");
-
- prop= RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "limitmax");
- RNA_def_property_range(prop, -180.0f, 180.0f);
- RNA_def_property_float_funcs(prop, "rna_IK_Max_X_get", "rna_IK_Max_X_set", NULL);
- RNA_def_property_ui_text(prop, "IK Maximum Limit X", "Maximum X angle for IK Limit");
-
- prop= RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "limitmax");
- RNA_def_property_range(prop, -180.0f, 180.0f);
- RNA_def_property_float_funcs(prop, "rna_IK_Max_Y_get", "rna_IK_Max_Y_set", NULL);
- RNA_def_property_ui_text(prop, "IK Maximum Limit Y", "Maximum Y angle for IK Limit");
-
- prop= RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "limitmax");
- RNA_def_property_range(prop, -180.0f, 180.0f);
- RNA_def_property_float_funcs(prop, "rna_IK_Max_Z_get", "rna_IK_Max_Z_set", NULL);
- RNA_def_property_ui_text(prop, "IK Maximum Limit Z", "Maximum Z angle for IK Limit");
-
-// float limitmin[3], limitmax[3]; /* DOF constraint */
-// float stiffness[3]; /* DOF stiffness */
-// float ikstretch;
-
-// float *path; /* totpath x 3 x float */
-// struct Object *custom; /* draws custom object instead of this channel */
-};
-
void RNA_def_action(BlenderRNA *brna)
{
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list