Skip to content

Commit

Permalink
Merge pull request #5 from nfa-vfxim/feature/issue-1/update-to-render…
Browse files Browse the repository at this point in the history
…man-25

Update LOP context RenderMan to 25.2
  • Loading branch information
MaximumFX committed Dec 12, 2023
2 parents 2b6e7a1 + 93820f9 commit da7dc48
Show file tree
Hide file tree
Showing 16 changed files with 2,260 additions and 988 deletions.
29 changes: 16 additions & 13 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,21 @@ def init_app(self):
"and try again."
)

def execute_render(self, node: hou.Node, network: str):
def execute_render(self, node: hou.Node):
"""Start farm render
Args:
node (hou.Node): RenderMan node
network (str): Network type
"""
self.handler.execute_render(node, network)
self.handler.execute_render(node)

def submit_to_farm(self, node: hou.Node, network: str):
def submit_to_farm(self, node: hou.Node):
"""Start local render
Args:
node (hou.Node): RenderMan node
network (str): Network type
"""
self.handler.submit_to_farm(node, network)
self.handler.submit_to_farm(node)

def copy_to_clipboard(self, node, network=None):
"""Copy render path to clipboard
Expand All @@ -80,10 +78,7 @@ def copy_to_clipboard(self, node, network=None):
@staticmethod
def get_all_renderman_nodes() -> tuple[Node]:
"""Get all nodes from node type sgtk_hdprman"""
lop_nodes = hou.lopNodeTypeCategory().nodeType("sgtk_hdprman").instances()
rop_nodes = hou.ropNodeTypeCategory().nodeType("sgtk_ris").instances()
nodes = lop_nodes + rop_nodes
return nodes
return hou.ropNodeTypeCategory().nodeType("sgtk_ris").instances()

def get_output_path(
self, node: hou.Node, aov_name: str, network: str = "rop"
Expand All @@ -107,14 +102,22 @@ def validate_node(self, node: hou.Node, network: str) -> str:
"""
return self.handler.validate_node(node, network)

def setup_aovs(self, node: hou.Node, show_notif: bool = True) -> bool:
def setup_light_groups(self, node: hou.Node) -> bool:
"""Setup light groups on the light nodes
Args:
node (hou.Node): RenderMan node
"""
return self.handler.setup_light_groups(node)

def setup_aovs(self, node: hou.Node, show_notification: bool = True) -> bool:
"""Setup outputs on the RenderMan node with correct aovs
Args:
node (hou.Node): RenderMan node
show_notif (bool): Show notification when successfully set up AOVs
show_notification (bool): Show notification when successfully set up AOVs
"""
return self.handler.setup_aovs(node, show_notif)
return self.handler.setup_aovs(node, show_notification)

def get_output_paths(self, node: hou.Node) -> list[str]:
"""Get output paths for the RenderMan node
Expand Down
3 changes: 2 additions & 1 deletion info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ configuration:
items:
key: { type: str }
type: { type: str }
# value: { type: str }
expression: { type: str }
group: { type: str, allows_empty: True }
group: { type: str }

post_task_script:
type: str
Expand Down
18 changes: 13 additions & 5 deletions otls/PythonModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,35 @@ def render(node: hou.Node, on_farm: bool = False):
return

if on_farm:
app.submit_to_farm(node, "rop")
app.submit_to_farm(node)
else:
app.execute_render(node, "rop")
app.execute_render(node)


def copy_to_clipboard(node: hou.Node):
import sgtk

eng = sgtk.platform.current_engine()
app = eng.apps["tk-houdini-renderman"]
app.copy_to_clipboard(node.node("render"), "rop")
app.copy_to_clipboard(node.node("render"))

hou.ui.displayMessage("Copied path to clipboard.")


def setup_aovs(node: hou.Node, show_notif: bool = True) -> bool:
def setup_light_groups(node: hou.Node) -> bool:
import sgtk

eng = sgtk.platform.current_engine()
app = eng.apps["tk-houdini-renderman"]
return app.setup_aovs(node, show_notif)
return app.setup_light_groups(node)


def setup_aovs(node: hou.Node, show_notification: bool = True) -> bool:
import sgtk

eng = sgtk.platform.current_engine()
app = eng.apps["tk-houdini-renderman"]
return app.setup_aovs(node, show_notification)


def get_output_paths(node: hou.Node):
Expand Down
Loading

0 comments on commit da7dc48

Please sign in to comment.