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.
[Automated] Merged develop into main
- Loading branch information
Showing
53 changed files
with
2,171 additions
and
617 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
56 changes: 56 additions & 0 deletions
56
openpype/hosts/houdini/plugins/create/create_mantra_ifd.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,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() |
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
75 changes: 75 additions & 0 deletions
75
openpype/hosts/houdini/plugins/publish/collect_cache_farm.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,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 |
Oops, something went wrong.