This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/OP-3420_Trigger-callback-on-workf…
…ile-open
- Loading branch information
Showing
31 changed files
with
394 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
openpype/hosts/houdini/plugins/create/create_redshift_proxy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from openpype.hosts.houdini.api import plugin | ||
|
||
|
||
class CreateRedshiftProxy(plugin.Creator): | ||
"""Redshift Proxy""" | ||
|
||
label = "Redshift Proxy" | ||
family = "redshiftproxy" | ||
icon = "magic" | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(CreateRedshiftProxy, self).__init__(*args, **kwargs) | ||
|
||
# Remove the active, we are checking the bypass flag of the nodes | ||
self.data.pop("active", None) | ||
|
||
# Redshift provides a `Redshift_Proxy_Output` node type which shows | ||
# a limited set of parameters by default and is set to extract a | ||
# Redshift Proxy. However when "imprinting" extra parameters needed | ||
# for OpenPype it starts showing all its parameters again. It's unclear | ||
# why this happens. | ||
# TODO: Somehow enforce so that it only shows the original limited | ||
# attributes of the Redshift_Proxy_Output node type | ||
self.data.update({"node_type": "Redshift_Proxy_Output"}) | ||
|
||
def _process(self, instance): | ||
"""Creator main entry point. | ||
Args: | ||
instance (hou.Node): Created Houdini instance. | ||
""" | ||
parms = { | ||
"RS_archive_file": '$HIP/pyblish/`chs("subset")`.$F4.rs', | ||
} | ||
|
||
if self.nodes: | ||
node = self.nodes[0] | ||
path = node.path() | ||
parms["RS_archive_sopPath"] = path | ||
|
||
instance.setParms(parms) | ||
|
||
# Lock some Avalon attributes | ||
to_lock = ["family", "id"] | ||
for name in to_lock: | ||
parm = instance.parm(name) | ||
parm.lock(True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
openpype/hosts/houdini/plugins/publish/extract_redshift_proxy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import os | ||
|
||
import pyblish.api | ||
import openpype.api | ||
from openpype.hosts.houdini.api.lib import render_rop | ||
|
||
|
||
class ExtractRedshiftProxy(openpype.api.Extractor): | ||
|
||
order = pyblish.api.ExtractorOrder + 0.1 | ||
label = "Extract Redshift Proxy" | ||
families = ["redshiftproxy"] | ||
hosts = ["houdini"] | ||
|
||
def process(self, instance): | ||
|
||
ropnode = instance[0] | ||
|
||
# Get the filename from the filename parameter | ||
# `.evalParm(parameter)` will make sure all tokens are resolved | ||
output = ropnode.evalParm("RS_archive_file") | ||
staging_dir = os.path.normpath(os.path.dirname(output)) | ||
instance.data["stagingDir"] = staging_dir | ||
file_name = os.path.basename(output) | ||
|
||
self.log.info("Writing Redshift Proxy '%s' to '%s'" % (file_name, | ||
staging_dir)) | ||
|
||
render_rop(ropnode) | ||
|
||
output = instance.data["frames"] | ||
|
||
if "representations" not in instance.data: | ||
instance.data["representations"] = [] | ||
|
||
representation = { | ||
"name": "rs", | ||
"ext": "rs", | ||
"files": output, | ||
"stagingDir": staging_dir, | ||
} | ||
|
||
# A single frame may also be rendered without start/end frame. | ||
if "frameStart" in instance.data and "frameEnd" in instance.data: | ||
representation["frameStart"] = instance.data["frameStart"] | ||
representation["frameEnd"] = instance.data["frameEnd"] | ||
|
||
instance.data["representations"].append(representation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.