flame: adding batch utils

for creating batch in desktop
This commit is contained in:
Jakub Jezek 2022-02-18 22:24:37 +01:00
parent 0b2ceec450
commit 8dcc2eabff
No known key found for this signature in database
GPG key ID: D8548FBF690B100A

View file

@ -0,0 +1,37 @@
import flame
def create_batch(name, frame_start, frame_end, **kwargs):
schematicReels = ['LoadedReel1']
shelfReels = ['ShelfReel1']
handle_start = kwargs.get("handleStart")
handle_end = kwargs.get("handleEnd")
if handle_start:
frame_start -= handle_start
if handle_end:
frame_end += handle_end
# Create batch group with name, start_frame value, duration value,
# set of schematic reel names, set of shelf reel names
flame.batch.create_batch_group(
name,
start_frame=frame_start,
duration=frame_end,
reels=schematicReels,
shelf_reels=shelfReels
)
if kwargs.get("switch_batch_tab"):
# use this command to switch to the batch tab
flame.batch.go_to()
comp = flame.batch.create_node("Comp")
writeFile = flame.batch.create_node("Write File")
# connect nodes
flame.batch.connect_nodes(comp, "Result", writeFile, "Front")
# sort batch nodes
flame.batch.organize()