PDA

View Full Version : API & getUvShellsIds


TITANius
11-24-2011, 11:08 AM
Hi guys!
Did anybody works with getUvShellsIds? Whats wrong with calculations that object
have a several different UVset's (I've got the value -1)?

There are code for check
import maya.OpenMaya as OpenMaya

SelectionList = OpenMaya.MSelectionList()
OpenMaya.MGlobal.getActiveSelectionList(SelectionList);
iter = OpenMaya.MItSelectionList(SelectionList, OpenMaya.MFn.kGeometric);

dagPath = OpenMaya.MDagPath()
component = OpenMaya.MObject()

UVShellArray ={}

while not iter.isDone():
UVSetNames=[]
iter.getDagPath(dagPath, component)
Mesh=OpenMaya.MFnMesh(dagPath)
Mesh.getUVSetNames(UVSetNames)

for UVSet in UVSetNames:
shells = OpenMaya.MScriptUtil()
shells.createFromInt(0)
shellsPtr = shells.asUintPtr()
UVShellArray[UVSet] = OpenMaya.MIntArray()
Mesh.getUvShellsIds(UVShellArray[UVSet], shellsPtr, UVSet)

print UVShellArray
iter.next()

There are result for plane with 3 UVsets:
http://i.imgur.com/y8xVJ.png

I've receive the next results if

current UVset - "map1"
{u'LightMap1': [0, 0, 0, 0], u'map1': [0, 0, 0, 0, 0, 0], u'LightMap': [0, 0, 0, 0, 0, 0, -1, -1]}
current UVset - "LightMap"
{u'LightMap1': [0, 0, 0, 0], u'map1': [0, 0, 0, 0, 0, 0], u'LightMap': [0, 0, 1, 0, 1, 1, 1, 0]}
current UVset - "LightMap1"
{u'LightMap1': [0, 0, 0, 0], u'map1': [0, 0, 0, 0, -1, -1], u'LightMap': [0, 0, 0, 0, -1, -1, -1, -1]}

Just one correct from third

Is the getUvShellsIds's calculations depends on current UV set?

What's wrong? How can i fix it?

CGTalk Moderation
11-24-2011, 11:08 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.