The viewport flipbook has a set of options beyond the Display Options provided by the viewport itself. This object contains all these settings.
-
Use hou.SceneViewer.flipbookSettings to get this object representing the current flipbook settings for the viewer. Changing the options on this object changes the settings for future interactive flipbooks generated from the viewer.
-
You can also pass the settings object directly to hou.SceneViewer.flipbook to generate a flipbook using the current settings.
-
To generate a flipbook using custom settings, first use hou.SceneViewer.flipbookSettings to get the current settings, and call hou.FlipbookSettings.stash to create a copy (so changing the options won’t affect the viewer’s interactive options). Then modify the settings and pass the object to hou.SceneViewer.flipbook.
# Copy the viewer's current flipbook settings flipbook_options = scene.flipbookSettings().stash() # Change the settings however you need # (for example, set the frame range and output filename) flipbook_options.frameRange( (frame, frame) ) flipbook_options.output(filename) # Generate the flipbook using the modified settings scene.flipbook(scene.curViewport(), flip_options)
Methods ¶
Copying ¶
stash()
→ hou.FlipbookSettings
Return a new copy of this FlipbookSettings object. Changes to this new
object will not update the flipbook dialog, but can be passed to
hou.SceneViewer.flipbook()
as the settings to use.
copy(from_settings)
Copy all settings in from_settings
into this object.
File settings ¶
outputToMPlay(out_mplay)
Send images to an interactive MPlay sesion.
outputToMPlay()
→ bool
Query if images are being sent to an interactive MPlay sesion.
output(out_name)
Set the filename sequence to render directly to files (for example, "flip$F4.png"
). This can be used in conjunction with outputToMPlay
to render simulataneously to MPlay and a file sequence.
output()
→ str
The current output destination for flipbooking.
audioFilename()
→ str
Set the pathname of the audio file to use in the flipbook.
audioFilename(audio_file)
The current audio file used by the flipbook.
Resolution settings ¶
useResolution(use_res)
When on, use the resolution defined in the flipbook dialog for output
images. This can be further scaled by the outputZoom
. When off, the
current size of the viewport is used.
useResolution()
→ bool
Query if the resolution is defined by the flipbook dialog (True
) or
by the current size of the viewport (False
).
resolution(image_resolution)
Set the resolution of images to render. image_resolution
must be a tuple
of 2 ints, width and height, and each must be greater than one.
resolution()
→ tuple of int
Returns a 2-tuple of ints representing the width and height of the
flipbook dialog image output resolution. This is not used unless
useResolution
is enabled.
useSheetSize(use)
When on, multiple frames are arranged in a grid to form the output image.
Use sheetSize
to set or query the grid arrangement.
useSheetSize()
→ bool
Query if the viewport captures will be arranged into a sheet (True
) or
each frame will produce a different flipbook image (False
).
sheetSize(sheet_size)
Set the grid arrangement of frames in the output image, when the flipbook
is set to use the sheet size. sheet_size
must be a tuple of 2 integers,
columns and rows, and each must be greater than zero.
sheetSize()
→ tuple of int
Returns a 2-tuple of ints representing the number of columns and rows of
frames in each output image. This is not used unless useSheetSize
is
enabled.
cropOutMaskOverlay(crop_mask)
When enabled, the camera area is cropped out. This is only needed if the viewport resolution doesn’t match the aspect ratio of the camera.
cropOutMaskOverlay()
→ bool
Query if the resulting image will be cropped to the camera area.
Frame settings ¶
frameRange(range)
Set the frame range of the flipbook. range
is a tuple of 2 ints containing
the start and end frame.
frameRange()
→ tuple of double
The current frame range of the flipbook, as a tuple of 2 ints (start, end).
frameIncrement(increment)
Set the frame increment of the flipbook (normally 1.0).
frameIncrement()
→ double
The current frame increment of the flipbook.
appendFramesToCurrent(enable)
When enabled, new frames are appended to the existing flipbook instead of overwriting the image with the corresponding frame.
appendFramesToCurrent()
→ bool
The current state of the flipbook append mode, either Append (True) or Overwrite (False).
scopeChannelKeyframesOnly(enable)
When enabled, only frames with scoped keyframes are rendered.
scopeChannelKeyframesOnly()
→ bool
The current state of scoped keyframe mode.
audioFrameStart(start)
Set the start frame for the audio file. Together with audioTimeOffset
,
this is used to synchronize the images with the audio. audioTimeOffset
seconds will be synchronized with audioFrameStart
frames.
audioFrameStart()
→ double
The frame where the audio will be playing audioTimeOffset
seconds.
audioTimeOffset(time)
Sets the time offset of the audio file. Together with audioFrameStart
this is used to synchronize the images with the audio. audioTimeOffset
seconds will be synchronized with audioFrameStart
frames.
audioTimeOffset()
→ double
The audio time that will be playing at audioFrameStart
frames.
leaveFrameAtEnd(end)
When enabled, the playbar frame is left at the last frame rendered by the flipbook. When disabled, the frame the playbar was on prior to the flipbook is restored.
leaveFrameAtEnd()
→ bool
Query if the playbar frame is being left at the last frame (True) or restored to the previous frame (False).
fromAudioPanel(fromaudiopanel)
Set the flipbook setting to use the audio settings from the Audio Panel. This overrides audioTimeOffset, audioFrameStart and audioFile.
fromAudioPanel()
→ bool
When enabled, the flipbook gets it’s audio settings from the Audio Panel.
Visibility settings ¶
visibleObjects(visible)
Set the visibility list for objects. Only those objects matching the list will be rendererd. Wildcards are accepted (eg. “/obj/geo*”).
visibleObjects()
→ str
The current visibility list for objects to be rendered.
visibleTypes(flipbookObjectType)
Filter visible objects by their object type.
Visible
Show all visible object types as set in the Visibility menu.
GeoOnly
Show only geometry objects.
GeoExcluded
Show all visible object types except geometry objects.
AllObject
Show all object types, ignoring the visible object types in the Visibility menu.
visibleTypes()
→ hou.flipbookObjectType
The current visible object types.
Look settings ¶
beautyPassOnly(enable)
Allows everything in the viewport to be rendered (False), or just the user geometry (True). When the beauty pass is rendered, a 16b linear image is produced without any handles, grids, guides, and decorations. Otherwise, ab 8b, 2.2 gamma image is produced of the entire contents of the viewport.
beautyPassOnly()
→ bool
The current state of the beauty pass render flag.
renderAllViewports(all_views)
Render all visible viewports (True), or only the currently selected one.
renderAllViewports()
→ bool
Render all visible viewports (True), or only the currently selected one.
backgroundImage(image_file)
Set the pathname of the background image or images.
backgroundImage()
→ str
The pathname of the background image or images.
overrideGamma(override)
When true, explicitly apply a gamma of gamma
to the resulting images.
This is normally not needed since the gamma can be specified in the
viewport.
overrideGamma()
→ bool
The current state of the gamma override.
gamma(gamma)
The gamma value to be applied to the resulting flipbook images, if
overrideGamma
is True.
gamma()
→ double
The current gamma value.
overrideLUT(override)
When true, explicitly apply a LUT (lookup table) to the resulting images. This is normally not needed since the LUT can be specified in the viewport.
overrideLUT()
→ bool
The current state of the LUT override.
LUT(lut_file)
Sets the filename of the LUT applied to the resulting images, if
overrideLUT
is enabled.
LUT()
→ str
The current LUT used for flipbooking.
setUseFrameTimeLimit(limit)
Enable the frame time limit for progressive renderers in LOPs.
useFrameTimeLimit()
→ bool
The frame time limit for progressive renderers in LOPs.
setFrameTimeLimit(t)
Set the frame time limit for progressive renderers in LOPs, in seconds. Once this is exceeeded the flipbook will advance to the next frame.
frameTimeLimit()
→ double
The frame time limit for progressive renderers in LOPs, in seconds. Once this is exceeeded the flipbook will advance to the next frame.
setUseFrameProgressLimit(limit)
Enable the frame progress limit for progressive renderers in LOPs.
useFrameProgressLimit()
→ bool
The frame progress limit for progressive renderers in LOPs.
setFrameProgessLimit(t)
Specify the frame progress limit for progressive renderers in LOPs, in percent. Once this is exceeeded the flipbook will advance to the next frame.
frameProgressLimit()
→ double
The frame progress limit for progressive renderers in LOPs, in percent. Once this is exceeeded the flipbook will advance to the next frame.
antialias(flipbookAntialias)
Sets the antialiasing level of the flipbook:
-
hou.flipbookAntialias.UseViewportSetting
: Use the current viewport setting. -
hou.flipbookAntialias.Off
: No antialiasing. -
hou.flipbookAntialias.Fast
: Minimal 2-sample antialiasing. -
hou.flipbookAntialias.Good
: 4-sample antialiasing. -
hou.flipbookAntialias.HighQuality
: 8-sample antialiasing.
antialias()
→ hou.flipbookAntialias
Query the current flipbook antialiasing setting:
-
hou.flipbookAntialias.UseViewportSetting
: Use the current viewport setting. -
hou.flipbookAntialias.Off
: No antialiasing. -
hou.flipbookAntialias.Fast
: Minimal 2-sample antialiasing. -
hou.flipbookAntialias.Good
: 4-sample antialiasing. -
hou.flipbookAntialias.HighQuality
: 8-sample antialiasing.
MPlay settings ¶
sessionLabel(label)
Sets the session label when flipbooking to MPlay. This can be used to route flipbooks to different MPlay sessions. Flipbooks with the same label will go to the same MPlay flipbook session.
sessionLabel()
→ str
The current flipbook session label.
blockEditing(enable)
When enabled, block editing mode is enabled in MPlay. This allows the
frames to be moved in MPlay and any changes exported back to Houdini.
scopChannelKeyframesOnly
must be enabled as well.
blockEditing()
→ bool
The current state of block editing mode.
Simulation settings ¶
initializeSimulations(enable)
When enabled, all simulations are re-initialized when the flipbook begins.
initializeSimulations()
→ bool
The current state of simulation initialization. True
indicates that
simulations will be reset, and False
indicates that any cached results
will be used.
Motion blur settings ¶
useMotionBlur(enable)
Turn on motion blur. Motion blur blends multiple subframes together to produce the blurring effect. Flipbook generation will be slower because of this.
useMotionBlur()
→ bool
Query if motion blur is enabled.
motionBlurSegments(frames)
Set the number of subframes to be used when doing motion blur. More subframes produces better results, but with additional rendering time.
motionBlurSegments()
→ int
Query the number of subframes currently used for motion blur.
motionBlurFrameRange(flipbookMotionBlurBias)
Set how the motion blur subframe window is chosen:
-
hou.flipbookMotionBlurBias.Centered
: Subframe range is centered around the currently rendering frame. -
hou.flipbookMotionBlurBias.Forward
: Subframe range starts at the currently rendering frame. -
hou.flipbookMotionBlurBias.Previous
: Subframe range ends at the currently rendering frame.
motionBlurFrameRange()
→ hou.flipbookMotionBlurBias
Query the subframe range for motion blur:
-
hou.flipbookMotionBlurBias.Centered
: Subframe range is centered around the currently rendering frame. -
hou.flipbookMotionBlurBias.Forward
: Subframe range starts at the currently rendering frame. -
hou.flipbookMotionBlurBias.Previous
: Subframe range ends at the currently rendering frame.
Camera settings ¶
shutterFromCamera(use_camera)
Set if the shutter is source from the camera (True
) or from the shutter
setting in the flipbook dialog (False
).
shutterFromCamera()
→ bool
Query if the shutter is sourced from the camera or the flipbook dialog.
shutter(frame_fraction)
Set the value of the camera shutter for motion blur. 1.0 represents a shutter of a full frame.
shutter()
→ double
Query the current camera shutter for motion blur.
useDepthOfField(enable)
Obsolete. Use the DOF settings in hou.GeometryViewportSettings
.
useDepthOfField()
→ bool
Obsolete. Use the DOF settings in hou.GeometryViewportSettings
.
depthOfFieldFromCamera(use_camera)
Obsolete. Use the DOF settings in hou.GeometryViewportSettings
.
depthOfFieldFromCamera()
→ bool
Obsolete. Use the DOF settings in hou.GeometryViewportSettings
.
depthOfFieldQuality(num_images)
Obsolete. Use the DOF settings in hou.GeometryViewportSettings
.
depthOfFieldQuality()
→ double
Obsolete. Use the DOF settings in hou.GeometryViewportSettings
.
focusDistance(distance)
Obsolete. Uses the setting on the camera.
focusDistance()
→ double
Obsolete. Uses the setting on the camera.
aperture(aperture)
Obsolete. Uses the setting on the camera.
aperture()
→ double
Obsolete. Uses the setting on the camera.
fStop(f_stop)
Obsolete. Uses the setting on the camera.
fStop()
→ double
Obsolete. Use the DOF settings in hou.GeometryViewportSettings
.
outputZoom(zoom)
Set the output zoom level. Valid settings are 100, 75, 50, and 25.
outputZoom()
→ int
Query the output zoom level. Valid settings are 100, 75, 50, and 25.