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

How to tell if item is Adjustment Layer

Community Beginner ,
Mar 11, 2017 Mar 11, 2017

Copy link to clipboard

Copied

I'm creating an extension and I need to be able to tell the difference between Adjustment layers and Color Mattes in the project bin. They just show up as stills in their metadata. Is there a way to do this?

I was able to figure out when an item is a Title as the codec shows up as "Titl" even though the MediaType shows up as "Still Image". But the Adjustment layers codec gives me "RAW " which is the same as a regular still image.

Is there a method that I'm not aware of to determine an items type?

Any help is greatly appreciated!

Thanks

TOPICS
SDK

Views

907

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

Explorer , Mar 13, 2017 Mar 13, 2017

+1!

Same here, I've managed to infer a bunch of stuff from other properties.  Here's a test script I wrote, works best if you have test items in the project root:

function removeAllNamespace(xml)

{

          var ns =new Namespace();

          var d=xml.descendants();

          for (var i=0;i<d.length();i++)

        d.setNamespace(ns);

}

for(var c = 0; c < app.project.rootItem.children.numItems; c++) {

        var i = app.project.rootItem.children;

        $.writeln("======= " + i.name + "======= ");

       

...

Votes

Translate

Translate
Explorer ,
Mar 13, 2017 Mar 13, 2017

Copy link to clipboard

Copied

+1!

Same here, I've managed to infer a bunch of stuff from other properties.  Here's a test script I wrote, works best if you have test items in the project root:

function removeAllNamespace(xml)

{

          var ns =new Namespace();

          var d=xml.descendants();

          for (var i=0;i<d.length();i++)

        d.setNamespace(ns);

}

for(var c = 0; c < app.project.rootItem.children.numItems; c++) {

        var i = app.project.rootItem.children;

        $.writeln("======= " + i.name + "======= ");

        $.writeln("type: " + i.type);

        $.writeln("canChangeMediaPath: " + i.canChangeMediaPath());

        $.writeln("mediaPath: " + i.getMediaPath());

        var xmlRoot = new XML (i.getProjectMetadata());

        removeAllNamespace(xmlRoot);      

        $.writeln("XML Codec: " + xmlRoot.child(0).child(0).child("Column.PropertyText.Codec"));

        $.writeln("");

}

Here's the result with some test items of different types:

======= Bin=======

type: 2

canChangeMediaPath: false

mediaPath:

XML Codec:

======= music_Adventurous_00_BREAK_00.wma=======

type: 1

canChangeMediaPath: true

mediaPath: \\wexfile\evoke\Audio\ModularMusicEdits\Adventurous\00\wma\music_Adventurous_00_BREAK_00.wma

XML Codec:

======= Sequence 01=======

canChangeMediaPath: false

type: 1

mediaPath:

XML Codec:

======= IMG_20161227_141732.jpg=======

type: 1

canChangeMediaPath: true

mediaPath: C:\Users\gemof\Downloads\IMG_20161227_141732.jpg

XML Codec: RAW

======= Unity - DefaultScene_RecordTakes.unity - UnityProject_HCap - PC, Mac & Linux Standalone_ _DX11_ 4_27_2016 3_33_01 PM.mp4=======

type: 1

canChangeMediaPath: true

mediaPath: \\wexfile\evoke\User\Geordie\Unity - DefaultScene_RecordTakes.unity - UnityProject_HCap - PC, Mac & Linux Standalone_ _DX11_ 4_27_2016 3_33_01 PM.mp4

XML Codec: H.264

======= Title 01=======

type: 1

canChangeMediaPath: true

mediaPath:

XML Codec: Titl

======= Color Matte=======

type: 1

canChangeMediaPath: true

mediaPath:

XML Codec: RAW

======= Adjustment Layer=======

type: 1

canChangeMediaPath: true

mediaPath:

XML Codec: RAW

I think the only thing you can't distinguished between here is a Color Matt and Adjustment Layer

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 Beginner ,
Mar 26, 2017 Mar 26, 2017

Copy link to clipboard

Copied

Wow that's still a lot closer than I was. Thanks for this.

Also, I love this removeAllNamespace function you've created. My solution to this was definitely not as elegant.

Fingers crossed they put this info into the metadata!

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
Participant ,
Jan 09, 2020 Jan 09, 2020

Copy link to clipboard

Copied

LATEST

Now, in the new decade of 2020, you can directly check if a trackItem is an adjustmentLayer:

Bildschirmfoto 2020-01-09 um 16.24.34.png

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