• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

assign new duration to existing comp

Explorer ,
Jun 03, 2020 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

995

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
community guidelines
Community Expert ,
Jun 03, 2020 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

Votes

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
community guidelines
Explorer ,
Jun 03, 2020 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.

Votes

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
community guidelines
Community Expert ,
Jun 03, 2020 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

Votes

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
community guidelines
Explorer ,
Jun 03, 2020 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 :).

Votes

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
community guidelines
Community Expert ,
Jun 03, 2020 Jun 03, 2020

Copy link to clipboard

Copied

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

 

Dan

Votes

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
community guidelines
Explorer ,
Jun 03, 2020 Jun 03, 2020

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Explorer ,
Jun 03, 2020 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....

Votes

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
community guidelines
Community Expert ,
Jun 03, 2020 Jun 03, 2020

Copy link to clipboard

Copied

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

 

Dan

Votes

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
community guidelines
Explorer ,
Jun 04, 2020 Jun 04, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines