Viewport capture package


#1

One of the more common data to extract from a work file is some kind of preview without rendering. This could be in the form of an image, image sequence or video file.
Basically this is playblasting in Maya terms, but I would suggest that this package could be extend to generating thumbnails similar to the Snipping tool in Windows for a more generalized thumbnail creation.

Selection

This would be which objects to display when capturing the viewport. I see this in Maya being implemented for object-sets, display layers and individual transform tagging.

Configuration

The only configurable part of this I can think of, would be overlay of meta-data. I don’t know how other DCCs are supporting this, but in Maya it would be HUD-displays. I don’t know though whether this is something worth looking into?

Extraction

I would suggest there to be three extractors (possibly per host), one for each data type; image, image sequence and video. These would be un-toggled by default, and the user can extract them by choice.
There is also the option of having a configuration selector where you could choose what to extract to.

@marcus has an excellent start on this in the Napoleon package; https://github.com/pyblish/pyblish-napoleon/blob/master/napoleon/maya/capture.py


#2

Napoleon also uses that module in a plug-in.

The basic use is this.

  1. Gather nodes to playblast in an object set
  2. Put one or more cameras in there
  3. Publish

The objects are isolated prior to each playblast, and each camera produces a single image, image sequence or film, depending on user-defined properties on the set.

For example, if the attribute startFrame exists on the set, it is used in-place of the current start frame in the scene, and then the same for format and compression.

The assignments and defaults values look like this.

width = instance.data('width') or default_width
height = instance.data('height') or default_height
start_frame = instance.data('startFrame') or current_min_time
end_frame = instance.data('endFrame') or current_max_time
format = instance.data('format') or 'image'
compression = instance.data('compression') or 'png'

Usage wise, it means that for whatever you would like to playblast, say a character, an animation, or just the face of a character, create an object set per output, with one or more cameras and publish.


#3

Just remembered that capture.py also has it’s own project repository and documentation.