mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
move get_avalon_container to ayon_houdini.api.pipeline
This commit is contained in:
parent
928115f25a
commit
336d38b218
2 changed files with 20 additions and 23 deletions
|
|
@ -221,12 +221,8 @@ def containerise(name,
|
|||
|
||||
"""
|
||||
|
||||
# Ensure AVALON_CONTAINERS subnet exists
|
||||
subnet = hou.node(AVALON_CONTAINERS)
|
||||
if subnet is None:
|
||||
obj_network = hou.node("/obj")
|
||||
subnet = obj_network.createNode("subnet",
|
||||
node_name="AVALON_CONTAINERS")
|
||||
# Get AVALON_CONTAINERS subnet
|
||||
subnet = get_avalon_container()
|
||||
|
||||
# Create proper container name
|
||||
container_name = "{}_{}".format(name, suffix or "CON")
|
||||
|
|
@ -401,6 +397,23 @@ def on_new():
|
|||
_enforce_start_frame()
|
||||
|
||||
|
||||
def get_avalon_container():
|
||||
path = AVALON_CONTAINERS
|
||||
avalon_container = hou.node(path)
|
||||
if not avalon_container:
|
||||
# Let's create avalon container secretly
|
||||
# but make sure the pipeline still is built the
|
||||
# way we anticipate it was built, asserting it.
|
||||
assert path == "/obj/AVALON_CONTAINERS"
|
||||
|
||||
parent = hou.node("/obj")
|
||||
avalon_container = parent.createNode(
|
||||
"subnet", node_name="AVALON_CONTAINERS"
|
||||
)
|
||||
|
||||
return avalon_container
|
||||
|
||||
|
||||
def _set_context_settings():
|
||||
"""Apply the project settings from the project definition
|
||||
|
||||
|
|
|
|||
|
|
@ -12,22 +12,6 @@ from ayon_houdini.api import (
|
|||
plugin
|
||||
)
|
||||
|
||||
def get_avalon_container():
|
||||
path = pipeline.AVALON_CONTAINERS
|
||||
avalon_container = hou.node(path)
|
||||
if not avalon_container:
|
||||
# Let's create avalon container secretly
|
||||
# but make sure the pipeline still is built the
|
||||
# way we anticipate it was built, asserting it.
|
||||
assert path == "/obj/AVALON_CONTAINERS"
|
||||
|
||||
parent = hou.node("/obj")
|
||||
avalon_container = parent.createNode(
|
||||
"subnet", node_name="AVALON_CONTAINERS"
|
||||
)
|
||||
|
||||
return avalon_container
|
||||
|
||||
|
||||
class HdaLoader(plugin.HoudiniLoader):
|
||||
"""Load Houdini Digital Asset file."""
|
||||
|
|
@ -106,7 +90,7 @@ class HdaLoader(plugin.HoudiniLoader):
|
|||
def _create_dedicated_parent_node(self, hda_def):
|
||||
|
||||
# Get the root node
|
||||
parent_node = get_avalon_container()
|
||||
parent_node = pipeline.get_avalon_container()
|
||||
node = None
|
||||
node_type = None
|
||||
if hda_def.nodeTypeCategory() == hou.objNodeTypeCategory():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue