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

Having trouble deleting transitions with the api

Explorer ,
Jan 08, 2016 Jan 08, 2016

Hi friendly Adobe peeps,

I'm having trouble deleting transitions with the Premiere api. I've been using QE, thusly (simplified from a loop):

app.enableQE();

qe.project.getActiveSequence().getVideoTrackAt(0).getTransitionAt(0).remove()

... & it works but there is a memory leak, so I can't run the script twice. I chatted to bbb_999 offline & he suggested I don't use QE, so I've got this now:

app.project.sequences[0].videoTracks[0].transitions[0].unbind(true)

... which returns Undefined and the transition isn't deleted. I suspect I'm not passing the correct parameter to the unbind method. Any help would be appreciated!

As a side question: how do I find the arguments list for methods, since there is no documentation? I'm getting pretty exhausted browsing the DOM in ExtendScript Toolkit and then guessing what method arguments might be.

Cheers,

Raphael

TOPICS
SDK
1.3K
Translate
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 11, 2016 Jan 11, 2016

The first method is the correct one; unbind() won't remove a transition. What's the memory leak problem you encounter?

> how do I find the arguments list for methods, since there is no documentation?

Look in PProPanel, and if usage isn't exercised there, ask.

While a couple of screen movie tutorials are being worked on, no further documentation is currently planned. Hopefully, a comforting thought; there are >140 panels in the wild, and none of them had more documentation than you do.

Translate
Adobe Employee ,
Jan 11, 2016 Jan 11, 2016

The first method is the correct one; unbind() won't remove a transition. What's the memory leak problem you encounter?

> how do I find the arguments list for methods, since there is no documentation?

Look in PProPanel, and if usage isn't exercised there, ask.

While a couple of screen movie tutorials are being worked on, no further documentation is currently planned. Hopefully, a comforting thought; there are >140 panels in the wild, and none of them had more documentation than you do.

Translate
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 ,
Jan 11, 2016 Jan 11, 2016

Below is the thread where you mentioned the qe dom as being "un-recommended" -- which is why I took a crack at it with the "normal" dom. This is actually mission-critical in this case. I need a way to reliably remove all transitions on all sequences in the open project. I can't ask the editors to close/open Premiere to clear the memory because their projects are too complex w/effects etc (they take 5 to 10 minutes to open).


Cheers,

Raphael


//--


Thanks for the init command. Didn’t help in this case, but I’ll keep it up my sleeve. Looks like there’s lots of useful stuff in the qe dom, too bad about the refreshing issue!

Cheers,

Raphael


//--


Yep; unreliable refreshing of DOM objects is the primary reason QE DOM is un-recommended.

qe.project.init() can often 'jiggle the handle', enough to get your changes noticed.


//--


Hi again bbb,

Quick question for you: is there a way to clear memory in Premiere?

I’m having an issue where I can run the removeTransitions (video) function in your purginator panel once, but it won’t work again until I restart Premiere. A clue: when I open a different Premiere file & ask the api for the number of tracks in the active sequence, it gives me the number of tracks in the document I’ve closed.

Translate
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 11, 2016 Jan 11, 2016

The QE DOM remains officially unsupported and unrecommended. It's also the only way to do some things.

I've sent a (hopefully) relevant sample panel, directly to you.

Translate
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 ,
Mar 19, 2018 Mar 19, 2018

Hi Bruce Bullis​, trying to remove clipComponents, is there a function for this?

Looking at the onPlayWithKeyframes example, Im walking the sequence fine, and finding the clipcomponents I want to delete, just missing the piece of actually deleting them.

                                var clipComponents = videos.components;

                                var componentNum = clipComponents.numItems;

                                for (var k = componentNum-1; k >= 2; k--) {

                                        alert (clipComponents.displayName);

                                        if (clipComponents.displayName === effectName) {

                                             alert("found one");

                                                clipComponents.remove();

                                                  //remove() does not work on clipComponents?

                                            }

                                       

                                        }

Translate
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 27, 2018 Jun 27, 2018

So I rewrote my code to utilize QE to remove clip.components.
A funny observation is that QE lists blank / empty space in videotracks as actual track items... So therefore the check for undefined .name in there.

This function removes all effects in the timeline with a prompted name. Like "Clip Name" or "Timecode".

qRemoveEffect: function()  {

       app.enableQE();

       var activeSequence = app.project.activeSequence;

   var qeSequence = qe.project.getActiveSequence();

var effectName = prompt('Type in the name of the effect, which you want to remove from the whole sequence... ***WRITE IT CORRECTLY***', '<<<default>>>', 'Effect name prompt');

//Needed limit because of slowness.

var limit = prompt('Number-limit of how many effects to remove (this function might be slow)', '<<<default>>>', 'Limit number prompt');

var count = 0;

        if (effectName !== null) {

var trackNum = qeSequence.numVideoTracks;

outer_loop:

for (var j = 0; j < trackNum; j++){

var clipNum = qeSequence.getVideoTrackAt(j).numItems;

for (var i = 0; i < clipNum; i++){

if (qeSequence.getVideoTrackAt(j).getItemAt(i).name !== undefined ){

var numComponents = qeSequence.getVideoTrackAt(j).getItemAt(i).numComponents;

for (var k = 2; k < numComponents; k++){

if (qeSequence.getVideoTrackAt(j).getItemAt(i).getComponentAt(k).name === effectName) {

qeSequence.getVideoTrackAt(j).getItemAt(i).getComponentAt(k).remove();

count++;

if (count >= limit) { break outer_loop;}

}

}

}

}

}

alert ("Removed " + count + " " + effectName + "-effects from the timeline, starting from the bottom right.");

}

},

Translate
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 ,
Jun 27, 2018 Jun 27, 2018
LATEST

Potential Market Opportunityâ„¢: PPro currently provides no way for a user to remove all transitions from a sequence, at once. Your panel could do it.

Translate
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