feat: apply bl_apply_child member to force dependencies reloading

fix: node_tree animation dependencies
This commit is contained in:
Swann 2021-06-22 11:36:51 +02:00
parent 3774419b7e
commit a199e0df00
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB
4 changed files with 14 additions and 3 deletions

View File

@ -404,6 +404,7 @@ class BlMaterial(ReplicatedDatablock):
bl_check_common = False
bl_icon = 'MATERIAL_DATA'
bl_reload_parent = False
bl_reload_child = True
@staticmethod
def construct(data: dict) -> object:
@ -513,6 +514,7 @@ class BlMaterial(ReplicatedDatablock):
if datablock.use_nodes:
deps.extend(get_node_tree_dependencies(datablock.node_tree))
deps.extend(resolve_animation_dependencies(datablock.node_tree))
deps.extend(resolve_animation_dependencies(datablock))
return deps

@ -1 +1 @@
Subproject commit 730e6a9d37b5c617b78dba1503f282032c4bb027
Subproject commit ce3a7b4363ec9fa879925d57c8555decbc92158a

View File

@ -604,8 +604,7 @@ class SessionApply(bpy.types.Operator):
node_ref = session.repository.graph.get(self.target)
porcelain.apply(session.repository,
self.target,
force=True,
force_dependencies=self.reset_dependencies)
force=True)
impl = session.repository.rdp.get_implementation(node_ref.instance)
if impl.bl_reload_parent:
for parent in session.repository.graph.get_parents(self.target):
@ -614,6 +613,11 @@ class SessionApply(bpy.types.Operator):
porcelain.apply(session.repository,
parent.uuid,
force=True)
if hasattr(impl, 'bl_reload_child') and impl.bl_reload_child:
for dep in node_ref.dependencies:
porcelain.apply(session.repository,
dep,
force=True)
except Exception as e:
self.report({'ERROR'}, repr(e))
traceback.print_exc()

View File

@ -129,6 +129,11 @@ class ApplyTimer(Timer):
porcelain.apply(session.repository,
parent.uuid,
force=True)
if hasattr(impl, 'bl_reload_child') and impl.bl_reload_child:
for dep in node_ref.dependencies:
porcelain.apply(session.repository,
dep,
force=True)
class DynamicRightSelectTimer(Timer):