Get GfCamera from viewport and shoot ray to intersect stage?

   350   1   0
User Avatar
Member
23 posts
Joined: March 2020
Offline
Heyja,

I was wondering if it's possible to grab the persp camera from the current viewport as a Usd.Gf.Camera.

Essentially what I wanna do is build a radial menu with most common tools. I work in environments so we'll place assets a lot. What I'm thinking of doing is

1) grab the 2d position of the current radial menu or mouse if I can't get the position of the menu
2) shoot a ray into the stage
3) get the 3d position where the ray intersects
4) place a new node with its transforms set to that hit

I'd assume essentially what you're doing with your snapping tools. Do I have to do that in c++ and hydra or is there any way I can tap into that with python?

cheers,
Florens
User Avatar
Member
23 posts
Joined: March 2020
Offline
Think I found a lot of hints in here. Will give this a go and see if it gets me there.

https://www.sidefx.com/docs/houdini/hom/hou/GeometryViewport.html [www.sidefx.com]
Edited by florens - Nov. 12, 2024 00:06:33
  • Quick Links