mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Collect instances functional
This commit is contained in:
parent
7617d1e0ad
commit
aeebd78cc7
9 changed files with 26 additions and 2 deletions
|
|
@ -262,10 +262,10 @@ class BlenderCreator(Creator):
|
|||
|
||||
for instance_data in cached_subsets.get(self.identifier, []):
|
||||
# Process only instances that were created by this creator
|
||||
data = dict()
|
||||
data = {}
|
||||
for key, value in instance_data.items():
|
||||
data[key] = value
|
||||
creator_id = instance_data.get('creator_identifier')
|
||||
creator_id = data.get('creator_identifier')
|
||||
|
||||
if creator_id == self.identifier:
|
||||
# Create instance object from existing data
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ class CreateAction(openpype.hosts.blender.api.plugin.BlenderCreator):
|
|||
collection = bpy.data.collections.new(name=name)
|
||||
bpy.context.scene.collection.children.link(collection)
|
||||
instance_data['task'] = get_current_task_name()
|
||||
instance_data['id'] = 'pyblish.avalon.instance'
|
||||
instance_data['creator_identifier'] = self.identifier
|
||||
instance_data['label'] = self.label
|
||||
lib.imprint(collection, instance_data)
|
||||
|
||||
if pre_create_data.get("useSelection"):
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ class CreateAnimation(plugin.BlenderCreator):
|
|||
asset_group = bpy.data.collections.new(name=name)
|
||||
instances.children.link(asset_group)
|
||||
instance_data['task'] = get_current_task_name()
|
||||
instance_data['id'] = 'pyblish.avalon.instance'
|
||||
instance_data['creator_identifier'] = self.identifier
|
||||
instance_data['label'] = self.label
|
||||
lib.imprint(asset_group, instance_data)
|
||||
|
||||
if pre_create_data.get("useSelection"):
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ class CreateCamera(plugin.BlenderCreator):
|
|||
asset_group.empty_display_type = 'SINGLE_ARROW'
|
||||
instances.objects.link(asset_group)
|
||||
instance_data['task'] = get_current_task_name()
|
||||
instance_data['id'] = 'pyblish.avalon.instance'
|
||||
instance_data['creator_identifier'] = self.identifier
|
||||
instance_data['label'] = self.label
|
||||
lib.imprint(asset_group, instance_data)
|
||||
|
||||
if pre_create_data.get("useSelection"):
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ class CreateLayout(plugin.BlenderCreator):
|
|||
asset_group.empty_display_type = 'SINGLE_ARROW'
|
||||
instances.objects.link(asset_group)
|
||||
instance_data['task'] = get_current_task_name()
|
||||
instance_data['id'] = 'pyblish.avalon.instance'
|
||||
instance_data['creator_identifier'] = self.identifier
|
||||
instance_data['label'] = self.label
|
||||
lib.imprint(asset_group, instance_data)
|
||||
|
||||
# Add selected objects to instance
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ class CreateModel(plugin.BlenderCreator):
|
|||
asset_group.empty_display_type = 'SINGLE_ARROW'
|
||||
instances.objects.link(asset_group)
|
||||
instance_data['task'] = get_current_task_name()
|
||||
instance_data['id'] = 'pyblish.avalon.instance'
|
||||
instance_data['creator_identifier'] = self.identifier
|
||||
instance_data['label'] = self.label
|
||||
lib.imprint(asset_group, instance_data)
|
||||
|
||||
# Add selected objects to instance
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ class CreatePointcache(plugin.BlenderCreator):
|
|||
collection = bpy.data.collections.new(name=name)
|
||||
bpy.context.scene.collection.children.link(collection)
|
||||
instance_data['task'] = get_current_task_name()
|
||||
instance_data['id'] = 'pyblish.avalon.instance'
|
||||
instance_data['creator_identifier'] = self.identifier
|
||||
instance_data['label'] = self.label
|
||||
lib.imprint(collection, instance_data)
|
||||
|
||||
if pre_create_data.get("useSelection"):
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ class CreateReview(plugin.BlenderCreator):
|
|||
asset_group = bpy.data.collections.new(name=name)
|
||||
instances.children.link(asset_group)
|
||||
instance_data['task'] = get_current_task_name()
|
||||
instance_data['id'] = 'pyblish.avalon.instance'
|
||||
instance_data['creator_identifier'] = self.identifier
|
||||
instance_data['label'] = self.label
|
||||
lib.imprint(asset_group, instance_data)
|
||||
|
||||
if pre_create_data.get("useSelection"):
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ class CreateRig(plugin.BlenderCreator):
|
|||
asset_group.empty_display_type = 'SINGLE_ARROW'
|
||||
instances.objects.link(asset_group)
|
||||
instance_data['task'] = get_current_task_name()
|
||||
instance_data['id'] = 'pyblish.avalon.instance'
|
||||
instance_data['creator_identifier'] = self.identifier
|
||||
instance_data['label'] = self.label
|
||||
lib.imprint(asset_group, instance_data)
|
||||
|
||||
# Add selected objects to instance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue