Re-order attributes

This commit is contained in:
Toke Stuart Jepsen 2024-04-15 09:52:44 +01:00
parent 5cb862cf22
commit cd8ac63e6b
2 changed files with 186 additions and 185 deletions

View file

@ -1,4 +1,5 @@
import os
from collections import OrderedDict
from maya import cmds
@ -234,29 +235,7 @@ class ExtractAlembic(publish.Extractor, AYONPyblishPluginMixin):
if not cls.overrides:
return []
override_defs = {
"attr": TextDef(
"attr",
label="Custom Attributes",
placeholder="attr1; attr2; ...",
default=cls.attr,
tooltip=(
"Attributes matching by name will be included in the "
"Alembic export. Attributes should be separated by "
"semi-colon `;`"
)
),
"attrPrefix": TextDef(
"attrPrefix",
label="Custom Attributes Prefix",
placeholder="prefix1; prefix2; ...",
default=cls.attrPrefix,
tooltip=(
"Attributes starting with these prefixes will be included "
"in the Alembic export. Attributes should be separated by "
"semi-colon `;`"
)
),
override_defs = OrderedDict({
"autoSubd": BoolDef(
"autoSubd",
label="Auto Subd",
@ -271,13 +250,6 @@ class ExtractAlembic(publish.Extractor, AYONPyblishPluginMixin):
" its value is true."
)
),
"dataFormat": EnumDef(
"dataFormat",
label="Data Format",
items=["ogawa", "HDF"],
default=cls.dataFormat,
tooltip="The data format to use to write the file."
),
"dontSkipUnwrittenFrames": BoolDef(
"dontSkipUnwrittenFrames",
label="Dont Skip Unwritten Frames",
@ -294,24 +266,6 @@ class ExtractAlembic(publish.Extractor, AYONPyblishPluginMixin):
default=cls.eulerFilter,
tooltip="Apply Euler filter while sampling rotations."
),
"melPerFrameCallback": TextDef(
"melPerFrameCallback",
label="Mel Per Frame Callback",
default=cls.melPerFrameCallback,
tooltip=(
"When each frame (and the static frame) is evaluated the "
"string specified is evaluated as a Mel command."
)
),
"melPostJobCallback": TextDef(
"melPostJobCallback",
label="Mel Post Job Callback",
default=cls.melPostJobCallback,
tooltip=(
"When the translation has finished the string specified "
"is evaluated as a Mel command."
)
),
"noNormals": BoolDef(
"noNormals",
label="No Normals",
@ -327,35 +281,6 @@ class ExtractAlembic(publish.Extractor, AYONPyblishPluginMixin):
default=cls.preRoll,
tooltip="This frame range will not be sampled."
),
"preRollStartFrame": NumberDef(
"preRollStartFrame",
label="Pre Roll Start Frame",
tooltip=(
"The frame to start scene evaluation at. This is used"
" to set the starting frame for time dependent "
"translations and can be used to evaluate run-up that"
" isn't actually translated."
),
default=cls.preRollStartFrame
),
"pythonPerFrameCallback": TextDef(
"pythonPerFrameCallback",
label="Python Per Frame Callback",
default=cls.pythonPerFrameCallback,
tooltip=(
"When each frame (and the static frame) is evaluated the "
"string specified is evaluated as a python command."
)
),
"pythonPostJobCallback": TextDef(
"pythonPostJobCallback",
label="Python Post Frame Callback",
default=cls.pythonPostJobCallback,
tooltip=(
"When the translation has finished the string specified "
"is evaluated as a python command."
)
),
"renderableOnly": BoolDef(
"renderableOnly",
label="Renderable Only",
@ -389,28 +314,6 @@ class ExtractAlembic(publish.Extractor, AYONPyblishPluginMixin):
"the Alembic file."
)
),
"userAttr": TextDef(
"userAttr",
label="User Attr",
placeholder="attr1; attr2; ...",
default=cls.userAttr,
tooltip=(
"Attributes matching by name will be included in the "
"Alembic export. Attributes should be separated by "
"semi-colon `;`"
)
),
"userAttrPrefix": TextDef(
"userAttrPrefix",
label="User Attr Prefix",
placeholder="prefix1; prefix2; ...",
default=cls.userAttrPrefix,
tooltip=(
"Attributes starting with these prefixes will be included "
"in the Alembic export. Attributes should be separated by "
"semi-colon `;`"
)
),
"verbose": BoolDef(
"verbose",
label="Verbose",
@ -473,8 +376,106 @@ class ExtractAlembic(publish.Extractor, AYONPyblishPluginMixin):
"Visibility state will be stored in the Alembic file. "
"Otherwise everything written out is treated as visible."
)
),
"preRollStartFrame": NumberDef(
"preRollStartFrame",
label="Pre Roll Start Frame",
tooltip=(
"The frame to start scene evaluation at. This is used"
" to set the starting frame for time dependent "
"translations and can be used to evaluate run-up that"
" isn't actually translated."
),
default=cls.preRollStartFrame
),
"dataFormat": EnumDef(
"dataFormat",
label="Data Format",
items=["ogawa", "HDF"],
default=cls.dataFormat,
tooltip="The data format to use to write the file."
),
"attr": TextDef(
"attr",
label="Custom Attributes",
placeholder="attr1; attr2; ...",
default=cls.attr,
tooltip=(
"Attributes matching by name will be included in the "
"Alembic export. Attributes should be separated by "
"semi-colon `;`"
)
),
"attrPrefix": TextDef(
"attrPrefix",
label="Custom Attributes Prefix",
placeholder="prefix1; prefix2; ...",
default=cls.attrPrefix,
tooltip=(
"Attributes starting with these prefixes will be included "
"in the Alembic export. Attributes should be separated by "
"semi-colon `;`"
)
),
"userAttr": TextDef(
"userAttr",
label="User Attr",
placeholder="attr1; attr2; ...",
default=cls.userAttr,
tooltip=(
"Attributes matching by name will be included in the "
"Alembic export. Attributes should be separated by "
"semi-colon `;`"
)
),
"userAttrPrefix": TextDef(
"userAttrPrefix",
label="User Attr Prefix",
placeholder="prefix1; prefix2; ...",
default=cls.userAttrPrefix,
tooltip=(
"Attributes starting with these prefixes will be included "
"in the Alembic export. Attributes should be separated by "
"semi-colon `;`"
)
),
"melPerFrameCallback": TextDef(
"melPerFrameCallback",
label="Mel Per Frame Callback",
default=cls.melPerFrameCallback,
tooltip=(
"When each frame (and the static frame) is evaluated the "
"string specified is evaluated as a Mel command."
)
),
"melPostJobCallback": TextDef(
"melPostJobCallback",
label="Mel Post Job Callback",
default=cls.melPostJobCallback,
tooltip=(
"When the translation has finished the string specified "
"is evaluated as a Mel command."
)
),
"pythonPerFrameCallback": TextDef(
"pythonPerFrameCallback",
label="Python Per Frame Callback",
default=cls.pythonPerFrameCallback,
tooltip=(
"When each frame (and the static frame) is evaluated the "
"string specified is evaluated as a python command."
)
),
"pythonPostJobCallback": TextDef(
"pythonPostJobCallback",
label="Python Post Frame Callback",
default=cls.pythonPostJobCallback,
tooltip=(
"When the translation has finished the string specified "
"is evaluated as a python command."
)
)
}
})
defs = super(ExtractAlembic, cls).get_attribute_defs()

View file

@ -349,22 +349,6 @@ class ExtractAlembicModel(BaseSettingsModel):
families: list[str] = SettingsField(
default_factory=list,
title="Families")
attr: str = SettingsField(
title="Custom Attributes",
placeholder="attr1;attr2",
description=(
"Attributes matching by name will be included in the Alembic "
"export. Attributes should be separated by semi-colon `;`"
)
)
attrPrefix: str = SettingsField(
title="Custom Attributes Prefix",
placeholder="prefix1;prefix2",
description=(
"Attributes starting with these prefixes will be included in the "
"Alembic export. Attributes should be separated by semi-colon `;`"
)
)
autoSubd: bool = SettingsField(
title="Auto Subd",
description=(
@ -376,21 +360,6 @@ class ExtractAlembicModel(BaseSettingsModel):
"mesh node and its value is true."
)
)
bake_attributes: list[str] = SettingsField(
default_factory=list, title="Bake Attributes",
description="List of attributes that will be included in the alembic "
"export.",
)
bake_attribute_prefixes: list[str] = SettingsField(
default_factory=list, title="Bake Attribute Prefixes",
description="List of attribute prefixes for attributes that will be "
"included in the alembic export.",
)
dataFormat: str = SettingsField(
enum_resolver=extract_alembic_data_format_enum,
title="Data Format",
description="The data format to use to write the file."
)
dontSkipUnwrittenFrames: bool = SettingsField(
title="Dont Skip Unwritten Frames",
description=(
@ -403,20 +372,6 @@ class ExtractAlembicModel(BaseSettingsModel):
title="Euler Filter",
description="Apply Euler filter while sampling rotations."
)
melPerFrameCallback: str = SettingsField(
title="Mel Per Frame Callback",
description=(
"When each frame (and the static frame) is evaluated the string "
"specified is evaluated as a Mel command."
)
)
melPostFrameCallback: str = SettingsField(
title="Mel Post Frame Callback",
description=(
"When the translation has finished the string specified is "
"evaluated as a Mel command."
)
)
noNormals: bool = SettingsField(
title="No Normals",
description=(
@ -433,30 +388,6 @@ class ExtractAlembicModel(BaseSettingsModel):
"used for simulation run up."
)
)
preRollStartFrame: int = SettingsField(
title="Pre Roll Start Frame",
description=(
"The frame to start scene evaluation at. This is used to set the "
"starting frame for time dependent translations and can be used to"
" evaluate run-up that isn't actually translated.\n"
"NOTE: Pre Roll needs to be enabled for this start frame "
"to be considered."
)
)
pythonPerFrameCallback: str = SettingsField(
title="Python Per Frame Callback",
description=(
"When each frame (and the static frame) is evaluated the string "
"specified is evaluated as a python command."
)
)
pythonPostJobCallback: str = SettingsField(
title="Python Post Job Callback",
description=(
"When the translation has finished the string specified is "
"evaluated as a python command."
)
)
renderableOnly: bool = SettingsField(
title="Renderable Only",
description="Only export renderable visible shapes."
@ -468,22 +399,6 @@ class ExtractAlembicModel(BaseSettingsModel):
"to Alembic."
)
)
userAttr: str = SettingsField(
title="User Attr",
placeholder="attr1;attr2",
description=(
"Attributes matching by name will be included in the Alembic "
"export. Attributes should be separated by semi-colon `;`"
)
)
userAttrPrefix: str = SettingsField(
title="User Attr Prefix",
placeholder="prefix1;prefix2",
description=(
"Attributes starting with these prefixes will be included in the "
"Alembic export. Attributes should be separated by semi-colon `;`"
)
)
uvsOnly: bool = SettingsField(
title="UVs Only",
description=(
@ -542,6 +457,91 @@ class ExtractAlembicModel(BaseSettingsModel):
"everything written out is treated as visible."
)
)
preRollStartFrame: int = SettingsField(
title="Pre Roll Start Frame",
description=(
"The frame to start scene evaluation at. This is used to set the "
"starting frame for time dependent translations and can be used to"
" evaluate run-up that isn't actually translated.\n"
"NOTE: Pre Roll needs to be enabled for this start frame "
"to be considered."
)
)
dataFormat: str = SettingsField(
enum_resolver=extract_alembic_data_format_enum,
title="Data Format",
description="The data format to use to write the file."
)
bake_attributes: list[str] = SettingsField(
default_factory=list, title="Bake Attributes",
description="List of attributes that will be included in the alembic "
"export.",
)
bake_attribute_prefixes: list[str] = SettingsField(
default_factory=list, title="Bake Attribute Prefixes",
description="List of attribute prefixes for attributes that will be "
"included in the alembic export.",
)
attr: str = SettingsField(
title="Custom Attributes",
placeholder="attr1;attr2",
description=(
"Attributes matching by name will be included in the Alembic "
"export. Attributes should be separated by semi-colon `;`"
)
)
attrPrefix: str = SettingsField(
title="Custom Attributes Prefix",
placeholder="prefix1;prefix2",
description=(
"Attributes starting with these prefixes will be included in the "
"Alembic export. Attributes should be separated by semi-colon `;`"
)
)
userAttr: str = SettingsField(
title="User Attr",
placeholder="attr1;attr2",
description=(
"Attributes matching by name will be included in the Alembic "
"export. Attributes should be separated by semi-colon `;`"
)
)
userAttrPrefix: str = SettingsField(
title="User Attr Prefix",
placeholder="prefix1;prefix2",
description=(
"Attributes starting with these prefixes will be included in the "
"Alembic export. Attributes should be separated by semi-colon `;`"
)
)
melPerFrameCallback: str = SettingsField(
title="Mel Per Frame Callback",
description=(
"When each frame (and the static frame) is evaluated the string "
"specified is evaluated as a Mel command."
)
)
melPostFrameCallback: str = SettingsField(
title="Mel Post Frame Callback",
description=(
"When the translation has finished the string specified is "
"evaluated as a Mel command."
)
)
pythonPerFrameCallback: str = SettingsField(
title="Python Per Frame Callback",
description=(
"When each frame (and the static frame) is evaluated the string "
"specified is evaluated as a python command."
)
)
pythonPostJobCallback: str = SettingsField(
title="Python Post Job Callback",
description=(
"When the translation has finished the string specified is "
"evaluated as a python command."
)
)
overrides: list[str] = SettingsField(
enum_resolver=extract_alembic_overrides_enum,
title="Exposed Overrides",