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

New trackItem property in API - disabled - allows you to enable and disable clips (Beta)

Adobe Employee ,
Sep 23, 2021 Sep 23, 2021

Copy link to clipboard

Copied

A new trackItem property - disabled - will be added in the next release, and is available for testing now in Beta version 22.0.0 build 130 and later. It allows for adding a boolean value to clip > enable, effectively allowing the API to flip the clip enable UI switch:Screen Shot 2021-09-22 at 2.05.33 PM.png

Once V22 ships, this will be fully documented in the Premiere Pro Scripting Guide, and a new button will be added to the Premiere Pro Sample Panel (SDK) , which will look a lot like this:

Screen Shot 2021-09-22 at 2.06.35 PM.png

Code sample is below

 

 

enableAllDisabledClips : function () {
		var sequence = app.project.activeSequence;
		if (sequence) {
			var trackGroups 	= [sequence.audioTracks, sequence.videoTracks];
			var trackGroupNames = ["audioTracks", "videoTracks"];
			var updateUI 		= true;

			for (var groupIndex = 0; groupIndex < 2; groupIndex++) {
				$._PPP_.updateEventPanel(trackGroupNames[groupIndex]);
				var group = trackGroups[groupIndex];
				for (var trackIndex = 0; trackIndex < group.numTracks; trackIndex++) {
					var track			= group[trackIndex];
					var clips			= track.clips;
					var transitions		= track.transitions;
					var beforeSelected;
					var afterSelected;
					var initialSelectState;

					$._PPP_.updateEventPanel("track:" + trackIndex + "	 clip count: " + clips.numItems + "	  transition count: " + transitions.numItems);

					for (var clipIndex = 0; clipIndex < clips.numItems; clipIndex++) {
						var clip = clips[clipIndex];
						var name = (clip.projectItem === undefined ? "<null>":clip.projectItem.name);
						if (clip.disabled === true){ //using new trackItem property named disabled
							clip.disabled = false;
							$._PPP_.updateEventPanel("clip:" + clipIndex + " , " + name + " was disabled, is now enabled " );
						}	
					}
				}
			}
		} else {
			$._PPP_.updateEventPanel("no active sequence.");
		}
	},

 

 

 

TOPICS
Feature request

Views

292

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
no replies

Have something to add?

Join the conversation
Resources