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

AE Moving layer error 'Can not “set value” with this property

New Here ,
Aug 04, 2021 Aug 04, 2021

In AE I'm getting the error 'Can not “set value” with this property, because the property or a parent property is hidden.' 

When trying to move a layer like this:

    var theComp = app.project.activeItem;
    for (var i = 1; i <= theComp.numLayers; i++) {
        var curLayer = theComp.layer(i)
        if (!curLayer.parent) {
            var layerPos = curLayer.transform.position.value;
            $.writeln("pos: ")
            $.writeln(layerPos[0] + ", " + layerPos[1] + ", " + layerPos[2])
            var moveX = 285
            var moveY = 239
            curLayer.transform.xPosition.setValue(layerPos[0] - moveX);
            
    
        }

    }

I am getting the same error as in https://community.adobe.com/t5/after-effects/after-effects-error-can-not-set-value-with-this-propert... 

even though it seems like I am using the solution from that answer. 


Any idea what I might be missing?

 

TOPICS
Scripting
279
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
New Here ,
Aug 04, 2021 Aug 04, 2021

I copied the code from the other answer and it magically worked. So no need to reply. Thank 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
Community Expert ,
Aug 05, 2021 Aug 05, 2021
LATEST

Additional remark: If you want your code to work with both layers whose dimensions are separated AND layer where this is not the case, make sure to check position.dimensionsSeparated to know if the dimensions are separated or not (and then set either the position or the x and y position props accordingly)

https://ae-scripting.docsforadobe.dev/properties/property/#property-dimensionsseparated

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
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