How to create a Flipbook in Houdini using only the Python source editor?

1.1k Views Asked by At

I have a scene created in Houdini and I want to save that as a flipbook to a file location (my desktop for example) using only Python scripting in the python shell/source editor. I have read the sidefx website on creating a flipbook here, but I couldn't figure it out, specifically, I don't know what scene is referring to in that example. Here is what I have written in my source editor. When I call the function, Houdini just shuts down and I don't know why.

# create flipbook
fbsettings = toolutils.sceneViewer().flipbookSettings().stash()
fbsettings.output('$JOB/Desktop/test.avi')
fbsettings.outputToMPlay(0)
# Launch the flipbook
toolutils.sceneViewer().flipbook(viewport=None, settings=fbsettings, open_dialog=False)
2

There are 2 best solutions below

0
On

I have written a small snippet to create a flipbook. I hope this will help you.

NOTE : Make sure your path directory are correct based on operating system.

cur_desktop = hou.ui.curDesktop()
scene_viewer = hou.paneTabType.SceneViewer
scene = cur_desktop.paneTabOfType(scene_viewer)
scene.flipbookSettings().stash()
flip_book_options = scene.flipbookSettings()

flip_book_options.output('A:\\flipbook.$F4.jpeg') # Provide flipbook full path with padding.
flip_book_options.frameRange((0, 5)) # Enter Frame Range Here in x & y
flip_book_options.useResolution(1)
flip_book_options.resolution((1080, 720)) # Based on your camera resolution
scene.flipbook(scene.curViewport(), flip_book_options)
2
On

it´s the avi test it with "tmp.$F4.jpg"