papsphilip
June 30, 2021 10:50:01
I have 80 variations of my geo. each one 48 frames of animation
i want to make a montage for every 4 variations and end up with 20 videos, instead of one huge video with all 80 variations animating. how can i partition my data so that i get that result?
The screenshot i have attached is what i don't want, which is all my variations animating in one montage sheet.
papsphilip
July 6, 2021 08:35:27
The solution i found if anyone is interested, was to use python processor node to rename my frames so that each frame sequence comes after the other and THEN use ffmpeg to generate a final video.
bhfx
July 7, 2021 02:59:58
Hi, care to share how you renamed your frames, or even show some code from your python processor? I'd like to do the same thing and could use some pointers. This would really be great!
Edit: Nevermind. Figured it out by myself. But many thanks for the hint!
papsphilip
July 7, 2021 09:26:56
this was the code i used inside the python processor
import os
import pdg
import re
for upstream_item in upstream_items:
new_item = item_holder.addWorkItem(parent=upstream_item)
#print(new_item.expectedInputResultData)
#get filepath
filepath = new_item.expectedInputResultData
#print(filepath)
#get filename
filename = filepath.rsplit('/',1)
if(filename.find('-')!=-1):
#get sequence number
pattern = "\-(.*?)\."
num = re.search(pattern, filename).group(1)
#get frame number
split_name = filename.split("-") #we split the filename on the dash
frame = split_name
#calculate new frame number for merged sequences
nframe = str(int(frame)+(int(num)*48)) # 48 is the total number of frames for each sequence
nfilepath = filepath.rsplit('/',1) + '/' + nframe + ".png"
os.rename(filepath,nfilepath)
and here are some screenshots of my setup. sorry its not a file but it will take a while to make a demo scene