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:
authorJoshua Leung <aligorith@gmail.com>2009-11-28 06:49:45 +0300
committerJoshua Leung <aligorith@gmail.com>2009-11-28 06:49:45 +0300
commit54c5859578362976cc54b4e04f0a513117b4698e (patch)
treec377ed51fd218982da61a960c4e5f572c91ab2df /source/blender/makesrna/intern/rna_armature.c
parentc6b4c2716a5fb2784b9b2ddc5ec555ff68a2d24b (diff)
Durian Rigging Requests: (Armature Layers + Rotation Locking Tweaks)
* Increased the number of Armature and Bone Layers from 16 to 32. Please note that older versions of Blender may not correctly resolve the layers that bones are on when loading new files. * Newly added objects are now made by default to allow locking of 4-component rotations using 4 separate locks (i.e. one by component) instead of requiring the obscure 'W' toggle (renamed '4L' now) to be enabled first. The objects in the default scene need modifying manually though.
Diffstat (limited to 'source/blender/makesrna/intern/rna_armature.c')
-rw-r--r--source/blender/makesrna/intern/rna_armature.c46
1 files changed, 10 insertions, 36 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index a5b21d5447d..7986da818c8 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -139,19 +139,19 @@ static IDProperty *rna_EditBone_idproperties(PointerRNA *ptr, int create)
return ebone->prop;
}
-static void rna_bone_layer_set(short *layer, const int *values)
+static void rna_bone_layer_set(int *layer, const int *values)
{
int i, tot= 0;
/* ensure we always have some layer selected */
- for(i=0; i<16; i++)
+ for(i=0; i<32; i++)
if(values[i])
tot++;
if(tot==0)
return;
- for(i=0; i<16; i++) {
+ for(i=0; i<32; i++) {
if(values[i]) *layer |= (1<<i);
else *layer &= ~(1<<i);
}
@@ -169,14 +169,14 @@ static void rna_Armature_layer_set(PointerRNA *ptr, const int *values)
int i, tot= 0;
/* ensure we always have some layer selected */
- for(i=0; i<20; i++)
+ for(i=0; i<32; i++)
if(values[i])
tot++;
if(tot==0)
return;
- for(i=0; i<20; i++) {
+ for(i=0; i<32; i++) {
if(values[i]) arm->layer |= (1<<i);
else arm->layer &= ~(1<<i);
}
@@ -236,28 +236,7 @@ static void rna_Bone_name_set(PointerRNA *ptr, const char *value)
ED_armature_bone_rename(arm, oldname, newname);
}
-static void rna_EditBone_layer_get(PointerRNA *ptr, int values[16])
-{
- EditBone *data= (EditBone*)(ptr->data);
- values[0]= ((data->layer & (1<<0)) != 0);
- values[1]= ((data->layer & (1<<1)) != 0);
- values[2]= ((data->layer & (1<<2)) != 0);
- values[3]= ((data->layer & (1<<3)) != 0);
- values[4]= ((data->layer & (1<<4)) != 0);
- values[5]= ((data->layer & (1<<5)) != 0);
- values[6]= ((data->layer & (1<<6)) != 0);
- values[7]= ((data->layer & (1<<7)) != 0);
- values[8]= ((data->layer & (1<<8)) != 0);
- values[9]= ((data->layer & (1<<9)) != 0);
- values[10]= ((data->layer & (1<<10)) != 0);
- values[11]= ((data->layer & (1<<11)) != 0);
- values[12]= ((data->layer & (1<<12)) != 0);
- values[13]= ((data->layer & (1<<13)) != 0);
- values[14]= ((data->layer & (1<<14)) != 0);
- values[15]= ((data->layer & (1<<15)) != 0);
-}
-
-static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[16])
+static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[])
{
EditBone *data= (EditBone*)(ptr->data);
rna_bone_layer_set(&data->layer, values);
@@ -405,8 +384,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
/* flags */
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
- RNA_def_property_array(prop, 16);
- if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_layer_get", "rna_EditBone_layer_set");
+ RNA_def_property_array(prop, 32);
+ if(editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_layer_set");
else RNA_def_property_boolean_funcs(prop, NULL, "rna_Bone_layer_set");
RNA_def_property_ui_text(prop, "Layers", "Layers bone exists in");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
@@ -763,11 +742,6 @@ static void rna_def_armature(BlenderRNA *brna)
rna_def_armature_edit_bones(brna, prop);
/* Enum values */
-// prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE);
-// RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_RESTPOS);
-// RNA_def_property_ui_text(prop, "Rest Position", "Show Armature in Rest Position. No posing possible.");
-// RNA_def_property_update(prop, 0, "rna_Armature_update_data");
-
prop= RNA_def_property(srna, "pose_position", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_pose_position_items);
@@ -801,7 +775,7 @@ static void rna_def_armature(BlenderRNA *brna)
/* layer */
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
- RNA_def_property_array(prop, 16);
+ RNA_def_property_array(prop, 32);
RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility.");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Armature_redraw_data");
@@ -810,7 +784,7 @@ static void rna_def_armature(BlenderRNA *brna)
/* layer protection */
prop= RNA_def_property(srna, "layer_protection", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
- RNA_def_property_array(prop, 16);
+ RNA_def_property_array(prop, 32);
RNA_def_property_ui_text(prop, "Layer Proxy Protection", "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo.");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");