mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
flame: adding batch utils
for creating batch in desktop
This commit is contained in:
parent
0b2ceec450
commit
8dcc2eabff
1 changed files with 37 additions and 0 deletions
37
openpype/hosts/flame/api/batch_utils.py
Normal file
37
openpype/hosts/flame/api/batch_utils.py
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue