-
Notifications
You must be signed in to change notification settings - Fork 1
Description
With the .maps I've tested so far, they've been importing into Maya by-and-large without issue (including retaining vertex color information). However, for ap34.map, I receive the following warning in Maya and the geometry imports as a single mesh with no vertex color information intact:
# Error: RuntimeError: file C:/Users/John/Documents/maya/2022/scripts\ObjVColorMaya.py line 216: Can't read vColor! # Through some additional tests, this is only happening when I import the Opaque Mesh master group from the tool. If I import any of the Transparent or Decal master groups then it imports correctly, with vertex color information and separate groupings intact.
I'm not sure what's causing the import error for this particular map, but it might very well be an issue with other maps I haven't come across yet.
For that RuntimeError mentioned above, here is the portion of code relating to it:
def vColorApply(self, objName, vColor):
mSel = om2.MSelectionList()
mSel.add(objName)
mDag = mSel.getDagPath(0)
mfnMesh = om2.MFnMesh(mDag)
vtxCount = mfnMesh.numVertices
if len(vColor) == vtxCount:
mfnMesh.setVertexColors(vColor, range(vtxCount))
else:
mc.error("Can't read vColor!")
return
mc.polyOptions(mDag, cs=1)And attached is the Python script in its entirety.
ObjVColorMaya.zip