View Full Version : Get a list of transforms per vertex in Python

10 October 2010, 12:39 PM

I am trying to get a list of transforms per vertex (of skinned mesh), and I need to do it in Python.
It seams that I can't use skinPercent command, because it has a limitation with transform flag in query mode. The only thread I found on the subject is this:

Anybody knows if there is another way of getting a list of influences per vertex using Python?


10 October 2010, 05:05 AM
i've got the similar problem

Exception in thread Thread-2:
Traceback (most recent call last):
File "D:\Python25\lib\", line 488, in __bootstrap_inner
File "D:\Python25\lib\", line 448, in run
self.__target(*self.__args, **self.__kwargs)
File "D:\INVINCIBLE\code\python\project\pdeExportTool\", line 38, in __call__
self.res = self.func(*self.args)
File "D:\INVINCIBLE\code\python\project\pdeExportTool\", line 410, in OnRun
File "D:\INVINCIBLE\code\python\project\pdeExportTool\", line 155, in exportCharacterAnimation'root',replace = True)
TypeError: Flag 'replace' must be passed a boolean argument

I finally find that error :
RuntimeError: Maya commands (maya.cmds.*) maya only be called from the main thread

10 October 2010, 07:34 AM
I found a solution to my problem (thanks to my colleagues).
Python code to get transforms per vertex is this:

mc.skinPercent("skinCluster5", 'symetricalHead.vtx[35]', query=True, transform=None)

Trick here is using None with transform flag.

INVINCIBLE0918, I am only starting with Python and didn't get to threading, but thanks for heads up, I will remember that.

CGTalk Moderation
10 October 2010, 07:34 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.