mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
refactor get_avalon_container to get_or_create_avalon_container
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
This commit is contained in:
parent
336d38b218
commit
0ddfaa5b91
1 changed files with 9 additions and 14 deletions
|
|
@ -397,21 +397,16 @@ 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"
|
||||
def get_or_create_avalon_container() -> "hou.OpNode":
|
||||
avalon_container = hou.node(AVALON_CONTAINERS)
|
||||
if avalon_container:
|
||||
return avalon_container
|
||||
|
||||
parent = hou.node("/obj")
|
||||
avalon_container = parent.createNode(
|
||||
"subnet", node_name="AVALON_CONTAINERS"
|
||||
)
|
||||
|
||||
return avalon_container
|
||||
parent_path, name = AVALON_CONTAINERS.rsplit("/", 1)
|
||||
parent = hou.node(parent_path)
|
||||
return parent.createNode(
|
||||
"subnet", node_name=name
|
||||
)
|
||||
|
||||
|
||||
def _set_context_settings():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue