[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18392] branches/blender2.5/blender/source /blender/makesrna: Finally committing useful rna for action types.

Roland Hess me at harkyman.com
Wed Jan 7 05:06:55 CET 2009


Revision: 18392
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18392
Author:   harkyman
Date:     2009-01-07 05:06:52 +0100 (Wed, 07 Jan 2009)

Log Message:
-----------
Finally committing useful rna for action types. This includes actions, action channels and action groups. I broke both pose channels and pose off into their own rna. Links also updated in Object rna for both Action and Pose stuff.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
    branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009-01-07 03:34:12 UTC (rev 18391)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009-01-07 04:06:52 UTC (rev 18392)
@@ -176,6 +176,8 @@
 extern StructRNA RNA_PluginSequence;
 extern StructRNA RNA_PointCache;
 extern StructRNA RNA_PointerProperty;
+extern StructRNA RNA_Pose;
+extern StructRNA RNA_PoseChannel;
 extern StructRNA RNA_Property;
 extern StructRNA RNA_PropertySensor;
 extern StructRNA RNA_PythonController;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2009-01-07 03:34:12 UTC (rev 18391)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2009-01-07 04:06:52 UTC (rev 18392)
@@ -925,6 +925,7 @@
 	{"rna_object_force.c", RNA_def_object_force},
 	{"rna_packedfile.c", RNA_def_packedfile},
 	{"rna_particle.c", RNA_def_particle},
+	{"rna_pose.c", RNA_def_pose},
 	{"rna_property.c", RNA_def_gameproperty},
 	{"rna_radio.c", RNA_def_radio},
 	{"rna_rna.c", RNA_def_rna},

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2009-01-07 03:34:12 UTC (rev 18391)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2009-01-07 04:06:52 UTC (rev 18392)
@@ -123,6 +123,7 @@
 void RNA_def_object_force(struct BlenderRNA *brna);
 void RNA_def_packedfile(struct BlenderRNA *brna);
 void RNA_def_particle(struct BlenderRNA *brna);
+void RNA_def_pose(struct BlenderRNA *brna);
 void RNA_def_radio(struct BlenderRNA *brna);
 void RNA_def_rna(struct BlenderRNA *brna);
 void RNA_def_scene(struct BlenderRNA *brna);

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c	2009-01-07 03:34:12 UTC (rev 18391)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c	2009-01-07 04:06:52 UTC (rev 18392)
@@ -246,7 +246,7 @@
 		{"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks."},
 		{"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks."},
 		{"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks."},
-		{"actions", "ID", "rna_Main_action_begin", "Actions", "Action datablocks."},
+		{"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks."},
 		{"particles", "ID", "rna_Main_particle_begin", "Particles", "Particle datablocks."},
 		{NULL, NULL, NULL, NULL, NULL}};
 	int i;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c	2009-01-07 03:34:12 UTC (rev 18391)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c	2009-01-07 04:06:52 UTC (rev 18392)
@@ -861,17 +861,17 @@
 	/* action / pose / nla */
 
 	prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
-	RNA_def_property_struct_type(prop, "UnknownType"); //action
+	RNA_def_property_struct_type(prop, "Action");
 	RNA_def_property_ui_text(prop, "Action", "Action used by object to define Ipo curves.");
 
 	prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "poselib");
-	RNA_def_property_struct_type(prop, "UnknownType"); // action
+	RNA_def_property_struct_type(prop, "Action");
 	RNA_def_property_ui_text(prop, "Pose Library", "Action used as a pose library for armatures.");
 
 	prop= RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "pose");
-	RNA_def_property_struct_type(prop, "UnknownType");
+	RNA_def_property_struct_type(prop, "Pose");
 	RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures.");
 
 	prop= RNA_def_property(srna, "pose_mode", PROP_BOOLEAN, PROP_NONE);

Added: branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c	2009-01-07 04:06:52 UTC (rev 18392)
@@ -0,0 +1,204 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Roland Hess
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_action_types.h"
+#include "DNA_armature_types.h"
+#include "DNA_constraint_types.h"
+#include "DNA_scene_types.h"
+
+#ifdef RNA_RUNTIME
+
+#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;
+
+	srna= RNA_def_struct(brna, "PoseChannel", NULL);
+	RNA_def_struct_sdna(srna, "bPoseChannel");
+	RNA_def_struct_ui_text(srna, "Pose Channel", "Member of the 'Pose' type.");
+
+	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, "Constraint");
+	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, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
+	RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
+
+	prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
+	RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
+
+	prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
+	RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
+
+	prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
+	RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis.");
+
+	prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
+	RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis.");
+
+	prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
+	RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis.");
+	
+	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, "PoseChannel");
+	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, "PoseChannel");
+	RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+	RNA_def_property_ui_text(prop, "Parent", "Child of this pose channel.");
+

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list