Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Load Shot LOP and Mute Layers LOP #56

Merged
merged 20 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions client/ayon_houdini/plugins/load/load_shot_lop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from ayon_core.pipeline import load
from ayon_houdini.api.lib import find_active_network

import hou


class LOPLoadShotLoader(load.LoaderPlugin):
"""Load sublayer into Solaris using AYON Load Shot LOP"""

product_types = {"*"}
label = "Load Shot (LOPs)"
representations = ["usd", "abc", "usda", "usdc"]
order = -10
icon = "code-fork"
color = "orange"

def load(self, context, name=None, namespace=None, data=None):

# Define node name
namespace = namespace if namespace else context["folder"]["name"]
node_name = "{}_{}".format(namespace, name) if namespace else name

# Create node
network = find_active_network(
category=hou.lopNodeTypeCategory(),
default="/stage"
)
node = network.createNode("ayon::load_shot", node_name=node_name)
node.moveToGoodPosition()

# Set representation id
parm = node.parm("representation")
parm.set(context["representation"]["id"])
parm.pressButton() # trigger callbacks

nodes = [node]
self[:] = nodes

def update(self, container, context):
node = container["node"]

# Set representation id
parm = node.parm("representation")
parm.set(context["representation"]["id"])
parm.pressButton() # trigger callbacks

def remove(self, container):
node = container["node"]
node.destroy()

def switch(self, container, context):
self.update(container, context)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Operator: ayon::load_shot::1.0
Label: AYON Load Shot
Path: oplib:/ayon::Lop/load_shot::1.0?ayon::Lop/load_shot::1.0
Icon: opdef:/ayon::Lop/load_shot::1.0?IconImage
Table: Lop
License:
Extra:
User:
Inputs: 0 to 1
Subnet: true
Python: false
Empty: false
Modified: Thu Jul 4 00:43:25 2024

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
""
INDEX__SECTION INDEX_SECTION
houdini.hdalibrary houdini.hdalibrary
ayon_8_8Lop_1load__shot_8_81.0 ayon::Lop/load_shot::1.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hdaroot/sublayer.def":1720045839,
"hdaroot/warn_no_representation_set.def":1708980551,
"hdaroot/output0.def":1698215383,
"hdaroot.def":1720046536
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"values":["20.0.724"
],
"indexes":{
"hdaroot/sublayer.userdata":0,
"hdaroot/warn_no_representation_set.userdata":0,
"hdaroot/output0.userdata":0
}
}
Loading