Highlighted

How to change master property value on multiple layers (300 layers)

New Here ,
Nov 17, 2020

Copy link to clipboard

Copied

I have 300 duplicated comps with master properties into a "TestComp"

example.

compName:      MasterComp;

property "scale" has been added to above MasterComp as master property with value set as:      "MasterScale" - 80% (value);

 

How do we change the master property "MasterScale" value to 150% for all 300 layers at one go? Can anyone provide a script to change the Master Scale values for the selected multiple layers/comps?

 

Manually selecting the "MasterScale" master property for over 50 layers freezes the application.

TOPICS
How to, Scripting

Views

53

Likes

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

How to change master property value on multiple layers (300 layers)

New Here ,
Nov 17, 2020

Copy link to clipboard

Copied

I have 300 duplicated comps with master properties into a "TestComp"

example.

compName:      MasterComp;

property "scale" has been added to above MasterComp as master property with value set as:      "MasterScale" - 80% (value);

 

How do we change the master property "MasterScale" value to 150% for all 300 layers at one go? Can anyone provide a script to change the Master Scale values for the selected multiple layers/comps?

 

Manually selecting the "MasterScale" master property for over 50 layers freezes the application.

TOPICS
How to, Scripting

Views

54

Likes

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
Nov 17, 2020 0
Adobe Community Professional ,
Nov 17, 2020

Copy link to clipboard

Copied

Have you tried using the Push feature for the Master Property?

Likes

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
Reply
Loading...
Nov 17, 2020 0
New Here ,
Nov 17, 2020

Copy link to clipboard

Copied

Yes, I am aware of the Push feature on the Master Property section but trying to select and changing for 300 layers is cumbersome & time taking and shift selecting the properties for < 50 in one go is causing AE to freeze. Was wondering if there is a better way than manually selecting it. I could do 10 at a time too 🙂

Likes

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
Reply
Loading...
Nov 17, 2020 0
Adobe Community Professional ,
Nov 17, 2020

Copy link to clipboard

Copied

The purpose of the Push feature is to replace the value of the Master Property at the source. Hence, all other instances of the Master Property will also inherit this 'pushed' value. Sense make? All you need to do is to push the new value once OR go to the original source property and change the value(s) there. A N D, apologies if I've misread/misunderstood your issue.

Likes

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
Reply
Loading...
Nov 17, 2020 0
New Here ,
Nov 18, 2020

Copy link to clipboard

Copied

I managed to create the below script researching online which roughly works for what i want but it gives error at sections 03 and 04 (see comments) - Need Help on this if you can understand.

 

//TestComp - Comp that contains the duplicated layers of MasterComp
//MasterComp - Comp where Master Properties have been applied
//MasterScale - Master property attribute  (value set at example 50%) linked to a scale property of any subComp Layer (text, shape, null, etc) contained in MasterComp

//** Ensure that Layers in Test comp has unique names without SPACES

var targetCompName = "TestComp";

// 01 Define Active Comp
var activeComps;
for (var i = 1; i <= app.project.numItems; i ++) {
    if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === targetCompName)) {
        activeComps = app.project.item(i);
        alert(activeComps.name);
        break;
    }
}

//  02 Select specified layers in MasterComp (Layer order starts from 1)
var mySelectedItems = app.project.activeItem.selectedLayers;

    for (var i = 1; i <= app.project.numItems; i++)
    {
        if (app.project.item(i).selected)
        mySelectedItems[mySelectedItems.length] = app.project.item(i);
    }

//  03 Alert the number of layers selected (ERROR - showing 1 extra count - ???)
alert(mySelectedItems.length);

//  04 Change the specific master property value for all selected layers - loop
    for (var i = 0; i < mySelectedItems.length; i++)
    {
        var mySelection = mySelectedItems[i];
        var myLayerName= mySelection.name;
        //  05 Specify the active absolute path to the master property value for selected layer and setValue accordingly  (ERROR -  only changing for 1 selected layer)
        activeComps.layer(myLayerName).property("Master Properties").property("MasterScale").setValue([150,150]);
        
     }

    //  06 Alert when completed
    alert("Done!");

 

Likes

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
Reply
Loading...
Nov 18, 2020 0
Adobe Community Professional ,
Nov 18, 2020

Copy link to clipboard

Copied

There is a huge disconnect between your problem description and your favored solution. The solution I suggested should have solved your problem, as described.

I suggest you re-write the issue and in greater detail so that someone else will be able to assist you.

Likes

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
Reply
Loading...
Nov 18, 2020 0