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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-11-24 17:05:53 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-11-24 17:05:53 +0300
commitc7c034fedb87e0ff3cf80f4f388bacad51434617 (patch)
tree29fcd52b87612075e63632b7c5c5523883505ba1 /source/blender/makesrna
parent40d7da495e67b9230354a217d8ec0f36f86b5685 (diff)
Fix #24782: proxy armature Layer state not saved with file. Was in 2.4x but
not ported to 2.5x, implemented a bit different now to fit RNA better.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_armature.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 71e4f0fdfe3..444c2be67cf 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -117,6 +117,20 @@ 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)
+{
+ bArmature *arm= ptr->id.data;
+ Object *ob;
+
+ /* proxy lib exception, store it here so we can restore layers on file
+ load, since it would otherwise get lost due to being linked data */
+ for(ob = bmain->object.first; ob; ob=ob->id.next)
+ if(ob->data == arm && ob->pose)
+ ob->pose->proxy_layer = arm->layer;
+
+ WM_main_add_notifier(NC_GEOM|ND_DATA, arm);
+}
+
static void rna_Armature_redraw_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ID *id= ptr->id.data;
@@ -810,7 +824,7 @@ static void rna_def_armature(BlenderRNA *brna)
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");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Armature_update_layers");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* layer protection */