Hey Sam,

This is actually on my todo list. If you happen to solve this, I would be
super happy if you would like to share the code.

Regards,
Fredrik


On Mon, Sep 22, 2014 at 8:20 PM, <[email protected]> wrote:

> Hello friends,
>
> i have a piece of code here in python which gives me the 2d viewpoint
> coords of the cursor whenever i click the mouse:
>
> ########################################
>
> import maya.cmds as cmds
>
> ctx = 'myCtx'
> def onPress():
>     print cmds.draggerContext(ctx, query=True, anchorPoint=True)
> if cmds.draggerContext(ctx, exists=True):
>     cmds.deleteUI(ctx)
> cmds.draggerContext(ctx, pressCommand=onPress, name=ctx,
> cursor='crossHair')
> cmds.setToolTo(ctx)
>
> #########################################
>
> What i need is to cast a ray whenever i click, coming from the viewpoint
> of the camera and using the 2d coordinates generated by this script to
> check for the intersection point on a poly mesh.
>
> Then i just want it to return the 3d xyz coords of that intersection point
>
> im pretty stuck with this. But im sure it can't be to extensive. I anyone
> can help i would be super happpyyyyyy!!!
>
> thanks,
> Sam
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/758864e0-0946-4126-939a-c1ba3bc21a48%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWNZCZXpLUpXMwQ_nb%3D9mAoG8kQgDgjPKUnTopup%2BV_Oqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to