CC5 Python API: Set Clothing/Accessory Smooth Mesh Levels Before Export?

Hi everyone,

I’m building a Character Creator 5 Python/OpenPlugin export tool for a Maya rigging pipeline, and I’m trying to automate LOD exports from a CC5 character.

For the character body, subdivision switching works through the Python API:

avatar.SwitchSubdivMeshLevel(level)
avatar.SetRenderSubdivMeshLevel(level)

However, clothing, hair, and accessories seem to have their own Smooth Mesh settings in the Modify panel:

  • Smooth Mesh enabled
  • Level for Real Time / Preview
  • Level for Final Render

I haven’t found a Python API method to set these values on RICloth, RIHair, or RIAccessory. They do not appear to expose methods equivalent to SwitchSubdivMeshLevel() or SetRenderSubdivMeshLevel().

I also tried RIObject.GetControl() with likely names such as:

SmoothMesh
SmoothMeshPreviewLevel
PreviewSubdivLevel
RenderSubdivLevel
LevelForRealTimePreview
LevelForFinalRender

but those returned None.

What I’m trying to automate is:

  • LOD0: body SubD2, clothing/accessories Smooth Mesh level 2
  • LOD1: body SubD1, clothing/accessories Smooth Mesh level 1
  • LOD2: body SubD0, clothing/accessories Smooth Mesh level 0

I’m also looking for the correct Python call/signature for exporting quad-based OBJ files with the Subdivided Mesh option enabled, if that is exposed through:

RLPy.RFileIO.ExportObjFile(...)

Has anyone found a supported way to set clothing/accessory Smooth Mesh levels through Python, or know the internal control names/API calls for those sliders?

Any sample code or pointers would be hugely appreciated.

I’m sorry, but RIAvatar.SwitchSubdivMeshLevel(level) and RIAvatar.SetRenderSubdivMeshLevel(level) only apply to the character body mesh.

For clothing, hair, accessories, and other attached objects, the Smooth Mesh Settings shown in the Modify panel are currently not exposed through the Python API.

So unfortunately, there is currently no supported Python API call to set Smooth Mesh enabled, Preview level, or Final Render level for RICloth, RIHair, or RIAccessory.

This also means that clothing, hair, and accessories cannot currently be subdivided through Python during export in the same way as the character body.

Sorry for the inconvenience.

Hi Johnny_RL

That is unfortunate. Would this be something you would be willing to work on adding?