Even in earlier versions, it was still required, in the sense that if you
wanted to avoid random crashes, you had to do it - I think maya2011 just
increased the probability of those random crashes occurring (which, in this
case, is actually a good thing...)

- Paul

On Fri, May 14, 2010 at 11:19 AM, Brandon Harris <[email protected]>wrote:

> Yes, seems that older versions of maya didn't mind the lack of
> createFromInt() but 2011 seems to require that. I've adjusted the tool
> to work like the example below when it comes to using MScriptUtil.
>
> create MScriptUtil
> allocate space for it
> point it at a data type
> pass the pointer into function
> get the value of what the pointer is looking at.
>
>
> import maya.OpenMaya as openMaya
> sel=openMaya.MSelectionList()
> openMaya.MGlobal().getActiveSelectionList(sel)
> path=openMaya.MDagPath()
> obj=openMaya.MObject()
> sel.getDagPath(0, path, obj)
> compItr = openMaya.MItSurfaceCV(path, obj)
> while not compItr.isDone():
>    u = openMaya.MScriptUtil()
>     u.createFromInt(100)
>    uPtr = u.asIntPtr()
>    v = openMaya.MScriptUtil()
>    v.createFromInt(100)
>     vPtr = v.asIntPtr()
>    compItr.getIndex(uPtr, vPtr)
>     print openMaya.MScriptUtil().getInt(uPtr)
>    print openMaya.MScriptUtil().getInt(vPtr)
>    compItr.next()
>
> --
> http://groups.google.com/group/python_inside_maya
>

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to