Backwards compatibility wip

This commit is contained in:
Toke Stuart Jepsen 2024-02-20 18:31:16 +00:00
parent 4e8ea037b3
commit 70982d9d79
5 changed files with 32 additions and 20 deletions

View file

@ -5,6 +5,7 @@ from openpype.hosts.maya.api import lib, plugin
from openpype.lib import (
BoolDef,
NumberDef,
TextDef,
)
from openpype.pipeline import CreatedInstance
@ -30,6 +31,21 @@ def _get_animation_attr_defs(cls):
return defs
def _get_legacy_attr_defs(cls):
"""These attributes are defined to hide legacy attributes in the publisher
from the user."""
return [
BoolDef("writeColorSets", label="writeColorSets", hidden=True),
BoolDef("writeNormals", label="writeNormals", hidden=True),
BoolDef("writeFaceSets", label="writeFaceSets", hidden=True),
BoolDef("renderableOnly", label="renderableOnly", hidden=True),
BoolDef("visibleOnly", label="visibleOnly", hidden=True),
BoolDef("worldSpace", label="worldSpace", hidden=True),
TextDef("attr", label="attr", hidden=True),
TextDef("attrPrefix", label="attrPrefix", hidden=True),
]
class CreateAnimation(plugin.MayaHiddenCreator):
"""Animation output for character rigs
@ -64,6 +80,7 @@ class CreateAnimation(plugin.MayaHiddenCreator):
def get_instance_attr_defs(self):
super(CreateAnimation, self).get_instance_attr_defs()
defs = _get_animation_attr_defs(self)
defs += _get_legacy_attr_defs(self)
return defs
@ -93,6 +110,7 @@ class CreatePointCache(plugin.MayaCreator):
def get_instance_attr_defs(self):
super(CreatePointCache, self).get_instance_attr_defs()
defs = _get_animation_attr_defs(self)
defs += _get_legacy_attr_defs(self)
return defs
def create(self, subset_name, instance_data, pre_create_data):

View file

@ -17,7 +17,7 @@ class CollectAnimationOutputGeometry(pyblish.api.InstancePlugin):
order = pyblish.api.CollectorOrder + 0.4
families = ["animation"]
label = "Collect Animation Output Geometry"
label = "Collect Animation"
hosts = ["maya"]
ignore_type = ["constraints"]
@ -57,3 +57,8 @@ class CollectAnimationOutputGeometry(pyblish.api.InstancePlugin):
if instance.data.get("farm"):
instance.data["families"].append("publish.farm")
# User defined attributes.
instance.data["includeUserDefinedAttributes"] = (
instance.data["creator_attributes"]["includeUserDefinedAttributes"]
)

View file

@ -45,3 +45,8 @@ class CollectPointcache(pyblish.api.InstancePlugin):
if proxy_set:
instance.remove(proxy_set)
instance.data["setMembers"].remove(proxy_set)
# User defined attributes.
instance.data["includeUserDefinedAttributes"] = (
instance.data["creator_attributes"]["includeUserDefinedAttributes"]
)

View file

@ -43,7 +43,6 @@ class ExtractAlembic(publish.Extractor, OpenPypePyblishPluginMixin):
preRollStartFrame = 0
pythonPerFrameCallback = ""
pythonPostJobCallback = ""
stripNamespaces = -1
userAttr = ""
userAttrPrefix = ""
export_overrides = []
@ -257,22 +256,6 @@ class ExtractAlembic(publish.Extractor, OpenPypePyblishPluginMixin):
"label": "pythonPostJobCallback",
}
},
"stripNamespaces": {
"def": NumberDef,
"kwargs": {
"label": "stripNamespaces",
"tooltip": (
"If this flag is present namespaces will be stripped "
"off of the node before being written to Alembic. The "
"int after the flag specifies how many namespaces will"
" be stripped off of the node name. Be careful that "
"the new stripped name does not collide with other "
"sibling node names.\n\nExamples:\n taco:foo:bar would"
" be written as just bar with -sn 0\ntaco:foo:bar "
"would be written as foo:bar with -sn 1"
),
}
},
"userAttr": {
"def": TextDef,
"kwargs": {

View file

@ -562,7 +562,8 @@
"includeParentHierarchy": false,
"farm": false,
"priority": 50,
"refresh": false
"refresh": false,
"include_user_defined_attributes": false
},
"CreateModel": {
"enabled": true,
@ -1112,7 +1113,6 @@
],
"flags": [
"stripNamespaces",
"writeColorSets",
"writeNormals",
"worldSpace"
],
@ -1131,6 +1131,7 @@
"attr",
"attrPrefix",
"worldSpace",
"writeColorSets",
"writeNormals",
"writeFaceSets",
"renderableOnly",