Depsgraph: change the fix for #107081 to handle any Scene references.

The cause of that bug is any dependency on Scene COW, because that is
triggered by selection. Context properties merely are the most reasonable
way for that to happen. Therefore, the special rule should really apply
to any Scene references.

The real motivation is this removes dependency on dvar for when this
code is extracted as a new method in the next commit.

Pull Request #110139
This commit is contained in:
Alexander Gavrilov
2023-07-16 14:10:36 +03:00
parent 347a466e15
commit 406f601c4b
@@ -1970,8 +1970,10 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
*
* The not-so-obvious part is that we don't do such relation for the context properties.
* They are resolved at the graph build time and do not change at runtime (#107081).
* Thus scene has to be excluded as a special case; this is OK because changes to
* scene.camera not caused by animation should actually force a dependency graph rebuild.
*/
if (target_id != variable_exit_key.ptr.owner_id && dvar->type != DVAR_TYPE_CONTEXT_PROP) {
if (target_id != variable_exit_key.ptr.owner_id && GS(target_id->name) != ID_SCE) {
if (deg_copy_on_write_is_needed(GS(target_id->name))) {
ComponentKey target_id_key(target_id, NodeType::COPY_ON_WRITE);
add_relation(target_id_key, driver_key, "Target ID -> Driver");