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.
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).
frameIncrement()
→ int
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 ill 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).
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.
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)
Turn on depth of field rendering to simulate focus.
useDepthOfField()
→ bool
Query if depth of field rendering is on.
depthOfFieldFromCamera(use_camera)
Set if the depth of field parameters (focusDistance
, aperture
, fStop
)
are sourced from a camera (True
) or the flipbook dialog settings
(False
).
depthOfFieldFromCamera()
→ bool
Query if the depth of field parameters (focusDistance
, aperture
,
fStop
) are sourced from a camera (True
) or the flipbook dialog settings
depthOfFieldQuality(num_images)
Set the number of camera positions to use to simulate depth of field. Higher values produces a better looking blur, but also increases rendering time.
depthOfFieldQuality()
→ double
Return the number of images rendered to simulate depth of field blur.
focusDistance(distance)
Set the default focus distance, the distance from the camera where objects
are perfectly in focus. This is not used if depthOfFieldFromCamera
is True
.
focusDistance()
→ double
Query the focus distance setting, the distance from the camera where objects are perfectly in focus.
aperture(aperture)
Set the default aperture. This is not used if depthOfFieldFromCamera
is True
.
aperture()
→ double
Query the default aperture setting.
fStop(f_stop)
Set the default f-stop setting. This is not used if depthOfFieldFromCamera
is True
.
fStop()
→ double
Query the f-stop setting.
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.