Depsgraph: Make bAction a part of dependency graph
There are various values which depends on context in there, for example current driver value and original DNA value f-curve is applied for. This partially fixes issue with not being able to tweak keyed values when material preview is open. The material preview is not being currently updated against non-keyed changes since every tweak of material property does full preview scene depsgraph evaluation.
This commit is contained in:
@@ -677,12 +677,17 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
|
||||
if (adt == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* animation */
|
||||
if (adt->action || adt->nla_tracks.first || adt->drivers.first) {
|
||||
(void) add_id_node(id);
|
||||
ID *id_cow = get_cow_id(id);
|
||||
|
||||
if (adt->action != NULL) {
|
||||
add_operation_node(&adt->action->id, DEG_NODE_TYPE_ANIMATION,
|
||||
NULL,
|
||||
DEG_OPCODE_ANIMATION);
|
||||
}
|
||||
|
||||
// XXX: Hook up specific update callbacks for special properties which
|
||||
// may need it...
|
||||
|
||||
|
||||
@@ -898,6 +898,11 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
|
||||
ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION);
|
||||
TimeSourceKey time_src_key;
|
||||
add_relation(time_src_key, adt_key, "TimeSrc -> Animation");
|
||||
/* Relation from action itself. */
|
||||
if (adt->action != NULL) {
|
||||
ComponentKey action_key(&adt->action->id, DEG_NODE_TYPE_ANIMATION);
|
||||
add_relation(action_key, adt_key, "Action -> Animation");
|
||||
}
|
||||
/* Get source operations. */
|
||||
DepsNode *node_from = get_node(adt_key);
|
||||
BLI_assert(node_from != NULL);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <cstring>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_threads.h"
|
||||
#include "BLI_string.h"
|
||||
|
||||
@@ -61,6 +62,7 @@
|
||||
|
||||
extern "C" {
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_anim_types.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
@@ -329,7 +331,6 @@ static bool check_datablocks_copy_on_writable(const ID *id_orig)
|
||||
}
|
||||
return !ELEM(id_type, ID_BR,
|
||||
ID_LS,
|
||||
ID_AC,
|
||||
ID_PAL);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,9 @@ bAction *verify_adt_action(ID *id, short add)
|
||||
/* XXX: we probably should have bmain passed down, but that involves altering too many API's */
|
||||
DEG_relations_tag_update(G.main);
|
||||
}
|
||||
|
||||
|
||||
DEG_id_tag_update(&adt->action->id, DEG_TAG_COPY_ON_WRITE);
|
||||
|
||||
/* return the action */
|
||||
return adt->action;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user