[Maya-Python] Re: Bug with MSyntax?

2009-06-03 Thread Dean Edmonds
On Tue, Jun 2, 2009 at 18:49, AK Eric wrote: > > If I re-order the .addFlag's, whichever one is listed first won't be > captured.  So if I list the radius first, anything I pass in via -r or > -radius simply won't be seen. How are you determining that is it not "seen"? Does Maya give you an err

[Maya-Python] New reimport module

2009-06-03 Thread peteshinners
I've been testing some new Python reimport code. One of the goals of this was to get python code changes to work in a running Maya session. It also has a convenient function to locate all modules that have changed on disk. I've gotten good feedback from friends, now I'm looking for a wider audien

[Maya-Python] Re: normal vectors from torus Mesh

2009-06-03 Thread Dimitry
Hi Chad, thank you for you help! I checked the docs, but i'm still confused: i can get points(arrMesh.getPoint(i)) from vertexes, but the normalvector calculated(i suppose) from middle of a meshFace, so i need the middle point from meshface like arrMesh.getVertexNormal(i) arrMesh.getVertexNormalCo

[Maya-Python] Re: normal vectors from torus Mesh

2009-06-03 Thread Ofer Koren
you could get the position of all surrounding vertices and average them together to get the face center: from operator import add center = reduce(add, arrMesh.getPoints()) / arrMesh.polygonVertexCount() - Ofer www.mrbroken.com On Wed, Jun 3, 2009 at 6:05 AM, Dimitry wrote: > > Hi Chad, > than

[Maya-Python] Re: normal vectors from torus Mesh

2009-06-03 Thread Dimitry
Hi Ofer! thank you for the reply! can you please describe this method(from operator import add) how can you divide array of points by int? if i'm using arrMesh.getFaceNormalIds(faceIndex=1) i can get array of 4 vertexes(because my mesh is rectangle) [0, 1, 2, 3], but how i can get the middle po

[Maya-Python] Re: normal vectors from torus Mesh

2009-06-03 Thread Dimitry
ok i got it for item in arrCount: objFace=arrMesh.getPolygonVertices(arrCount[item]) pt1=arrMesh.vtx[objFace[0]].getPosition() pt2=arrMesh.vtx[objFace[2]].getPosition() centerPt=[ (pt1.x+pt2.x)/2,(pt1.y+pt2.y)/2,(pt1.z+pt2.z)/2 ] thank you Ofer and Chad for great

[Maya-Python] Re: normal vectors from torus Mesh

2009-06-03 Thread Dimitry
Ofer, Chad, but anyway it's interested how it's possible to get mesh middle point - centroid of each poly in a mesh it is possible to get it in the similar way as arrMesh.f[0].getNormal () arrMesh.f[0].centroid() - something like this? all the best! Dimitry --~--~-~--~~~

[Maya-Python] crash when selecting edges of a newly made subd

2009-06-03 Thread barnabas79
Just a FYI: # Note - the following commands must be executed all at once in order to cause a # crash. If you execute each command one at a time, no crash will occur. import maya.cmds as cmds polyCube = cmds.polyCube()[0] subd = cmds.polyToSubdiv(polyCube)[0] select(subd + '.sme[*][*]') --~--~--

[Maya-Python] Re: normal vectors from torus Mesh

2009-06-03 Thread Ofer Koren
The nice thing about using pymel is that it returns objects that usually support common operations in a more intuitive form.So in this instance meshFace.getPositions() returns a list of pymel Vector objects, which support operations such as addition, scalar division and multiplications (so you don'