Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
-rw-r--r--source/blender/makesrna/intern/rna_pose.c170
-rw-r--r--source/blender/makesrna/intern/rna_space.c4
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c7
5 files changed, 139 insertions, 46 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index bfd93a4218b..4845ad28d47 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -55,7 +55,7 @@ EnumPropertyItem modifier_type_items[] ={
{eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
{eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
{eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
- {0, "", 0, "Deformers", ""},
+ {0, "", 0, "Deform", ""},
{eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
{eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""},
{eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""},
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 6cf4722494f..b90c3505d73 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -151,12 +151,72 @@ static int rna_PoseChannel_has_ik_get(PointerRNA *ptr)
return ED_pose_channel_in_IK_chain(ob, pchan);
}
+static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ bPose *pose= (ob) ? ob->pose : NULL;
+ bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bActionGroup *grp;
+
+ if (pose)
+ grp= BLI_findlink(&pose->agroups, pchan->agrp_index-1);
+ else
+ grp= NULL;
+
+ return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, grp);
+}
+
+static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value)
+{
+ Object *ob= (Object*)ptr->id.data;
+ bPose *pose= (ob) ? ob->pose : NULL;
+ bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+
+ if (pose)
+ pchan->agrp_index= BLI_findindex(&pose->agroups, value.data) + 1;
+ else
+ pchan->agrp_index= 0;
+}
+
+static int rna_PoseChannel_bone_group_index_get(PointerRNA *ptr)
+{
+ bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ return MAX2(pchan->agrp_index-1, 0);
+}
+
+static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value)
+{
+ bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ pchan->agrp_index= value+1;
+}
+
+static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max)
+{
+ Object *ob= (Object*)ptr->id.data;
+ bPose *pose= (ob) ? ob->pose : NULL;
+
+ *min= 0;
+
+ if (pose) {
+ *max= BLI_countlist(&pose->agroups)-1;
+ *max= MAX2(0, *max);
+ }
+ else
+ *max= 0;
+}
+
static PointerRNA rna_Pose_active_bone_group_get(PointerRNA *ptr)
{
bPose *pose= (bPose*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group-1));
}
+static void rna_Pose_active_bone_group_set(PointerRNA *ptr, PointerRNA value)
+{
+ bPose *pose= (bPose*)ptr->data;
+ pose->active_group= BLI_findindex(&pose->agroups, value.data) + 1;
+}
+
static int rna_Pose_active_bone_group_index_get(PointerRNA *ptr)
{
bPose *pose= (bPose*)ptr->data;
@@ -305,59 +365,22 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_PoseChannel_path");
RNA_def_struct_idproperties_func(srna, "rna_PoseChannel_idproperties");
+ /* Bone Constraints */
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this PoseChannel.");
+ /* Name + Selection Status */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_PoseChannel_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
- RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
- RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
- RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- 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.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- 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.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- 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.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
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, "bone_group_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "agrp_index");
- RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group).");
-
+ /* Baked Bone Path cache data s*/
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);
@@ -370,6 +393,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bone Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+ /* Relationships to other bones */
prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -385,6 +409,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Child", "Child of this pose channel.");
+ /* Transformation settings */
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
@@ -429,6 +454,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position."); */
+ /* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
prop= RNA_def_property(srna, "pose_head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Head Position", "Location of head of the channel's bone.");
@@ -437,6 +463,43 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone.");
+ /* IK Settings */
+ prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
+ RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
+ RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
+ RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ 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.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ 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.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ 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.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[0]");
RNA_def_property_range(prop, -180.0f, 0.0f);
@@ -497,10 +560,30 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "custom", PROP_POINTER, PROP_NONE);
+ /* custom bone shapes */
+ prop= RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "custom");
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Custom Object", "Object that defines custom draw type for this bone.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ /* bone groups */
+ prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "agrp_index");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_PoseChannel_bone_group_index_get", "rna_PoseChannel_bone_group_index_set", "rna_PoseChannel_bone_group_index_range");
+ RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "BoneGroup");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL);
+ RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ /* transform locks */
prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
RNA_def_property_array(prop, 3);
@@ -541,8 +624,9 @@ static void rna_def_pose(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_bone_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoneGroup");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL);
- RNA_def_property_ui_text(prop, "Active Bone Group", "Bone groups of the pose.");
+ RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
prop= RNA_def_property(srna, "active_bone_group_index", PROP_INT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 8e8c9a9837c..a754d619741 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1075,6 +1075,10 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
+ prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
+ RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels.");
+
prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points.");
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 587ff57a0b5..7fc2d75a708 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -311,8 +311,6 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func= RNA_def_function(srna, "view3d_select_metaballmenu", "uiTemplate_view3d_select_metaballmenu");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "view3d_select_faceselmenu", "uiTemplate_view3d_select_faceselmenu");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index b74dc6f757b..946aa1cd682 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1662,16 +1662,19 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvisize");
RNA_def_property_range(prop, 10, 64);
RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvibright");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
/* middle mouse button */
prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE);
@@ -1705,16 +1708,19 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1);
RNA_def_property_ui_text(prop, "Manipulator", "Use 3d transform manipulator.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_size");
RNA_def_property_range(prop, 2, 40);
RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
RNA_def_property_range(prop, 2, 40);
RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
@@ -1725,6 +1731,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
RNA_def_property_range(prop, 4, 10);
RNA_def_property_ui_text(prop, "Object Center Size", "Diameter in Pixels for Object/Lamp center display.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ndof_pan");