mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 06:12:19 +01:00
update blender creator
This commit is contained in:
parent
cb4dd2559b
commit
4f658d2f51
3 changed files with 14 additions and 4 deletions
|
|
@ -9,6 +9,7 @@ from openpype.pipeline import (
|
|||
Creator,
|
||||
CreatedInstance,
|
||||
LoaderPlugin,
|
||||
get_current_task_name,
|
||||
)
|
||||
from .pipeline import (
|
||||
AVALON_CONTAINERS,
|
||||
|
|
@ -235,11 +236,20 @@ class BlenderCreator(Creator):
|
|||
collection = bpy.data.collections.new(name=subset_name)
|
||||
bpy.context.scene.collection.children.link(collection)
|
||||
|
||||
collection["instance_node"] = instance_node = {
|
||||
collection[AVALON_PROPERTY] = instance_node = {
|
||||
"name": collection.name,
|
||||
}
|
||||
|
||||
instance_data["instance_node"] = instance_node
|
||||
instance_data.update(
|
||||
{
|
||||
"id": "pyblish.avalon.instance",
|
||||
"creator_identifier": self.identifier,
|
||||
"label": subset_name,
|
||||
"task": get_current_task_name(),
|
||||
"subset": subset_name,
|
||||
"instance_node": instance_node,
|
||||
}
|
||||
)
|
||||
|
||||
instance = CreatedInstance(
|
||||
self.family, subset_name, instance_data, self
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class CreateBlendScene(plugin.Creator):
|
|||
def create(
|
||||
self, subset_name: str, instance_data: dict, pre_create_data: dict
|
||||
):
|
||||
""" Run the creator on Blender main thread"""
|
||||
"""Run the creator on Blender main thread."""
|
||||
mti = ops.MainThreadItem(
|
||||
self._process, subset_name, instance_data, pre_create_data
|
||||
)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class CreateModel(plugin.BlenderCreator):
|
|||
def create(
|
||||
self, subset_name: str, instance_data: dict, pre_create_data: dict
|
||||
):
|
||||
""" Run the creator on Blender main thread"""
|
||||
"""Run the creator on Blender main thread."""
|
||||
self._add_instance_to_context(
|
||||
CreatedInstance(self.family, subset_name, instance_data, self)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue