Hello all,
I am trying to automate generating flipbooks and resulting movies a little.I was thinking of creating a shelf command to do this.
I have found the hou.RopNode in the HOM reference, but not an easy to understand way to acces flipbook functionality through python. Is this available? (Setting some of the flipbook parameters and launching a opengl render.)?
Thanks,
Koen
Python acces to flipbook
9067 3 1- koen
- Member
- 789 posts
- Joined: April 2020
- Offline
- mark
- Staff
- 2593 posts
- Joined: July 2005
- Offline
koen
Hello all,
I am trying to automate generating flipbooks and resulting movies a little.I was thinking of creating a shelf command to do this.
I have found the hou.RopNode in the HOM reference, but not an easy to understand way to acces flipbook functionality through python. Is this available? (Setting some of the flipbook parameters and launching a opengl render.)?
Thanks,
Koen
I think the only way is to call:
hou.hscript('viewwrite …')
but I could be wrong.
- koen
- Member
- 789 posts
- Joined: April 2020
- Offline
Thanks,
I think for now that is the only way. I found a hou.GeometryViewport.saveFlipbook() function, but that is not implemented yet.
I got a script working. However, finding the viewport to use, needs a little magic. Here is some code:
import toolutils
#Get the current Desktop
desktop = hou.ui.curDesktop()
# Get the scene viewer
scene_view = toolutils.sceneViewer()
#check of we are good to go
if scene_view is None or scene_view.type() != hou.paneTabType.SceneViewer:
raise hou.Error(“No scene view available to playblast.”)
# Get the current viewport
viewport = scene_view.curViewport()
# Now build the name of the view required in the viewwrite command, this
# is a little bit of magic, but is all procedural, except for the “world”
# part…
view = desktop.name() + ‘.’ + scene_view.name() + ‘.world.’ + viewport.name()
The sceneViewer() function just returns the first scene view it finds, not necessarily the current one. And once I get the viewport. I would love a function like viewport.fullName() to get the complete path. Is something like that available?
Thanks,
Koen
I think for now that is the only way. I found a hou.GeometryViewport.saveFlipbook() function, but that is not implemented yet.
I got a script working. However, finding the viewport to use, needs a little magic. Here is some code:
import toolutils
#Get the current Desktop
desktop = hou.ui.curDesktop()
# Get the scene viewer
scene_view = toolutils.sceneViewer()
#check of we are good to go
if scene_view is None or scene_view.type() != hou.paneTabType.SceneViewer:
raise hou.Error(“No scene view available to playblast.”)
# Get the current viewport
viewport = scene_view.curViewport()
# Now build the name of the view required in the viewwrite command, this
# is a little bit of magic, but is all procedural, except for the “world”
# part…
view = desktop.name() + ‘.’ + scene_view.name() + ‘.world.’ + viewport.name()
The sceneViewer() function just returns the first scene view it finds, not necessarily the current one. And once I get the viewport. I would love a function like viewport.fullName() to get the complete path. Is something like that available?
Thanks,
Koen
- schiho
- Member
- 101 posts
- Joined: Dec. 2012
- Offline
-
- Quick Links