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

SetInPoint() For ProjectItem and TrackItem objects?? + How to edit Items in the tracks/ timeline?

Engaged ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

https://ppro-scripting.docsforadobe.dev/item/projectitem.html?highlight=setin

So I have been trying to read this + reading posts all over the forum from 2016 to now searching for specific needs I have, I figured I shall try this SetInPoint f...eature.

I saw it discussed here (https://community.adobe.com/t5/premiere-pro-discussions/scripting-bug-when-setinpoint-and-setoutpoin...)

Now I have no idea how this works, it seems we are applying the function to an item that IS NOT IN THE TRACKs, the project items are items that we see in the LIBRARY right?

 

I checked the "functions" of the trackitem object and I see no SETTER for the inPoint or OutPoint.

 

What I would like to do is the following:

- Be able to put the SAME clip in the tracks but in 2 different times, with differents ending and beginning points (those are called In and Out points I believe? Till now I am not sure what their role is),

 

So let's say I have a projectItem called "video1" that has a duration of 15 seconds.

I want to be able to add it to the video track:

    - Video track 1

however I want to only put the part [0,7]seconds from that clip.

Then, I would like to add the SAME CLIP again, in :

   - some track (or the some tack)

This time I want the part  [8,15]seconds of the clip or any variation I wish (for example  [3,6].

 

The OFFICIAL documentation for TRACK items (https://ppro-scripting.docsforadobe.dev/item/trackitem.html#methods) does not show any IN and OUT point SETTERS for the track items.

As for the project items, I am afraid changing their in and out points will affect ALL relative/related trackitems in the tracks maybe?

 

__

AS for final solution related to QE, which I have been searching for 1 full day (and more) reading posts from multiples years ago to now, to no longer working urls, to tools no longer existing, to youtube videos showing things that do not exist anymore, to chatGPT giving you code that does not work.. well.. it has been PURE PAIN, trying to understand any of it, not to forget obtaining the following cryptic text if you try to dig up too much:

function SomeFunctionAsSetStartingPoint() { [native code]  }, and if you open up the debugger up to several levels of inspecting variables it crashes the adobe software. It felt like.. drowning, trying to find answers and being answered with:

Bed30321077z973_1-1706542300629.png

(Just let the users do what they want to do and take their responsibilits, I don't want to go buy an extension to finance who knows who to try to understand somethign about qe, if qe is NOT SUPPORTED THEN THIS EXTENSION SHOULD BE ILLEGAL? https://exchange.adobe.com/apps/cc/108380/extendscript-developer-tools, WHy gate keep all this knowledge behind this extension?)

 

Anyway moving on, could anyone explain to me how to either:

1) Be able to add the SAME CLIP (project item) to the track twice OR MORE, with DIFFERENT DURATIONS and different starting points of the same clip, (sometimes I want first half of the clip, sometimes I want another part of the same clip, with smaller or bigger durations, and starting from the beginning of that same clip or from a another part of that same clip, etc), ?

2) Or how to CUT an existing clip in the tracks into PIECES and obtain from that differents other "clips/track items" etc?

Weither that is achieved with conventional API or any other method.

Starting to be desperate here. (Cf. drowning in the ocean)

TOPICS
SDK

Views

146

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

correct answers 1 Correct answer

Adobe Employee , Jan 29, 2024 Jan 29, 2024

> Now I have no idea how this works, it seems we are applying the function to an item that

> IS NOT IN THE TRACKs, the project items are items that we see in the LIBRARY right?


No Libraries required; projectItems are items that we see, in the project. 

> I checked the "functions" of the trackitem object and I see no SETTER for the inPoint or OutPoint.

trackItem.inPoint (and .outPoint) are read/write parameters; no setters necessary. 

>...put the SAME clip in the tracks but in 2 different times, wit

...

Votes

Translate

Translate
Adobe Employee ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

> Now I have no idea how this works, it seems we are applying the function to an item that

> IS NOT IN THE TRACKs, the project items are items that we see in the LIBRARY right?


No Libraries required; projectItems are items that we see, in the project. 

> I checked the "functions" of the trackitem object and I see no SETTER for the inPoint or OutPoint.

trackItem.inPoint (and .outPoint) are read/write parameters; no setters necessary. 

>...put the SAME clip in the tracks but in 2 different times, with differents ending

> and beginning points (those are called In and Out points I believe? Till now I

> am not sure what their role is)

For clarity's sake: There is no such thing as a 'clip', anywhere in PPro; there are only projectItems, and trackItems. So, to restate your request...It seems like you'd like to put the same projectItem into tracks as two different trackItems, with different start and end values (relative to their position within the sequence), and different in and out points (relative to the time span in the originating projectItem). Do I have that right? 

I want to be able to...

See PProPanel's example code, inserting new trackItems into tracks, based on a given projectItem.

>...does not show any IN and OUT point SETTERS for the track items.

Not necessary (as described above). Also potentially helpful; here's how to move an existing trackItem.

As for the project items, I am afraid changing their in and out points will affect

> ALL relative/related trackitems in the tracks maybe?


Your concern is appropriate, but no, changes to a projectItem's in/out points, has no effect on existing trackItems based on that projectItem. 

>AS for final solution related to QE...it has been PURE PAIN, trying to understand any of it

Precisely why QE DOM is 100% unsupported, and not-at-all recommended.

 

> to chatGPT giving you code that does not work..

I'm not sure why that would ever have been expected to succeed...?

WHy gate keep all this knowledge behind this extension?


I am unfamiliar with that extension. We're not gate-keeping anything. While QE DOM does exist, it is neither recommended or supported. 

1: Above, I've provided references to working sample code that show how to accomplish this. 

2: There is no such thing as a "cut", in the API. To accomplish that, you would adjust the start/end of the existing trackItem, then insert a new trackItem, referencing the appropriate time range from the source projectItem, and (presumably) occurring immediately (i.e., having start/end values that place it) before or after the previously existing trackItem.


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
Engaged ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

>>AS for final solution related to QE...it has been PURE PAIN, trying to understand any of it

>Precisely why QE DOM is 100% unsupported, and not-at-all recommended.

What was very difficult to grasp, was to see so many posts throughest the years doing the same thing we want to do, things not always available in the accepted docs, only to get denied with the imposisbility of getting more info (at least not here),

 

Thanks a lot for the answer.

 

>trackItem.inPoint (and .outPoint) are read/write parameters; no setters necessary. 

Interesting, thanks for pointing that out for me.

I actually went experimenting to see:

Here is my TrackItem:

Bed30321077z973_1-1706560730035.png

 

 

Initial Values:

clipsInTrack0.outPoint.seconds=>2.76

clipsInTrack0.end.seconds =>10

 

Testing the writing functions on .outPoint or and .end, for track items:

var time2 = new Time();
time2.seconds = parseFloat(300);
clipsInTrack0.end.seconds=time2.seconds; //does nothing it seems

=> result:

Bed30321077z973_2-1706561052580.png

 

Nothing.

Maybe the "item" cannot get to higher "values" than its max? Ok then lets try a lower value:

var time4 = new Time();
time4.seconds = parseFloat(2);
clipsInTrack0.end.seconds=time4.seconds; //does nothing it seems

REsult:

Bed30321077z973_3-1706561265149.png

 

Unphased!

Let's try again( hours are passing since first day I wanted to automate this)

var time2 = new Time();
time2.seconds = parseFloat(300);
clipsInTrack0.end=time2; //It finally worked!

Bed30321077z973_4-1706561415135.png

______

2)

OK that's for Start and End.

But what is this "inPoint" and "outPoint" concept again?

I tried modified its value with:

clipsInTrack0.outPoint=time2;

But NOTHING happened on the tracks/timelines. The trackItem remained as is!

 

__________

3)

Now I tried to experiment a bit on ProjectItems:

I tried to modify the inPoint and OuPoint

Not sure what happened.

Since I still don't know what are these "attributes" whatsoever.

 

While I am waiting to learn more from the classical accepted API (on this post), I will go explore (the other "side" option) in the meantime, to see what I can do aswell. It would be good to know every option of course (the options mentioned here and the options I mentioned on those pictures, the .. barrier)

 

 

>I am unfamiliar with that extension. We're not gate-keeping anything. While QE DOM does exist, it is neither recommended or supported.

I know but it remains a fact, that as for today, that "paid option" is the only way there is "it seems" to get consistant constant numerous info about QE. (It seems). Which "seems" like a "gate", the rest of the websites related to this type of info do not exist anymore (many of them) it seems.

Of course, this is just a feedback, which could be helpful for the future ("Cliens feelings lol").

 

>There is no such thing as a "cut", in the API. To accomplish that, you would adjust the start/end of the existing trackItem, then insert a new trackItem, referencing the appropriate time range from the source projectItem, and (presumably) occurring immediately (i.e., having start/end values that place it) before or after the previously existing trackItem.

 

This is very interesting, this is indeed what I am trying to lean into, however my plan as I was imaging it was:

- Insert clip, modify start and end

- re insert same clip (stil using the same projectitem variable)

-> modify its start and end

Provided I HAVE A WAY TO KNOW where it is located when getting the track items.

The problem is they would have the same names and attributes, it could be tricky to know which one I want to modify?

I suppose I can compare their "start" time, since I can decide where it shall start with the insert function. (If I am wrong  somewhere You can correct me).

 

Final thing:

I saw on the other thread someone using FPS and "

 

 

 

var fps = clip.getFootageInterpretation().frameRate;

 

 

 

"

Do I have to get to THAT LEVEL to be able to insert and "move" things with precision or I can do without it?

I never paid attention MUCh to fps or anything, I have always  relied on Premiere pro to "deal with it", although I had various questions about its precision once https://community.adobe.com/t5/premiere-pro-discussions/inconsistency-in-audio-durations-frames-clip... I maybe should start paying attention to that. If you have guys any extra info about what is the best way to do this, please go ahead.

 

Edit:

>For clarity's sake: There is no such thing as a 'clip', anywhere in PPro; there are only projectItems, and trackItems. So, to restate your request...It seems like you'd like to put the same projectItem into tracks as two different trackItems, with different start and end values (relative to their position within the sequence), and different in and out points (relative to the time span in the originating projectItem). Do I have that right? 

 

Yes!

By re reading this I am starting to understand the in and out point (its the way we "cut" within the same clip in some sort), but it did not work when my track item was on the track it seems? Have little faith on it working on projectitems.

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
Adobe Employee ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

LATEST

>...It finally worked!

Glad to hear it.


But what is this "inPoint" and "outPoint" concept again?

When a trackItem is created, the source range from its parent projectItem is stored in the .inPoint/.outPoint, and are read/write (which makes it confusing that you saw no impact; maybe the same Time param difficulties you resolved, earlier?). The .start and .end refer to the trackItem's position within the sequence. 


I know but it remains a fact, that as for today, that "paid option" is the

> only way there is "it seems" to get consistant constant numerous info about QE. (It seems).

 

I don't understand your 'paid' reference; I think I've already provided a good bit more than an 'unsupported and not at all recommended' level of support.

- Insert clip, modify start and end

I think you already have "create a trackItem based on a given projectItem" working...


- re insert same clip (stil using the same projectitem variable)


If you want the new trackItem to refer to a different range of the projectItem, modify the in and out points of the projectItem to reference the desired source range, then make the second trackItem. Here's example code from PProPanel (which also demonstrates being a good citizen, and putting projectItem ins/outs back where your script found them). 

 

-> modify its start and end

You've solved that...

 

>Provided I HAVE A WAY TO KNOW where it is located when getting the track items.


PProPanel shows how to iterate across trackItems

 

> The problem is they would have the same names and attributes, it could be tricky to know which one I want to modify?

Use trackItem.nodeId to identify/differentiate.

Many users might expect that your script would act on selected trackItems, but you're welcome to support any other method; some extensions operate on any projectItems placed into a "process these" bin. 🙂

 

 

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