Re: [Maya-Python] MMeshIntersector: Getting world position / matrix of point in object space

2018-08-01 Thread igo rov
Can you execute this: import maya.api.OpenMaya as om2 selList = om2.MGlobal.getActiveSelectionList() dag = selList.getDagPath(0) matr = dag.inclusiveMatrix() mesh = dag.child(0) meshIntersect = om2.MMeshIntersector() meshIntersect.create(mesh, matr) I get an error, because it won`t accept the "

Re: [Maya-Python] MMeshIntersector: Getting world position / matrix of point in object space

2018-08-01 Thread Luiz Amaral
You should at least pass the identity matrix like this meshIntersect.create(mesh, om2.MMatrix.identity) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, se

Re: [Maya-Python] MMeshIntersector: Getting world position / matrix of point in object space

2018-08-01 Thread Luiz Amaral
Try this matr = om2.MMatrix(dag.inclusiveMatrix()) meshIntersect.create(mesh, matr) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyth

Re: [Maya-Python] MMeshIntersector: Getting world position / matrix of point in object space

2018-08-01 Thread igo rov
...I tried what you wrote in your last sentence with inverse matrix, but may be its to late, I'm getting wrong results. I will try again tomorow, thanks 2018-08-02 0:44 GMT+02:00 igo rov : > Hi, > as for the missing Matrix parameter, there is this thread: > https://groups.google.com/forum/#!topic

Re: [Maya-Python] MMeshIntersector: Getting world position / matrix of point in object space

2018-08-01 Thread igo rov
Hi, as for the missing Matrix parameter, there is this thread: https://groups.google.com/forum/#!topic/python_inside_maya/axX7W8imeEU I have the same problems as described there, if I pass the matrix I will get this error: More keyword list entries (4) than format specifiers (2) But you are right

[Maya-Python] MMeshIntersector: Getting world position / matrix of point in object space

2018-08-01 Thread Luiz Amaral
Hey there, “ ‘Point’ Specifies the location for which to evaluate the closest point on the mesh. `point' is transformed using the matrix parameter passed to the create() method, so for example if your matrix maps world to object space, then `point' should be specified in world space.” You shou

Re: [Maya-Python] Catching maya's error ?

2018-08-01 Thread Virbhadra Gupta
Really that much simple. Thanks!!! -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To vi

Re: [Maya-Python] Catching maya's error ?

2018-08-01 Thread Marcus Ottosson
try: do_something()except Exception as e: cmds.warning(e) On Wed, 1 Aug 2018 at 21:19, Virbhadra Gupta wrote: > hello, > i have a code where i am using try and except > > ex: > > try: > do_something() > except: > cmds.warning("some error") > > function may give some error ex: "p

[Maya-Python] Catching maya's error ?

2018-08-01 Thread Virbhadra Gupta
hello, i have a code where i am using try and except ex: try: do_something() except: cmds.warning("some error") function may give some error ex: "pCube03 not found", "can't constraint pCube02" how can we catch that error message and use that in except as warning. -- You received this

Re: [Maya-Python] Re: MMeshIntersector: Getting world position / matrix of point in object space

2018-08-01 Thread igo rov
hi thanks, I thought I did this with "worldM = childMatr * matr". But I first tried to construct a matrix from "pos3d" in order to multiply the matrix. The code I posted, works somehow, but not what I expect: the locator jumps to a exposed point on the cube, but not on the nearest point to locat