mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Fix replacement, and do not add new instance in context twice
This commit is contained in:
parent
56fd07a784
commit
6e812e0079
1 changed files with 8 additions and 7 deletions
|
|
@ -218,14 +218,15 @@ class AbstractCollectRender(pyblish.api.ContextPlugin):
|
|||
data = self.add_additional_data(data)
|
||||
render_instance_dict = attr.asdict(render_instance)
|
||||
|
||||
instance = pyblish.api.Instance(render_instance.name,
|
||||
parent=context)
|
||||
instance = context.create_instance(render_instance.name)
|
||||
if render_instance.source_instance is not None:
|
||||
replace_instance_in_context(context,
|
||||
render_instance.source_instance,
|
||||
instance)
|
||||
else:
|
||||
context.append(instance)
|
||||
# remove the new instance, because we want to insert it
|
||||
# at the position of the original instance
|
||||
context.pop()
|
||||
replace_instance_in_context(
|
||||
context,
|
||||
source_instance=render_instance.source_instance,
|
||||
destination_instance=instance)
|
||||
|
||||
instance.data.update(render_instance_dict)
|
||||
instance.data.update(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue