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:
-rw-r--r--source/blender/blenkernel/intern/armature.c4
-rw-r--r--source/blender/blenloader/intern/readfile.c16
-rw-r--r--source/blender/makesrna/intern/rna_armature.c16
3 files changed, 27 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index b5fde5329df..1943c82766e 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1456,10 +1456,6 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
if(error)
return;
- /* exception, armature local layer should be proxied too */
- if (pose->proxy_layer)
- ((bArmature *)ob->data)->layer= pose->proxy_layer;
-
/* clear all transformation values from library */
rest_pose(frompose);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 0e1bd6cc5e6..419ef90ab3a 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2213,13 +2213,21 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
if (!pose || !arm)
return;
+
/* always rebuild to match proxy or lib changes */
rebuild= ob->proxy || (ob->id.lib==NULL && arm->id.lib);
- if (ob->proxy && pose->proxy_act_bone[0]) {
- Bone *bone = get_named_bone(arm, pose->proxy_act_bone);
- if (bone)
- arm->act_bone = bone;
+ if(ob->proxy) {
+ /* sync proxy layer */
+ if(pose->proxy_layer)
+ arm->layer = pose->proxy_layer;
+
+ /* sync proxy active bone */
+ if(pose->proxy_act_bone[0]) {
+ Bone *bone = get_named_bone(arm, pose->proxy_act_bone);
+ if (bone)
+ arm->act_bone = bone;
+ }
}
for (pchan = pose->chanbase.first; pchan; pchan=pchan->next) {
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 */