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:
authorMitchell Stokes <mogurijin@gmail.com>2011-07-29 10:32:30 +0400
committerMitchell Stokes <mogurijin@gmail.com>2011-07-29 10:32:30 +0400
commitb46d8955509e805f06b76a6fd800ecb4edee113b (patch)
tree7ed0b1a3b5d04ab48d3e9062ff02ce54961ecb06 /source/blender/makesrna/intern/rna_armature.c
parent6960127d2609620d52620539388ada5cb466bab2 (diff)
parent26589497529ca3c8da85391d4976d286a371e258 (diff)
Merging r36529-38806bge_components
Diffstat (limited to 'source/blender/makesrna/intern/rna_armature.c')
-rw-r--r--source/blender/makesrna/intern/rna_armature.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 1b07b224f87..0310ce917d4 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -52,7 +52,7 @@
#include "ED_armature.h"
#include "BKE_armature.h"
-static void rna_Armature_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
ID *id= ptr->id.data;
@@ -126,7 +126,7 @@ void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone
ED_armature_edit_bone_remove(arm, ebone);
}
-static void rna_Armature_update_layers(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
bArmature *arm= ptr->id.data;
Object *ob;
@@ -140,7 +140,7 @@ static void rna_Armature_update_layers(Main *bmain, Scene *scene, PointerRNA *pt
WM_main_add_notifier(NC_GEOM|ND_DATA, arm);
}
-static void rna_Armature_redraw_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
ID *id= ptr->id.data;
@@ -149,7 +149,20 @@ static void rna_Armature_redraw_data(Main *bmain, Scene *scene, PointerRNA *ptr)
static char *rna_Bone_path(PointerRNA *ptr)
{
- return BLI_sprintfN("bones[\"%s\"]", ((Bone*)ptr->data)->name);
+ Bone *bone = (Bone*)ptr->data;
+
+ /* special exception for trying to get the path where ID-block is Object
+ * - this will be assumed to be from a Pose Bone...
+ */
+ if (ptr->id.data) {
+ ID *id = (ID *)ptr->id.data;
+
+ if (GS(id->name) == ID_OB)
+ return BLI_sprintfN("pose.bones[\"%s\"].bone", bone->name);
+ }
+
+ /* from armature... */
+ return BLI_sprintfN("bones[\"%s\"]", bone->name);
}
static IDProperty *rna_Bone_idprops(PointerRNA *ptr, int create)
@@ -496,6 +509,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
prop= RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_UNSIGNED);
if(editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
+ else RNA_def_property_update(prop, 0, "rna_Armature_update_data");
RNA_def_property_float_sdna(prop, NULL, "rad_head");
//RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid);
RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3);
@@ -503,6 +517,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
prop= RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_UNSIGNED);
if(editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
+ else RNA_def_property_update(prop, 0, "rna_Armature_update_data");
RNA_def_property_float_sdna(prop, NULL, "rad_tail");
//RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid);
RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3);