Closed moonyuet closed 1 week ago
Task linked: AY-5184 publish setdress without textures
Didn't test it, but changes look good to me.
It's good to note that whenever you load a maya scene that was exported with
shader=False
I vaguely recall that maya will make them green by default because they will have no shader assigned at all instead of defaulting to just getting a default shader assigned - but that may be different these days in Maya 2024+ era.
Can we do anything about it? I would def rather having standardSurface1
assigned when shaders stripped...
What you think guys?
Didn't test it, but changes look good to me. It's good to note that whenever you load a maya scene that was exported with
shader=False
I vaguely recall that maya will make them green by default because they will have no shader assigned at all instead of defaulting to just getting a default shader assigned - but that may be different these days in Maya 2024+ era.Can we do anything about it? I would def rather having
standardSurface1
assigned when shaders stripped...What you think guys?
we can do it either during loading scene with the setdress family (with an option) or somehow"editing" the published scene to assign the default shader. @BigRoy and @antirotor any thought?
we can do it either during loading scene with the setdress family (with an option) or somehow"editing" the published scene to assign the default shader. @BigRoy and @antirotor any thought?
The model
publish does this as well on extract to temporarily assign the default shader. See here. That would suffice.
I would def rather having standardSurface1 assigned when shaders stripped...
That's indeed what model
publish does with the above linked logic.
But as said, please first confirm the shaders=False
flag actually still acting like that when loading in the meshes. Do they turn green still? This may have been an issue back in Maya 8.5 or whatever which has (potentially?) been solved along the way?
By the way, I noticed this is "sponsored" which means this is likely a client request. If they ALWAYS want no shaders then it may also be worth it to expose the default value to settings so the default value can be customized for that studio?
But as said, please first confirm the
shaders=False
flag actually still acting like that when loading in the meshes. Do they turn green still? This may have been an issue back in Maya 8.5 or whatever which has (potentially?) been solved along the way?
I tested with 2025 and 2023, they dont turn green anymore and they are assigned by default shader(lambert1). Not sure about the version elder than 2023.
Also updated the changelog description
I tested with 2025 and 2023, they dont turn green anymore and they are assigned by default shader(lambert1). Not sure about the version elder than 2023.
I gave this a quick go. But it unfortunately still does - when the original shader that was applied was NOT the default shader.
I tested with file -exportSelected -shader 0 -type mayaAscii "E:/test.ma"
It seems that shader=False
means, do not include the shader in the export. But if it contains the default shader assignment - it still assigns it:
connectAttr "pCubeShape1.iog" ":initialShadingGroup.dsm" -na;
But if it had a different shader assign on export, that line is gone and thus on load it doesn't understand it should receive a shader - turning the default maya "I do not have a shader"-green.
Forgot to mention - this is tested in Maya 2024.2
I tested with 2025 and 2023, they dont turn green anymore and they are assigned by default shader(lambert1). Not sure about the version elder than 2023.
I gave this a quick go. But it unfortunately still does - when the original shader that was applied was NOT the default shader.
I tested with
file -exportSelected -shader 0 -type mayaAscii "E:/test.ma"
It seems that
shader=False
means, do not include the shader in the export. But if it contains the default shader assignment - it still assigns it:connectAttr "pCubeShape1.iog" ":initialShadingGroup.dsm" -na;
But if it had a different shader assign on export, that line is gone and thus on load it doesn't understand it should receive a shader - turning the default maya "I do not have a shader"-green.
Does it mean we need to assign the default one first by using contextlib and then cmds.file
?
Changelog Description
This PR is to add support to exclude shaders assignment when publishing the scene with setdress family
Additional info
Update the maya addon to 0.2.5 You can set the setdress settings in ayon setting![image](https://github.com/ynput/ayon-core/assets/64118225/4923fe36-821b-4bc5-b48d-94224d6451ad)
Testing notes:
Create setdress and families such as mayascene and layout
In setdress, you can choose whether you want to include shader![image](https://github.com/ynput/ayon-core/assets/64118225/4d6d8790-4674-4bd6-8f93-2fab8ec7f826)
Publish
Should be published successfully
Check published setdress scene, the scene should be without shader assignment if the shader option is turned off.
Check the published scene from mayascene/layout family, the scene should be published with shader assignment