Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating more product types as USD with USD contribution workflow and better defaults. #144

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from
Draft
3 changes: 3 additions & 0 deletions client/ayon_houdini/plugins/create/create_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ 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()

def get_publish_families(self):
return ["model", "abc"]
83 changes: 83 additions & 0 deletions client/ayon_houdini/plugins/create/create_usd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
"""Creator plugin for creating USDs."""
import inspect

from ayon_houdini.api import plugin

import hou
Expand All @@ -14,6 +16,8 @@ class CreateUSD(plugin.HoudiniCreator):
enabled = False
description = "Create USD"

additional_parameters = {}

def create(self, product_name, instance_data, pre_create_data):

instance_data.update({"node_type": "usd"})
Expand All @@ -29,6 +33,7 @@ def create(self, product_name, instance_data, pre_create_data):
"lopoutput": "$HIP/pyblish/{}.usd".format(product_name),
"enableoutputprocessor_simplerelativepaths": False,
}
parms.update(self.additional_parameters)

if self.selected_nodes:
parms["loppath"] = self.selected_nodes[0].path()
Expand All @@ -52,3 +57,81 @@ def get_network_categories(self):

def get_publish_families(self):
return ["usd", "usdrop"]


class CreateUSDModel(CreateUSD):
identifier = "io.openpype.creators.houdini.model.usd"
label = "USD Model"
product_type = "model"
enabled = True
description = "Create USD model"

additional_parameters = {
# Set the 'default prim' by default to the folder name being
# published to
"defaultprim": '/`strsplit(chs("folderPath"), "/", -1)`',
}

def get_detail_description(self):
return inspect.cleandoc("""Publish model in USD data.

From the Houdini Solaris context (LOPs) this will publish a static
model. Usually used for publishing geometry into a USD asset using
the USD contribution workflow.

""")


class CreateUSDGroom(CreateUSD):
identifier = "io.openpype.creators.houdini.groom.usd"
BigRoy marked this conversation as resolved.
Show resolved Hide resolved
label = "USD Groom"
product_type = "groom"
icon = "scissors"
enabled = True
description = "Create USD groom of fur and or hairs"

additional_parameters = {
# Set the 'default prim' by default to the folder name being
# published to
"defaultprim": '/`strsplit(chs("folderPath"), "/", -1)`',
}

def get_detail_description(self):
return inspect.cleandoc("""Publish groom in USD data.

From the Houdini Solaris context (LOPs) this will usually publish the
static groom of fur and or hairs. Usually used to define the base
groom for a character and then used in the `look` to build the final
materials.
""")


class CreateUSDLook(CreateUSD):
"""Universal Scene Description Look"""

identifier = "io.openpype.creators.houdini.usd.look"
iLLiCiTiT marked this conversation as resolved.
Show resolved Hide resolved
label = "USD Look"
product_type = "look"
icon = "paint-brush"
enabled = True
description = "Create USD Look with localized textures"

additional_parameters = {
# Set the 'default prim' by default to the folder name being
# published to
"defaultprim": '/`strsplit(chs("folderPath"), "/", -1)`',
}

def get_detail_description(self):
return inspect.cleandoc("""Publish looks in USD data.

From the Houdini Solaris context (LOPs) this will publish the look for
an asset as a USD file with the used textures.

Any assets used by the look will be relatively remapped to the USD
file and integrated into the publish as `resources`.

""")

def get_publish_families(self):
return ["usd", "look", "usdrop"]
72 changes: 0 additions & 72 deletions client/ayon_houdini/plugins/create/create_usd_look.py

This file was deleted.

4 changes: 2 additions & 2 deletions client/ayon_houdini/plugins/publish/collect_cache_farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class CollectDataforCache(plugin.HoudiniInstancePlugin):
label = "Collect Data for Cache"

def process(self, instance):
creator_attribute = instance.data["creator_attributes"]
farm_enabled = creator_attribute["farm"]
creator_attributes = instance.data["creator_attributes"]
farm_enabled = creator_attributes.get("farm", False)
instance.data["farm"] = farm_enabled
if not farm_enabled:
self.log.debug("Caching on farm is disabled. "
Expand Down
3 changes: 3 additions & 0 deletions client/ayon_houdini/plugins/publish/collect_task_handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class CollectAssetHandles(plugin.HoudiniInstancePlugin,
Then we will retrieve the task's handles to compute
the exclusive frame range and actual handle ranges.
"""
# TODO: This also validates against model products, even though those
# should export a single frame regardless so maybe it's redundantly
# validating?

# This specific order value is used so that
# this plugin runs after CollectAnatomyInstanceData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ValidateSopOutputNode(plugin.HoudiniInstancePlugin):
"""

order = pyblish.api.ValidatorOrder
families = ["pointcache", "vdbcache", "model"]
families = ["pointcache", "vdbcache", "abc"]
label = "Validate Output Node (SOP)"
actions = [SelectROPAction, SelectInvalidAction]

Expand Down