Create / Delete UVSet with Custom Node

Create / Delete UVSet with Custom Node

icapathos
Advocate Advocate
343 Views
0 Replies
Message 1 of 1

Create / Delete UVSet with Custom Node

icapathos
Advocate
Advocate

I have tried several times to create custom node to create UVSet, but I failed.

my code is like below, 

def deform(self, dataBlock, geomIter, matrix, multiIndex):
    hInput = dataBlock.inputArrayValue(self.input)
    hInputGeom = hInput.inputValue()

    fnMesh = OpenMaya.MFnMesh(hInputGeom.asMesh())

    fnMesh.createUVSetWithName("myUVMap")    ## GOT ERROR HERE
...

But I just got

#   File "S:\Maya_2018_DI\build\Release\runTime\Python\Lib\site-packages\maya\OpenMaya.py", line 9968, in createUVSetWithName
# RuntimeError: (kFailure): Object does not exist // 

  

Of course I can use the createUVSet node, but it cannot change uvSetName dynamically.

0 Likes
344 Views
0 Replies
Replies (0)