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:
authorCampbell Barton <ideasman42@gmail.com>2010-02-15 21:43:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-15 21:43:54 +0300
commitc5bcbad779a4709db914851560b66bcd94f3fcc0 (patch)
treee9e660853cf1150c75ee450dee38f081ca7a348b /source/blender/blenkernel/intern/armature.c
parent50cd69d8d944fd5a7865e93a651b84d4b7e353a3 (diff)
Proxy ID property syncing
This means pose bones on proxy poses can have their own values as long as the name and type matches that of the library pose bone. without this the only way to add new values on a pose bone proxy is to protect in the lib, reload the proxy blend and save.
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 4355d7a0b10..b568991742e 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1529,9 +1529,15 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
pchanw.path= NULL;
/* this is freed so copy a copy, else undo crashes */
- if(pchanw.prop)
+ if(pchanw.prop) {
pchanw.prop= IDP_CopyProperty(pchanw.prop);
+ /* use the values from the the existing props */
+ if(pchan->prop) {
+ IDP_SyncGroupValues(pchanw.prop, pchan->prop);
+ }
+ }
+
/* constraints - proxy constraints are flushed... local ones are added after
* 1. extract constraints not from proxy (CONSTRAINT_PROXY_LOCAL) from pchan's constraints
* 2. copy proxy-pchan's constraints on-to new
@@ -1570,6 +1576,25 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
/* always copy custom shape */
pchan->custom= pchanp->custom;
pchan->custom_tx= pchanp->custom_tx;
+
+ /* ID-Property Syncing */
+ {
+ IDProperty *prop_orig= pchan->prop;
+ if(pchanp->prop) {
+ pchan->prop= IDP_CopyProperty(pchanp->prop);
+ if(prop_orig) {
+ /* copy existing values across when types match */
+ IDP_SyncGroupValues(pchan->prop, prop_orig);
+ }
+ }
+ else {
+ pchan->prop= NULL;
+ }
+ if (prop_orig) {
+ IDP_FreeProperty(prop_orig);
+ MEM_freeN(prop_orig);
+ }
+ }
}
}
}