diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-02-13 16:48:36 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-02-14 14:06:18 +0300 |
commit | ec2ede430231ef7f32e76f0626f76a9733ee1b72 (patch) | |
tree | 54fb287a3725b58729b312e102a01c2f15dcef9e /source | |
parent | dde0765de2bf61afc063650159b6274ffe407b0a (diff) |
Bugfix: Referencing actions from Action Actuator was not setting a user
This reverts the change made in 8872cba7e956a9d9a840e55e5323945497524795
which was contributing to actions being lost in some cases [1], even when
they were assigned to those actuaters, which needed them to be able to
function. Now there's one less case where users are needed but were missing :)
Note that this still doesn't solve the core issue where nothing is responsible
for associating actions created for a particular datablock (and not currently
being used in its active action slot, or in the NLA stack) with that datablock.
That issue is the cause of most action disappearances as well as for other problems
(such as renaming bones being unable to fix unreferenced/unused actions) where there
are diifferences between users' mental models and the data model. Proper fixes are
coming soon (restoring fake users here isn't a proper fix, as it only masks the
fundamental mismatch/problem here).
[1] http://blenderartists.org/forum/showthread.php?357021-BGE-loses-actions
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_actuator.c | 12 |
2 files changed, 3 insertions, 13 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 204a7af69ef..9468593f615 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4514,11 +4514,11 @@ static void lib_link_object(FileData *fd, Main *main) } else if (act->type == ACT_ACTION) { bActionActuator *aa = act->data; - aa->act= newlibadr(fd, ob->id.lib, aa->act); + aa->act= newlibadr_us(fd, ob->id.lib, aa->act); } else if (act->type == ACT_SHAPEACTION) { bActionActuator *aa = act->data; - aa->act= newlibadr(fd, ob->id.lib, aa->act); + aa->act= newlibadr_us(fd, ob->id.lib, aa->act); } else if (act->type == ACT_PROPERTY) { bPropertyActuator *pa = act->data; diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 691a7432275..6f2c968764c 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -531,14 +531,6 @@ static void rna_Actuator_editobject_mesh_set(PointerRNA *ptr, PointerRNA value) eoa->me = value.data; } -static void rna_Actuator_action_action_set(PointerRNA *ptr, PointerRNA value) -{ - bActuator *act = (bActuator *)ptr->data; - bActionActuator *aa = (bActionActuator *) act->data; - - aa->act = value.data; -} - #else static void rna_def_actuator(BlenderRNA *brna) @@ -618,10 +610,8 @@ static void rna_def_action_actuator(BlenderRNA *brna) prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); RNA_def_property_struct_type(prop, "Action"); - RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); RNA_def_property_ui_text(prop, "Action", ""); - /* note: custom set function is ONLY to avoid rna setting a user for this. */ - RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE); |