- Posts: 1
- Joined: Wed Dec 08, 2021 10:51 pm
- Real Name: Aaron Fisher
I have spent wayy too long trying to figure out the answer myself and I've gotten nowhere. I've been trying to better understand how the Simple Expression scripting works but have not been able to find a ton of resources outside the Scripting Guide for Fusion 8.
All I want to do is programmatically toggle back and forth between 2 clips based on the current frame. So V2 has opacity=1 for 10 frames, then the opacity moves to 0 for 10 frames so V1 is showing underneath. I know I can do this by cutting the clip myself but I need to do this often and across 20+ minutes of footage so manually would take forever.
So far I've figured out that I can get the current frame with
So a couple things about my pseudo-code. I'm pretty sure this IS NOT the proper formatting to be using in Resolve/LUA. However I'm new to LUA and Resolve so I'm pretty sure I just need to know how to "say" this in the right formatting.
If the above code doesn't work what I'm really doing is asking "If the current frame - 25 is < 0 then add 25 to myFramesVar and toggle the Opacity to 0 if it's currrently 1 or 1 if it's currently 0.
Expectation is that every 25 frames the opacity toggles itself and now I have a reusable method to strobe a clip above another.
Thank you for any help anyone can provide.
All I want to do is programmatically toggle back and forth between 2 clips based on the current frame. So V2 has opacity=1 for 10 frames, then the opacity moves to 0 for 10 frames so V1 is showing underneath. I know I can do this by cutting the clip myself but I need to do this often and across 20+ minutes of footage so manually would take forever.
So far I've figured out that I can get the current frame with
- Code: Select all
time
- Code: Select all
myFramesVar = 25;
myOpacityVar = 1;
If (time - myFramesVar < 0){
myFramesVar = myFramesVar+ 25;
If (myOpacityVar = 1){
myOpacityVar = 0;
Else{myOpacityVar = 1;
}
So a couple things about my pseudo-code. I'm pretty sure this IS NOT the proper formatting to be using in Resolve/LUA. However I'm new to LUA and Resolve so I'm pretty sure I just need to know how to "say" this in the right formatting.
If the above code doesn't work what I'm really doing is asking "If the current frame - 25 is < 0 then add 25 to myFramesVar and toggle the Opacity to 0 if it's currrently 1 or 1 if it's currently 0.
Expectation is that every 25 frames the opacity toggles itself and now I have a reusable method to strobe a clip above another.
Thank you for any help anyone can provide.