How do you go about making primitives face the active viewport camera? I know the primitive SOP has a look at parameter for this but could not find anything to tie it to the active viewport
I am basically using a font SOP to display some info, but I need this info to always face the user
Thank you in advance!
Viewport facing primitives
4129 6 2- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- silvina
- Staff
- 181 posts
- Joined: July 2005
- Offline
- koen
- Member
- 789 posts
- Joined: April 2020
- Offline
if the geometry is only to inform the user, perhaps a viewport overlay is a better option:
http://www.sidefx.com/docs/houdini11.0/rendering/cameratips [sidefx.com] ?
Cheers,
Koen
http://www.sidefx.com/docs/houdini11.0/rendering/cameratips [sidefx.com] ?
Cheers,
Koen
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- graham
- Member
- 1904 posts
- Joined: Nov. 2006
- Offline
It is quite easy to extract the view transform from a viewport using Python. On thing you could do is use something like the attached quick pass at an asset.
The object, ViewerTransform, allows you to select a viewer and viewport that exists on the desktop and use that viewers transformation as an object location. You can then use that object to drive your lookat parameters.
This method has a downside as it only gets the transform from the view when the operator is cooked, not when you modify the viewport. There is a button on the asset that will cause it to recook but that is not always idea.
An option would be to use Houdini's integrated UI event loop callback to recook the object whenever the interface is idle. Using this you can get a more interactive (not completely smooth however) response.
def refreshViewTransform():
hou.node(“/obj/viewerxform1”).cook(True)
hou.ui.addEventLoopCallback(refreshViewTransform())
The object, ViewerTransform, allows you to select a viewer and viewport that exists on the desktop and use that viewers transformation as an object location. You can then use that object to drive your lookat parameters.
This method has a downside as it only gets the transform from the view when the operator is cooked, not when you modify the viewport. There is a button on the asset that will cause it to recook but that is not always idea.
An option would be to use Houdini's integrated UI event loop callback to recook the object whenever the interface is idle. Using this you can get a more interactive (not completely smooth however) response.
def refreshViewTransform():
hou.node(“/obj/viewerxform1”).cook(True)
hou.ui.addEventLoopCallback(refreshViewTransform())
Graham Thompson, Technical Artist @ Rockstar Games
- axebeak
- Member
- 51 posts
- Joined: Oct. 2006
- Offline
I think you can also use (a really simple) GLSL material for this.
See attached scene (requires H11).
But it seems this only works properly while in Smooth Shaded view - for Smooth Wire Shaded you'll get a wireframe “ghost” of your geometry, Wireframe mode will simply display untransformed object…
But anyway, just an idea.
See attached scene (requires H11).
But it seems this only works properly while in Smooth Shaded view - for Smooth Wire Shaded you'll get a wireframe “ghost” of your geometry, Wireframe mode will simply display untransformed object…
But anyway, just an idea.
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
-
- Quick Links