mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #674 from ynput/enhancement/AY-5184_publish-setdress-without-textures
Maya: add option to stripe shader assignment for setdress family
This commit is contained in:
commit
0086d1e27d
5 changed files with 37 additions and 18 deletions
|
|
@ -9,11 +9,16 @@ class CreateSetDress(plugin.MayaCreator):
|
|||
label = "Set Dress"
|
||||
product_type = "setdress"
|
||||
icon = "cubes"
|
||||
exactSetMembersOnly = True
|
||||
shader = True
|
||||
default_variants = ["Main", "Anim"]
|
||||
|
||||
def get_instance_attr_defs(self):
|
||||
return [
|
||||
BoolDef("exactSetMembersOnly",
|
||||
label="Exact Set Members Only",
|
||||
default=True)
|
||||
default=self.exactSetMembersOnly),
|
||||
BoolDef("shader",
|
||||
label="Include shader",
|
||||
default=self.shader)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Extract data as Maya scene (raw)."""
|
||||
import os
|
||||
|
||||
import contextlib
|
||||
from ayon_core.lib import BoolDef
|
||||
from ayon_core.pipeline import AVALON_CONTAINER_ID, AYON_CONTAINER_ID
|
||||
from ayon_core.pipeline.publish import AYONPyblishPluginMixin
|
||||
from ayon_maya.api.lib import maintained_selection
|
||||
from ayon_maya.api.lib import maintained_selection, shader
|
||||
from ayon_maya.api import plugin
|
||||
from maya import cmds
|
||||
|
||||
|
|
@ -88,17 +88,21 @@ class ExtractMayaSceneRaw(plugin.MayaExtractorPlugin, AYONPyblishPluginMixin):
|
|||
)
|
||||
with maintained_selection():
|
||||
cmds.select(selection, noExpand=True)
|
||||
cmds.file(path,
|
||||
force=True,
|
||||
typ="mayaAscii" if self.scene_type == "ma" else "mayaBinary", # noqa: E501
|
||||
exportSelected=True,
|
||||
preserveReferences=attribute_values[
|
||||
"preserve_references"
|
||||
],
|
||||
constructionHistory=True,
|
||||
shader=True,
|
||||
constraints=True,
|
||||
expressions=True)
|
||||
with contextlib.ExitStack() as stack:
|
||||
if not instance.data.get("shader", True):
|
||||
# Fix bug where export without shader may import the geometry 'green'
|
||||
# due to the lack of any shader on import.
|
||||
stack.enter_context(shader(selection, shadingEngine="initialShadingGroup"))
|
||||
|
||||
cmds.file(path,
|
||||
force=True,
|
||||
typ="mayaAscii" if self.scene_type == "ma" else "mayaBinary",
|
||||
exportSelected=True,
|
||||
preserveReferences=attribute_values["preserve_references"],
|
||||
constructionHistory=True,
|
||||
shader=instance.data.get("shader", True),
|
||||
constraints=True,
|
||||
expressions=True)
|
||||
|
||||
if "representations" not in instance.data:
|
||||
instance.data["representations"] = []
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Package declaring AYON addon 'maya' version."""
|
||||
__version__ = "0.2.6"
|
||||
__version__ = "0.2.7"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name = "maya"
|
||||
title = "Maya"
|
||||
version = "0.2.6"
|
||||
version = "0.2.7"
|
||||
client_dir = "ayon_maya"
|
||||
|
||||
ayon_required_addons = {
|
||||
|
|
|
|||
|
|
@ -124,6 +124,14 @@ class CreateVrayProxyModel(BaseSettingsModel):
|
|||
default_factory=list, title="Default Products")
|
||||
|
||||
|
||||
class CreateSetDressModel(BaseSettingsModel):
|
||||
enabled: bool = SettingsField(True)
|
||||
exactSetMembersOnly: bool = SettingsField(title="Exact Set Members Only")
|
||||
shader: bool = SettingsField(title="Include shader")
|
||||
default_variants: list[str] = SettingsField(
|
||||
default_factory=list, title="Default Products")
|
||||
|
||||
|
||||
class CreateMultishotLayout(BasicCreatorModel):
|
||||
shotParent: str = SettingsField(title="Shot Parent Folder")
|
||||
groupLoadedAssets: bool = SettingsField(title="Group Loaded Assets")
|
||||
|
|
@ -217,8 +225,8 @@ class CreatorsModel(BaseSettingsModel):
|
|||
default_factory=BasicCreatorModel,
|
||||
title="Create Rig"
|
||||
)
|
||||
CreateSetDress: BasicCreatorModel = SettingsField(
|
||||
default_factory=BasicCreatorModel,
|
||||
CreateSetDress: CreateSetDressModel = SettingsField(
|
||||
default_factory=CreateSetDressModel,
|
||||
title="Create Set Dress"
|
||||
)
|
||||
CreateVrayProxy: CreateVrayProxyModel = SettingsField(
|
||||
|
|
@ -396,6 +404,8 @@ DEFAULT_CREATORS_SETTINGS = {
|
|||
},
|
||||
"CreateSetDress": {
|
||||
"enabled": True,
|
||||
"exactSetMembersOnly": True,
|
||||
"shader": True,
|
||||
"default_variants": [
|
||||
"Main",
|
||||
"Anim"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue