Limiting Number of Frames per Scene

Hey Everyone,

Within our animation pipeline, we need to keep scenes cut on an even number of frames. Is there a way to limit extending lengths of panels in a scene to total an even number?
This would really help our work flow!

Best,

Nicole

Good morning Nicole,

I created a script the other day allowing you to add 2 buttons to your Scripting toolbar to increase and reduce duration on even frames.

To add a script, you can see the documentation here:

And here is the script. I hope this helps!

Marie-Eve

function up2Frames(){

``````//var init
var sm = SelectionManager();
var sbm = StoryboardManager();
var panel = sm.getPanelSelection();

//Loops through the selected panels.
for(n = 0; n < panel.length; n++){

//Gets the panel duration
var duration = sbm.getPanelDuration(panel[n]);

//checks if the frame is divisble by 2.
if(duration % 2 === 0 ){

//jumps to the next 2 frames
sbm.setPanelDuration(panel[n], duration + 2);

}else{

//Moves to the next multiple of 2
sbm.setPanelDuration(panel[n], Math.ceil(duration/2.0) * 2);

}//END OF IF

}//END OF FOR
``````

}//END OF FUNCTION

function down2Frames(){

``````//var init
var sm = SelectionManager();
var sbm = StoryboardManager();
var panel = sm.getPanelSelection();

//Loops through the selected panels.
for(n = 0; n < panel.length; n++){

//Gets the panel duration
var duration = sbm.getPanelDuration(panel[n]);

//checks if the frame is divisble by 2.
if(duration % 2 === 0 ){

//jumps back 2 frames
sbm.setPanelDuration(panel[n], duration - 2);

}else{

//Moves back to the previous multiple of 2
sbm.setPanelDuration(panel[n], Math.floor(duration/2.0) * 2);

}//END OF IF

}//END OF FOR
``````

}//END OF FUNCTION