abstractfactory/maya-capture

capture does not include active sound from timeline in playblast

Closed this issue · 2 comments

Problem

By default a playblast ignores the sound active in the timeline and there's also no way to enable it since the sound argument is not exposed.

Goal

To implement the sound parameter and maybe by default include the active sound in the timeline.

Allowing sound to be included in playblast is now possible with #53.

Nevertheless it still doesn't automatically include the active sound from the timeline. The question is do we want to? The cmds.playblast doesn't by default either, but I think a regular maya playblast does?

To include the active sound in the playblast currently one would have to:

import maya.mel as mel
import capture

time_control = mel.eval("$gPlayBackSlider = $gPlayBackSlider")
sound = mc.timeControl(time_control, q=True, sound=True) or None
capture.capture(sound=sound)

To ease it for users we could again provide a parse method yet it might be a bit too much, for example parse_active_sound. Or it could be returned along with parse_active_scene.

The current active sound is now included with parse_active_scene() with #58.

As such using those options will include the current sound file:

import capture
options = capture.parse_active_scene()
capture.capture(**options)

Or to only use the sound options

import capture
options = capture.parse_active_scene()
sound = options["sound"]
capture.capture(sound=sound)