Ultimately I'm trying to create a scatter script.

I'm using the mfnMesh.getPointAtUV to get a world position from U,V
values on a surface. When I use a single float2 pointer it works
great.  The problem is that I want to generate an array of random U,V
values and iterate through this to find the world position for each
set of U,V values. I can't seem to figure out how to set up something
that will generate the correct pointers for each set of random U,V
values in my array.

I tried something like this, but ptrAry four copies of the same
pointer.

....
ptrArray = []
numObjs = 4
util = OpenMaya.MScriptUtil()

for obj in range(numObjs):
    util.createFromList ([random.uniform(0,1), random.uniform(0,1)],2)
    sys.__stdout__.write(('%s') %util)
    ptrArray .append(util.asFloat2Ptr())
....

I can see why this possibly wouldn't work, but I'm stumped as how to
do it correctly.

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to