Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
[Automated] Merged develop into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ynbot authored Nov 25, 2023
2 parents a4225a2 + a063988 commit 04e6f72
Show file tree
Hide file tree
Showing 53 changed files with 2,171 additions and 617 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ body:
label: Version
description: What version are you running? Look to OpenPype Tray
options:
- 3.17.7-nightly.2
- 3.17.7-nightly.1
- 3.17.6
- 3.17.6-nightly.3
Expand Down Expand Up @@ -134,7 +135,6 @@ body:
- 3.15.2-nightly.5
- 3.15.2-nightly.4
- 3.15.2-nightly.3
- 3.15.2-nightly.2
validations:
required: true
- type: dropdown
Expand Down
4 changes: 3 additions & 1 deletion openpype/hosts/houdini/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def get_output_parameter(node):
return node.parm("ar_ass_file")
elif node_type == "Redshift_Proxy_Output":
return node.parm("RS_archive_file")

elif node_type == "ifd":
if node.evalParm("soho_outputmode"):
return node.parm("soho_diskfile")
raise TypeError("Node type '%s' not supported" % node_type)


Expand Down
4 changes: 0 additions & 4 deletions openpype/hosts/houdini/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ def install(self):
register_event_callback("new", on_new)

self._has_been_setup = True
# add houdini vendor packages
hou_pythonpath = os.path.join(HOUDINI_HOST_DIR, "vendor")

sys.path.append(hou_pythonpath)

# Set asset settings for the empty scene directly after launch of
# Houdini so it initializes into the correct scene FPS,
Expand Down
16 changes: 16 additions & 0 deletions openpype/hosts/houdini/plugins/create/create_arnold_ass.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
"""Creator plugin for creating Arnold ASS files."""
from openpype.hosts.houdini.api import plugin
from openpype.lib import BoolDef


class CreateArnoldAss(plugin.HoudiniCreator):
Expand All @@ -21,6 +22,9 @@ def create(self, subset_name, instance_data, pre_create_data):

instance_data.pop("active", None)
instance_data.update({"node_type": "arnold"})
creator_attributes = instance_data.setdefault(
"creator_attributes", dict())
creator_attributes["farm"] = pre_create_data["farm"]

instance = super(CreateArnoldAss, self).create(
subset_name,
Expand Down Expand Up @@ -52,3 +56,15 @@ def create(self, subset_name, instance_data, pre_create_data):
# Lock any parameters in this list
to_lock = ["ar_ass_export_enable", "family", "id"]
self.lock_parameters(instance_node, to_lock)

def get_instance_attr_defs(self):
return [
BoolDef("farm",
label="Submitting to Farm",
default=False)
]

def get_pre_create_attr_defs(self):
attrs = super().get_pre_create_attr_defs()
# Use same attributes as for instance attributes
return attrs + self.get_instance_attr_defs()
14 changes: 12 additions & 2 deletions openpype/hosts/houdini/plugins/create/create_bgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"""Creator plugin for creating pointcache bgeo files."""
from openpype.hosts.houdini.api import plugin
from openpype.pipeline import CreatedInstance, CreatorError
from openpype.lib import EnumDef
import hou
from openpype.lib import EnumDef, BoolDef


class CreateBGEO(plugin.HoudiniCreator):
Expand All @@ -18,6 +18,9 @@ def create(self, subset_name, instance_data, pre_create_data):
instance_data.pop("active", None)

instance_data.update({"node_type": "geometry"})
creator_attributes = instance_data.setdefault(
"creator_attributes", dict())
creator_attributes["farm"] = pre_create_data["farm"]

instance = super(CreateBGEO, self).create(
subset_name,
Expand Down Expand Up @@ -58,6 +61,13 @@ def create(self, subset_name, instance_data, pre_create_data):

instance_node.setParms(parms)

def get_instance_attr_defs(self):
return [
BoolDef("farm",
label="Submitting to Farm",
default=False)
]

def get_pre_create_attr_defs(self):
attrs = super().get_pre_create_attr_defs()
bgeo_enum = [
Expand Down Expand Up @@ -89,7 +99,7 @@ def get_pre_create_attr_defs(self):

return attrs + [
EnumDef("bgeo_type", bgeo_enum, label="BGEO Options"),
]
] + self.get_instance_attr_defs()

def get_network_categories(self):
return [
Expand Down
56 changes: 56 additions & 0 deletions openpype/hosts/houdini/plugins/create/create_mantra_ifd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
"""Creator plugin for creating pointcache alembics."""
from openpype.hosts.houdini.api import plugin
from openpype.pipeline import CreatedInstance
from openpype.lib import BoolDef


class CreateMantraIFD(plugin.HoudiniCreator):
"""Mantra .ifd Archive"""
identifier = "io.openpype.creators.houdini.mantraifd"
label = "Mantra IFD"
family = "mantraifd"
icon = "gears"

def create(self, subset_name, instance_data, pre_create_data):
import hou
instance_data.pop("active", None)
instance_data.update({"node_type": "ifd"})
creator_attributes = instance_data.setdefault(
"creator_attributes", dict())
creator_attributes["farm"] = pre_create_data["farm"]
instance = super(CreateMantraIFD, self).create(
subset_name,
instance_data,
pre_create_data) # type: CreatedInstance

instance_node = hou.node(instance.get("instance_node"))

filepath = "{}{}".format(
hou.text.expandString("$HIP/pyblish/"),
"{}.$F4.ifd".format(subset_name))
parms = {
# Render frame range
"trange": 1,
# Arnold ROP settings
"soho_diskfile": filepath,
"soho_outputmode": 1
}

instance_node.setParms(parms)

# Lock any parameters in this list
to_lock = ["soho_outputmode", "family", "id"]
self.lock_parameters(instance_node, to_lock)

def get_instance_attr_defs(self):
return [
BoolDef("farm",
label="Submitting to Farm",
default=False)
]

def get_pre_create_attr_defs(self):
attrs = super().get_pre_create_attr_defs()
# Use same attributes as for instance attributes
return attrs + self.get_instance_attr_defs()
17 changes: 17 additions & 0 deletions openpype/hosts/houdini/plugins/create/create_pointcache.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
"""Creator plugin for creating pointcache alembics."""
from openpype.hosts.houdini.api import plugin
from openpype.lib import BoolDef

import hou



class CreatePointCache(plugin.HoudiniCreator):
"""Alembic ROP to pointcache"""
identifier = "io.openpype.creators.houdini.pointcache"
Expand All @@ -15,6 +17,9 @@ class CreatePointCache(plugin.HoudiniCreator):
def create(self, subset_name, instance_data, pre_create_data):
instance_data.pop("active", None)
instance_data.update({"node_type": "alembic"})
creator_attributes = instance_data.setdefault(
"creator_attributes", dict())
creator_attributes["farm"] = pre_create_data["farm"]

instance = super(CreatePointCache, self).create(
subset_name,
Expand Down Expand Up @@ -105,3 +110,15 @@ def get_obj_output(self, obj_node):
else:
return min(outputs,
key=lambda node: node.evalParm('outputidx'))

def get_instance_attr_defs(self):
return [
BoolDef("farm",
label="Submitting to Farm",
default=False)
]

def get_pre_create_attr_defs(self):
attrs = super().get_pre_create_attr_defs()
# Use same attributes as for instance attributes
return attrs + self.get_instance_attr_defs()
16 changes: 16 additions & 0 deletions openpype/hosts/houdini/plugins/create/create_redshift_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Creator plugin for creating Redshift proxies."""
from openpype.hosts.houdini.api import plugin
import hou
from openpype.lib import BoolDef


class CreateRedshiftProxy(plugin.HoudiniCreator):
Expand All @@ -24,6 +25,9 @@ def create(self, subset_name, instance_data, pre_create_data):
# TODO: Somehow enforce so that it only shows the original limited
# attributes of the Redshift_Proxy_Output node type
instance_data.update({"node_type": "Redshift_Proxy_Output"})
creator_attributes = instance_data.setdefault(
"creator_attributes", dict())
creator_attributes["farm"] = pre_create_data["farm"]

instance = super(CreateRedshiftProxy, self).create(
subset_name,
Expand All @@ -50,3 +54,15 @@ def get_network_categories(self):
hou.ropNodeTypeCategory(),
hou.sopNodeTypeCategory()
]

def get_instance_attr_defs(self):
return [
BoolDef("farm",
label="Submitting to Farm",
default=False)
]

def get_pre_create_attr_defs(self):
attrs = super().get_pre_create_attr_defs()
# Use same attributes as for instance attributes
return attrs + self.get_instance_attr_defs()
22 changes: 20 additions & 2 deletions openpype/hosts/houdini/plugins/create/create_vbd_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Creator plugin for creating VDB Caches."""
from openpype.hosts.houdini.api import plugin
from openpype.pipeline import CreatedInstance
from openpype.lib import BoolDef

import hou

Expand All @@ -19,15 +20,20 @@ def create(self, subset_name, instance_data, pre_create_data):

instance_data.pop("active", None)
instance_data.update({"node_type": "geometry"})

creator_attributes = instance_data.setdefault(
"creator_attributes", dict())
creator_attributes["farm"] = pre_create_data["farm"]
instance = super(CreateVDBCache, self).create(
subset_name,
instance_data,
pre_create_data) # type: CreatedInstance

instance_node = hou.node(instance.get("instance_node"))
file_path = "{}{}".format(
hou.text.expandString("$HIP/pyblish/"),
"{}.$F4.vdb".format(subset_name))
parms = {
"sopoutput": "$HIP/pyblish/{}.$F4.vdb".format(subset_name),
"sopoutput": file_path,
"initsim": True,
"trange": 1
}
Expand Down Expand Up @@ -103,3 +109,15 @@ def get_obj_output(self, obj_node):
else:
return min(outputs,
key=lambda node: node.evalParm('outputidx'))

def get_instance_attr_defs(self):
return [
BoolDef("farm",
label="Submitting to Farm",
default=False)
]

def get_pre_create_attr_defs(self):
attrs = super().get_pre_create_attr_defs()
# Use same attributes as for instance attributes
return attrs + self.get_instance_attr_defs()
75 changes: 75 additions & 0 deletions openpype/hosts/houdini/plugins/publish/collect_cache_farm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import os
import pyblish.api
import hou
from openpype.hosts.houdini.api import lib


class CollectDataforCache(pyblish.api.InstancePlugin):
"""Collect data for caching to Deadline."""

order = pyblish.api.CollectorOrder + 0.04
families = ["ass", "pointcache",
"mantraifd", "redshiftproxy",
"vdbcache"]
hosts = ["houdini"]
targets = ["local", "remote"]
label = "Collect Data for Cache"

def process(self, instance):
creator_attribute = instance.data["creator_attributes"]
farm_enabled = creator_attribute["farm"]
instance.data["farm"] = farm_enabled
if not farm_enabled:
self.log.debug("Caching on farm is disabled. "
"Skipping farm collecting.")
return
# Why do we need this particular collector to collect the expected
# output files from a ROP node. Don't we have a dedicated collector
# for that yet?
# Collect expected files
ropnode = hou.node(instance.data["instance_node"])
output_parm = lib.get_output_parameter(ropnode)
expected_filepath = output_parm.eval()
instance.data.setdefault("files", list())
instance.data.setdefault("expectedFiles", list())
if instance.data.get("frames"):
files = self.get_files(instance, expected_filepath)
# list of files
instance.data["files"].extend(files)
else:
# single file
instance.data["files"].append(output_parm.eval())
cache_files = {"_": instance.data["files"]}
# Convert instance family to pointcache if it is bgeo or abc
# because ???
for family in instance.data["families"]:
if family == "bgeo" or "abc":
instance.data["family"] = "pointcache"
break
instance.data.update({
"plugin": "Houdini",
"publish": True
})
instance.data["families"].append("publish.hou")
instance.data["expectedFiles"].append(cache_files)

self.log.debug("{}".format(instance.data))

def get_files(self, instance, output_parm):
"""Get the files with the frame range data
Args:
instance (_type_): instance
output_parm (_type_): path of output parameter
Returns:
files: a list of files
"""
directory = os.path.dirname(output_parm)

files = [
os.path.join(directory, frame).replace("\\", "/")
for frame in instance.data["frames"]
]

return files
Loading

0 comments on commit 04e6f72

Please sign in to comment.