gemini Posted April 12, 2020 Share Posted April 12, 2020 (edited) Hi, Can a viewport (presp) transformation be stored and later restored back again. I was searching for the memory toolbars in python but I could not find. Thanks G Edited April 12, 2020 by gemini Quote Link to comment Share on other sites More sharing options...
gemini Posted April 14, 2020 Author Share Posted April 14, 2020 I wrote a simple script which would toggle the actual persp camera with a camera in hip. So just to make it clear i have to save the persp camera translation ( here i save it to an other cam ) but when i would toggle back to persp view ( set the stored cam and i use useDefaultCamera ) it does not refresh the view to the new camera. It remain at the old camera settings. That's why i tried the updates. Any Ideas ? #run_after_save = 0 import toolutils # Get the viewports from the sceneviewer scene_viewer = toolutils.sceneViewer() viewports = scene_viewer.viewports() persp_viewport = viewports[-1] look_trough_camera = persp_viewport.camera() if look_trough_camera == None: persp_viewport.saveViewToCamera( hou.node('/obj/cam1')) persp_viewport.setCamera( hou.node('/obj/cam_XX')) print 1 else: persp_viewport.setCamera( hou.node('/obj/cam1')) persp_viewport.draw() hou.ui.triggerUpdate() persp_viewport.useDefaultCamera() print 2 #hou.node('/obj/cam1').destroy() #import hdefereval #hdefereval.executeDeferred(hou.undos.performUndo) Quote Link to comment Share on other sites More sharing options...
gemini Posted June 21, 2020 Author Share Posted June 21, 2020 Any idea here ? Or other sollution ? Can a memory view cam (view not snapshot image) be used in python ? THX! Quote Link to comment Share on other sites More sharing options...
davpe Posted June 21, 2020 Share Posted June 21, 2020 you mean this? Quote Link to comment Share on other sites More sharing options...
gemini Posted July 10, 2020 Author Share Posted July 10, 2020 in python ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.