from pyfbsdk import *
import os
import os.path
gApp = FBApplication()
gSys = FBSystem()
gApp.FileNew()
lFilePath = os.path.abspath( os.path.join( gSys.ApplicationPath, r"..\config\FBClusterTransactions.fbx"))
print "Source File Path", lFilePath
gApp.FileOpen(lFilePath)
lSphere = FBFindModelByLabelName("pSphere1")
if lSphere:
skinCluster = FBCluster(lSphere)
print skinCluster.Name
if skinCluster and skinCluster.LinkGetCount():
for n in range (skinCluster.LinkGetCount()):
skinCluster.ClusterBegin(n)
linkName = skinCluster.LinkGetName(n)
linkModel = skinCluster.LinkGetModel(n)
numVerts = skinCluster.VertexGetCount()
print numVerts
for v in range (numVerts):
vertIndex = skinCluster.VertexGetNumber(v)
vertWeight = skinCluster.VertexGetWeight(v)
print "For Vertex Index %d, the weight is %d" % (vertIndex, vertWeight)
skinCluster.ClusterEnd()