Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
769 stars 201 forks source link

shadingMode is exported even when defined as None #2920

Closed sanders3d closed 1 year ago

sanders3d commented 1 year ago

Hello, It seems that the python command is exporting material bindings even if I try and tell it to not do this. I have a test character which as some preview material assigned to it. But I just want to export the animated mesh and not the shading.

import maya.cmds as cmds

cmds.mayaUSDExport(
    file="/tmp/test.usdc",
    exportRoots=cmds.ls(sl=True),
    exportDisplayColor=False,
    shadingMode=None,
    frameRange=( 1.0, 10.0),
    mergeTransformAndShape=True,
    verbose=True,
    materialsScopeName="mtl",
    parentScope="/ROOT/geo",
    renderableOnly=True,
)

This will still export with Shading and override it when I layer the animation onto the lookdev asset. Even if I can force the layers with specific opinion index, I don't want to export with shading assignments. The lookdev contains both preview and render assignments.

Any idea on how to get around this?

regards stefan

santosd commented 1 year ago

Hi @sanders3d , The following command worked for me:

import maya.cmds as cmds

cmds.mayaUSDExport(
    file="C:/tmp/testNoMat.usda",
    exportRoots=cmds.ls(sl=True),
    exportDisplayColor=False,
    shadingMode='none',
    frameRange=( 1.0, 10.0),
    mergeTransformAndShape=True,
    verbose=True,
    materialsScopeName="mtl",
    parentScope="/ROOT/geo",
    renderableOnly=True,
)

Let me know if that works for you.

sanders3d commented 1 year ago

Ahhh.. so the difference was

shadingMode='none'

vs

shadingMode=None

I would not have figured that out.

thank you stefan

santosd commented 1 year ago

Yes, that was the only difference. No problem at all.