mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
convert filmboxfbx to UE static mesh
This commit is contained in:
parent
c04a709906
commit
e181eeab93
10 changed files with 94 additions and 27 deletions
|
|
@ -20,17 +20,18 @@ from openpype.lib import EnumDef
|
|||
import hou
|
||||
|
||||
|
||||
class CreateFilmboxFBX(plugin.HoudiniCreator):
|
||||
class HouCreateUnrealStaticMesh(plugin.HoudiniCreator):
|
||||
"""Filmbox FBX Driver."""
|
||||
|
||||
# you should set
|
||||
identifier = "io.openpype.creators.houdini.filmboxfbx"
|
||||
label = "Filmbox FBX"
|
||||
family = "filmboxfbx"
|
||||
identifier = "io.openpype.creators.houdini.unrealstaticmesh"
|
||||
label = "Unreal - Static Mesh"
|
||||
family = "staticMesh"
|
||||
icon = "fa5s.cubes"
|
||||
|
||||
# optional to set
|
||||
default_variant = "Main"
|
||||
# 'default_variants' will be overriden by settings.
|
||||
default_variants = ["Main", "Test"]
|
||||
|
||||
# Overrides HoudiniCreator.create()
|
||||
|
|
@ -40,7 +41,7 @@ class CreateFilmboxFBX(plugin.HoudiniCreator):
|
|||
instance_data.update({"node_type": "filmboxfbx"})
|
||||
|
||||
# create instance (calls HoudiniCreator.create())
|
||||
instance = super(CreateFilmboxFBX, self).create(
|
||||
instance = super(HouCreateUnrealStaticMesh, self).create(
|
||||
subset_name,
|
||||
instance_data,
|
||||
pre_create_data)
|
||||
|
|
@ -77,15 +78,8 @@ class CreateFilmboxFBX(plugin.HoudiniCreator):
|
|||
},
|
||||
default=0,
|
||||
label="Vertex Cache Format")
|
||||
trange = EnumDef("trange",
|
||||
items={
|
||||
0: "Render Current Frame",
|
||||
1: "Render Frame Range"
|
||||
},
|
||||
default=0,
|
||||
label="Valid Frame Range")
|
||||
|
||||
return attrs + [vcformat, trange]
|
||||
return attrs + [vcformat]
|
||||
|
||||
def get_parms(self, subset_name, pre_create_data):
|
||||
"""Get parameters values for this specific node."""
|
||||
|
|
@ -100,8 +94,9 @@ class CreateFilmboxFBX(plugin.HoudiniCreator):
|
|||
# 3. get Vertex Cache Format
|
||||
vcformat = pre_create_data.get("vcformat")
|
||||
|
||||
# 4. get Valid Frame Range
|
||||
trange = pre_create_data.get("trange")
|
||||
# 4. Valid Frame Range
|
||||
# It should publish the current frame.
|
||||
trange = 0
|
||||
|
||||
# parms dictionary
|
||||
parms = {
|
||||
|
|
@ -20,7 +20,7 @@ class FbxLoader(load.LoaderPlugin):
|
|||
"""Load fbx files to Houdini."""
|
||||
|
||||
label = "Load FBX"
|
||||
families = ["filmboxfbx", "fbx"]
|
||||
families = ["staticMesh", "fbx"]
|
||||
representations = ["fbx"]
|
||||
|
||||
# Usually you will use these value as default
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ import pyblish.api
|
|||
|
||||
|
||||
class CollectFilmboxfbxType(pyblish.api.InstancePlugin):
|
||||
"""Collect data type for filmboxfbx instance."""
|
||||
"""Collect data type for fbx instance."""
|
||||
|
||||
hosts = ["houdini"]
|
||||
families = ["filmboxfbx"]
|
||||
label = "Collect type of filmboxfbx"
|
||||
families = ["fbx", "staticMesh"]
|
||||
label = "Collect type of fbx"
|
||||
|
||||
# Usually you will use this value as default
|
||||
order = pyblish.api.CollectorOrder
|
||||
|
|
@ -25,12 +25,12 @@ class CollectFilmboxfbxType(pyblish.api.InstancePlugin):
|
|||
# overrides InstancePlugin.process()
|
||||
def process(self, instance):
|
||||
|
||||
if instance.data["creator_identifier"] == "io.openpype.creators.houdini.filmboxfbx": # noqa: E501
|
||||
if instance.data["creator_identifier"] == "io.openpype.creators.houdini.unrealstaticmesh": # noqa: E501
|
||||
# such a condition can be used to differentiate between
|
||||
# instances by identifier becuase sometimes instances
|
||||
# may have the same family but different identifier
|
||||
# e.g. bgeo and alembic
|
||||
pass
|
||||
instance.data["families"] += ["fbx"]
|
||||
|
||||
# Update instance.data with ouptut_node
|
||||
out_node = self.get_output_node(instance)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ import hou
|
|||
|
||||
class ExtractRedshiftProxy(publish.Extractor):
|
||||
|
||||
label = "Extract FilmBox FBX"
|
||||
families = ["filmboxfbx"]
|
||||
label = "Extract FBX"
|
||||
families = ["fbx"]
|
||||
hosts = ["houdini"]
|
||||
|
||||
# Usually you will use this value as default
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class ValidateFBXPrimitiveHierarchyPaths(pyblish.api.InstancePlugin,
|
|||
by default.
|
||||
"""
|
||||
|
||||
families = ["filmboxfbx"]
|
||||
families = ["fbx"]
|
||||
hosts = ["houdini"]
|
||||
label = "Validate Prims Hierarchy Path (FBX)"
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class ValidateSopOutputNode(pyblish.api.InstancePlugin):
|
|||
"""
|
||||
|
||||
order = pyblish.api.ValidatorOrder
|
||||
families = ["pointcache", "vdbcache", "filmboxfbx"]
|
||||
families = ["pointcache", "vdbcache", "fbx"]
|
||||
hosts = ["houdini"]
|
||||
label = "Validate Output Node"
|
||||
actions = [SelectROPAction, SelectInvalidAction]
|
||||
|
|
|
|||
|
|
@ -139,8 +139,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
|||
"simpleUnrealTexture",
|
||||
"online",
|
||||
"uasset",
|
||||
"blendScene",
|
||||
"filmboxfbx"
|
||||
"blendScene"
|
||||
]
|
||||
|
||||
default_template_name = "publish"
|
||||
|
|
|
|||
|
|
@ -19,6 +19,19 @@
|
|||
],
|
||||
"ext": ".ass"
|
||||
},
|
||||
"HouCreateUnrealStaticMesh": {
|
||||
"enabled": true,
|
||||
"default_variants": [
|
||||
"Main"
|
||||
],
|
||||
"static_mesh_prefix": "S",
|
||||
"collision_prefixes": [
|
||||
"UBX",
|
||||
"UCP",
|
||||
"USP",
|
||||
"UCX"
|
||||
]
|
||||
},
|
||||
"CreateAlembicCamera": {
|
||||
"enabled": true,
|
||||
"default_variants": [
|
||||
|
|
|
|||
|
|
@ -39,6 +39,37 @@
|
|||
]
|
||||
|
||||
},
|
||||
{
|
||||
"type": "dict",
|
||||
"collapsible": true,
|
||||
"key": "HouCreateUnrealStaticMesh",
|
||||
"label": "Create Unreal - Static Mesh",
|
||||
"checkbox_key": "enabled",
|
||||
"children": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "enabled",
|
||||
"label": "Enabled"
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"key": "default_variants",
|
||||
"label": "Default Variants",
|
||||
"object_type": "text"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "static_mesh_prefix",
|
||||
"label": "Static Mesh Prefix"
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"key": "collision_prefixes",
|
||||
"label": "Collision Mesh Prefixes",
|
||||
"object_type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "schema_template",
|
||||
"name": "template_create_plugin",
|
||||
|
|
|
|||
|
|
@ -20,11 +20,27 @@ class CreateArnoldAssModel(BaseSettingsModel):
|
|||
)
|
||||
ext: str = Field(Title="Extension")
|
||||
|
||||
class HouCreateUnrealStaticMeshModel(BaseSettingsModel):
|
||||
enabled: bool = Field(title="Enabled")
|
||||
default_variants: list[str] = Field(
|
||||
default_factory=list,
|
||||
title="Default Products"
|
||||
)
|
||||
static_mesh_prefixes: str = Field("S", title="Static Mesh Prefix")
|
||||
collision_prefixes: list[str] = Field(
|
||||
default_factory=list,
|
||||
title="Collision Prefixes"
|
||||
)
|
||||
|
||||
class CreatePluginsModel(BaseSettingsModel):
|
||||
CreateArnoldAss: CreateArnoldAssModel = Field(
|
||||
default_factory=CreateArnoldAssModel,
|
||||
title="Create Alembic Camera")
|
||||
# "-" is not compatible in the new model
|
||||
HouCreateUnrealStaticMesh: HouCreateUnrealStaticMeshModel = Field(
|
||||
default_factory=HouCreateUnrealStaticMeshModel,
|
||||
title="Create Unreal_Static Mesh"
|
||||
)
|
||||
CreateAlembicCamera: CreatorModel = Field(
|
||||
default_factory=CreatorModel,
|
||||
title="Create Alembic Camera")
|
||||
|
|
@ -63,6 +79,19 @@ DEFAULT_HOUDINI_CREATE_SETTINGS = {
|
|||
"default_variants": ["Main"],
|
||||
"ext": ".ass"
|
||||
},
|
||||
"HouCreateUnrealStaticMesh": {
|
||||
"enabled": True,
|
||||
"default_variants": [
|
||||
"Main"
|
||||
],
|
||||
"static_mesh_prefix": "S",
|
||||
"collision_prefixes": [
|
||||
"UBX",
|
||||
"UCP",
|
||||
"USP",
|
||||
"UCX"
|
||||
]
|
||||
},
|
||||
"CreateAlembicCamera": {
|
||||
"enabled": True,
|
||||
"default_variants": ["Main"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue