Copy link to clipboard
Copied
Hi,
I am trying to set dynamic durations to my comps by passing the durations using array values.
So, I have this code:
myComp.workAreaDuration = myArray[0];
It compiles but it doesn't do anything...(yes, I have a value in the array 🙂 )
Any ideas what I am doing wrong..? Or any other ways to be able to achieve this?
Cheers!
Copy link to clipboard
Copied
This sets the work area duration to 5 seconds for me, as expected:
var myComp = app.project.activeItem;
var myArray = [5];
myComp.workAreaDuration = myArray[0];
I'm not sure what the issue is exactly...
Dan
Copy link to clipboard
Copied
Hi Dan,
I am actually creating dynamic comps and trying to assign different durations to them all inside one loop...
It might be a too adventurous idea... 🙂
I'll post the progress if I figure it out.
Thank you for checking that line for me...at least I know it's correct.
A.
Copy link to clipboard
Copied
OK, but I'd expect that you'd be assigning values to myComp.duration rather than the work area duration...
Dan
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You are talking about scripting, and not expressions, yes?
Dan
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I think we need to see more of your script to be able to help.
Dan
Copy link to clipboard
Copied
OK Dan,
I got it to work like this:
var myArray = [5];
var my_renderSettings = {
"Color Depth":"32 bits per channel",
"Quality":"Best",
"Effects":"All On",
"Time Span Duration":myArray[0],
"Time Span Start":"2.0"
};
app.project.renderQueue.item(1).setSettings(my_renderSettings);
All I needed was to be able to output the rendered files at the duration of the dynamic array.
I thought initially that it would be as simple as calling it "duration" and I guess that was where the confusion in my questions/issues started.
Thank you very much for being my chat pal 🙂 It really helped me.
Cheers,
A