mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
hound cleanup 🐶🧽🧺 IV.
This commit is contained in:
parent
6d2563fa5c
commit
64f9f43f5e
3 changed files with 18 additions and 19 deletions
|
|
@ -42,6 +42,7 @@ def pick_asset(node):
|
||||||
name = parm.eval()
|
name = parm.eval()
|
||||||
if name:
|
if name:
|
||||||
from avalon import io
|
from avalon import io
|
||||||
|
|
||||||
db_asset = io.find_one({"name": name, "type": "asset"})
|
db_asset = io.find_one({"name": name, "type": "asset"})
|
||||||
if db_asset:
|
if db_asset:
|
||||||
silo = db_asset.get("silo")
|
silo = db_asset.get("silo")
|
||||||
|
|
@ -74,11 +75,13 @@ def add_usd_output_processor(ropnode, processor):
|
||||||
|
|
||||||
import loputils
|
import loputils
|
||||||
|
|
||||||
loputils.handleOutputProcessorAdd({
|
loputils.handleOutputProcessorAdd(
|
||||||
"node": ropnode,
|
{
|
||||||
"parm": ropnode.parm("outputprocessors"),
|
"node": ropnode,
|
||||||
"script_value": processor
|
"parm": ropnode.parm("outputprocessors"),
|
||||||
})
|
"script_value": processor,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def remove_usd_output_processor(ropnode, processor):
|
def remove_usd_output_processor(ropnode, processor):
|
||||||
|
|
@ -94,19 +97,16 @@ def remove_usd_output_processor(ropnode, processor):
|
||||||
|
|
||||||
parm = ropnode.parm(processor + "_remove")
|
parm = ropnode.parm(processor + "_remove")
|
||||||
if not parm:
|
if not parm:
|
||||||
raise RuntimeError("Output Processor %s does not "
|
raise RuntimeError(
|
||||||
"exist on %s" % (processor, ropnode.name()))
|
"Output Processor %s does not "
|
||||||
|
"exist on %s" % (processor, ropnode.name())
|
||||||
|
)
|
||||||
|
|
||||||
loputils.handleOutputProcessorRemove({
|
loputils.handleOutputProcessorRemove({"node": ropnode, "parm": parm})
|
||||||
"node": ropnode,
|
|
||||||
"parm": parm
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def outputprocessors(ropnode,
|
def outputprocessors(ropnode, processors=tuple(), disable_all_others=True):
|
||||||
processors=tuple(),
|
|
||||||
disable_all_others=True):
|
|
||||||
"""Context manager to temporarily add Output Processors to USD ROP node.
|
"""Context manager to temporarily add Output Processors to USD ROP node.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
@ -240,8 +240,9 @@ def get_configured_save_layers(usd_rop):
|
||||||
lop_node = get_usd_rop_loppath(usd_rop)
|
lop_node = get_usd_rop_loppath(usd_rop)
|
||||||
stage = lop_node.stage(apply_viewport_overrides=False)
|
stage = lop_node.stage(apply_viewport_overrides=False)
|
||||||
if not stage:
|
if not stage:
|
||||||
raise RuntimeError("No valid USD stage for ROP node: "
|
raise RuntimeError(
|
||||||
"%s" % usd_rop.path())
|
"No valid USD stage for ROP node: " "%s" % usd_rop.path()
|
||||||
|
)
|
||||||
|
|
||||||
root_layer = stage.GetRootLayer()
|
root_layer = stage.GetRootLayer()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ class ExitStack(object):
|
||||||
if cb(*exc_details):
|
if cb(*exc_details):
|
||||||
suppressed_exc = True
|
suppressed_exc = True
|
||||||
exc_details = (None, None, None)
|
exc_details = (None, None, None)
|
||||||
except:
|
except Exception:
|
||||||
new_exc_details = sys.exc_info()
|
new_exc_details = sys.exc_info()
|
||||||
# simulate the stack of exceptions by setting the context
|
# simulate the stack of exceptions by setting the context
|
||||||
_fix_exception_context(new_exc_details[1], exc_details[1])
|
_fix_exception_context(new_exc_details[1], exc_details[1])
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import re
|
|
||||||
|
|
||||||
import pyblish.api
|
import pyblish.api
|
||||||
import openpype.api
|
import openpype.api
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue