diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-06-29 08:34:20 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-06-29 08:34:20 +0400 |
commit | 2f60a5030f6c90c2278d3938460809de43012f85 (patch) | |
tree | fcf2b78b7a0c1e50cb613ad3219b94d06dc7f406 /source/blender/editors/interface | |
parent | b85e0c3e850b8995577aee9b066e15e66c60bad3 (diff) |
Actions can now be made single-user from the Outliner
* Use the same method as from unlinking actions to do this.
* Split off the make single-user code used for the ID-browser into a
function in blenkernel which can be used elsewhere. Getting materials
to also work using this method proved to be a bit too tricky (due to
the whole messy ob vs obdata situation), so I haven't done that.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 32a20e82d2f..39abcecbb6b 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -234,7 +234,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) { TemplateID *template= (TemplateID*)arg_litem; PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop); - ID *id= idptr.data, *newid; + ID *id= idptr.data; int event= GET_INT_FROM_POINTER(arg_event); switch(event) { @@ -273,21 +273,8 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) } break; case UI_ID_ALONE: - if(id) { - /* make copy */ - if(id_copy(id, &newid, 0) && newid) { - /* copy animation actions too */ - BKE_copy_animdata_id_action(id); - /* us is 1 by convention, but RNA_property_pointer_set - will also incremement it, so set it to zero */ - newid->us= 0; - - /* assign copy */ - RNA_id_pointer_create(newid, &idptr); - RNA_property_pointer_set(&template->ptr, template->prop, idptr); - RNA_property_update(C, &template->ptr, template->prop); - } - } + if(id) + id_single_user(C, id, &template->ptr, template->prop); break; #if 0 case UI_ID_AUTO_NAME: |