Highlighted

assign new duration to existing comp

Explorer ,
Jun 03, 2020

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! 

Topics

Expressions, How to, Scripting

Views

690

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

assign new duration to existing comp

Explorer ,
Jun 03, 2020

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! 

Topics

Expressions, How to, Scripting

Views

691

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Guide ,
Jun 03, 2020

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Jun 03, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Guide ,
Jun 03, 2020

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Jun 03, 2020

Copy link to clipboard

Copied

I tried both...it's just not reacting at all. Tried to assign just a static value and still nothing. Next thing, I'll try a reboot :).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Guide ,
Jun 03, 2020

Copy link to clipboard

Copied

You are talking about scripting, and not expressions, yes?

 

Dan

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Jun 03, 2020

Copy link to clipboard

Copied

yes a jsx that reads the values from a text file.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Jun 03, 2020

Copy link to clipboard

Copied

I also noticed that if I have a 5 sec duration and set a 10 sec with the script, it will stop with an error. I need to be able to manipulate all these durations regardless of what the duration was previously....

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Guide ,
Jun 03, 2020

Copy link to clipboard

Copied

I think we need to see more of your script to be able to help.

 

Dan

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
efikrd LATEST
Explorer ,
Jun 04, 2020

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...