mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
modified sonar creator a little bit
This commit is contained in:
parent
b5fe082a59
commit
d16865d96f
1 changed files with 5 additions and 7 deletions
|
|
@ -9,26 +9,24 @@ from avalon.blender import Creator, lib
|
|||
class CreateModel(Creator):
|
||||
"""Polygonal static geometry"""
|
||||
|
||||
name = "model_default"
|
||||
name = "modelMain"
|
||||
label = "Model"
|
||||
family = "model"
|
||||
icon = "cube"
|
||||
|
||||
def process(self):
|
||||
import sonar.blender
|
||||
import pype.blender
|
||||
|
||||
asset = self.data["asset"]
|
||||
subset = self.data["subset"]
|
||||
name = sonar.blender.plugin.model_name(asset, subset)
|
||||
name = pype.blender.plugin.model_name(asset, subset)
|
||||
collection = bpy.data.collections.new(name=name)
|
||||
bpy.context.scene.collection.children.link(collection)
|
||||
self.data['task'] = api.Session.get('AVALON_TASK')
|
||||
lib.imprint(collection, self.data)
|
||||
|
||||
if (self.options or {}).get("useSelection"):
|
||||
for obj in bpy.context.selected_objects:
|
||||
for obj in lib.get_selection():
|
||||
collection.objects.link(obj)
|
||||
|
||||
if bpy.data.workspaces.get('Modeling'):
|
||||
bpy.context.window.workspace = bpy.data.workspaces['Modeling']
|
||||
|
||||
return collection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue