abstractfactory/maya-capture

Workaround Maya error when using raw frame numbers with only start and end frame

Closed this issue · 0 comments

Problem

When using raw frame numbers with maya.cmds.playblast and only a start and end frame supplied instead of explicit frames Maya prints an error.

To reproduce:

import maya.cmds as mc

mc.playblast(viewer=False, startTime=2, endTime=9, format="image", compression="png", rawFrameNumbers=True)
# Error: -rawFrameNumber option must be used with at least one -frame flag, ignoring -rawFrameNumber. # 

Proposal

We can workaround this quirky behavior by making frames explicit when raw_frame_numbers = True and no frames are supplied:

#pseudocode
    if raw_frame_numbers and frame is None:
        frame = range(int(start_frame), int(end_frame) + 1)