-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add user defined time frame or frames #20
Comments
To elaborate a bit on this, this would be similar to printing specific pages in applications like Word as seen here: Here's a quick function I wrote that parses it similar to how Word does it (and how V-Ray specific frame render settings supports it). Note that this supports both comma import logging
import re
log = logging.getLogger(__name__)
def parse_frames(string):
"""Parse the resulting frames list from a frame list string.
Examples
>>> parse_frames("0-3;30")
[0, 1, 2, 3, 30]
>>> parse_frames("0,2,4,-10")
[0, 2, 4, -10]
>>> parse_frames("-10--5,-2")
[-10, -9, -8, -7, -6, -5, -2]
Args:
string (str): The string to parse for frames.
Returns:
list: A list of frames
"""
result = list()
for raw in re.split(";|,", string):
# Skip empty elements
value = raw.strip().replace(" ", "")
if not value:
if raw:
log.warning("Empty frame entry: '{0}'".format(raw))
continue
# Check for sequences (1-20) including negatives (-10--8)
sequence = re.search("(-?[0-9]+)-(-?[0-9]+)", value)
# Sequence
if sequence:
start, end = sequence.groups()
frames = range(int(start), int(end) + 1)
result.extend(frames)
# Single frame
else:
try:
frame = int(value)
except ValueError:
log.warning("Invalid frame description: '{0}'".format(value))
continue
result.append(frame)
return result |
Implemented with #25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The user should be able to playblast a combination of small frames and frame ranges:
Example : 1-20, 25; 50; 75, 100-150
from-to, increment;
This translates to:
The text was updated successfully, but these errors were encountered: