Permalink
Browse files

Updating docstring for playblast extraction plug-in

  • Loading branch information...
mottosso committed Oct 8, 2014
1 parent df65d4c commit 9f23d47204998e70b16805aa23974ed95af50c6c
Showing with 40 additions and 7 deletions.
  1. +40 −7 napoleon/plugins/extract_napoleon_review.py
@@ -9,14 +9,33 @@
@pyblish.api.log
class ExtractNapoleonReview(napoleon.plugin.Extractor):
"""Extract as image-sequence (png)"""
"""Extract as image-sequence (png)
Arguments:
startFrame (float): Start frame of output
endFrame (float): End frame of output
width (int): Width of output in pixels
height (int): Height of output in pixels
format (str): Which format to use for the given filename,
defaults to "qt"
compression (str): Which compression to use with the given
format, defaults to "h264"
offScreen (bool): Capture off-screen
maintainAspectRatio (bool): Whether or not to modify height for width
in order to preserve the current aspect ratio.
show (str): Space-separated list of which node-types to show,
e.g. "nurbsCurves polymeshes"
"""
families = ["napoleon.asset.review",
"napoleon.cache.review"]
hosts = ["maya"]
version = (0, 1, 0)
requires = (1, 0, 9)
representation = 'review'
def process_instance(self, instance):
"""Extract capture per camera"""
@@ -33,9 +52,10 @@ def process_instance(self, instance):
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'
off_screen = instance.data('offScreen') or False
format = instance.data('format') or 'qt'
compression = instance.data('compression') or 'h264'
off_screen = instance.data('offScreen', False)
maintain_aspect_ratio = instance.data('maintainAspectRatio', True)
# Get cameras in instance
cameras = [c for c in instance if cmds.nodeType(c) == 'camera']
@@ -47,17 +67,29 @@ def process_instance(self, instance):
# Set viewport settings
view_opts = napoleon.maya.capture.ViewportOptions()
view_opts.polymeshes = True
view_opts.nurbsSurfaces = True
view_opts.displayAppearance = "smoothShaded"
if 'show' in instance.data():
for nodetype in instance.data('show').split():
if hasattr(view_opts, nodetype):
setattr(view_opts, nodetype, True)
else:
self.log.warning("Specified node-type in 'show' not "
"recognised: %s" % nodetype)
else:
view_opts.polymeshes = True
view_opts.nurbsSurfaces = True
cam_opts = napoleon.maya.capture.CameraOptions()
with self.temp_dir() as temp_dir:
for camera in cameras:
# Ensure name of camera is valid
camera = pyblish.api.format_filename(camera)
temp_file = os.path.join(temp_dir, camera)
temp_file = os.path.join(temp_dir,
# self.representation,
instance.data('family'),
camera)
if format == 'image':
# Append sub-directory for image-sequence
@@ -74,6 +106,7 @@ def process_instance(self, instance):
viewer=False,
compression=compression,
off_screen=off_screen,
maintain_aspect_ratio=maintain_aspect_ratio,
viewport_options=view_opts,
camera_options=cam_opts)

0 comments on commit 9f23d47

Please sign in to comment.