Skip to main content
ishanp
Inspiring
August 6, 2019
Answered

After Effects error: Can not “set value” with this property, because the property or a parent property is hidden.

  • August 6, 2019
  • 1 reply
  • 5085 views

I tried to find solution for this error in the Adobe Forum & Google too, but it didn't help in following situation.

I am getting the error mentioned in the Question for different scenarios.

1: When Position attribute is separated for the Layer, it throws that error. If I disable the "Separate Dimensions" for Layer, it won't throw the error anymore.

2: It also throw the same error for Audio files with .wav format.

It throws error at following line:

   layer.transform.position.setValue([layerPos[0] - moveX, layerPos[1] - moveY, layerPos[2]]);

Following is the supporting code for reference.

var layer = layers[i];

   var moveX = (oldCompWidth - newWidth) / 2;

   var moveY = (oldCompHeight - newHeight) / 2;

   var layerPos = layer.transform.position.value;

   if (!layer.parent) {

   try {

   //code

   layer.transform.position.setValue([layerPos[0] - moveX, layerPos[1] - moveY, layerPos[2]]);

  } catch (x_x) {

   $.writeln([

   x_x.message,

   x_x.line,

   $.stack,

   layer.name,

   i,

  ].join("\n"));

  } finally {

   //code

  }

  }

Highly appreciate if anyone can give some insight on this. Thank you.

[Moved to After Effects to After Effects Scripting. MOD]

This topic has been closed for replies.
Correct answer Justin Taylor-Hyper Brew

If your dimensions are separated, you can't set the position property directly, you need to set each dimension on it's own (xPosition, yPosition, zPosition), like this:

var layer = layers[i];

var moveX = (oldCompWidth - newWidth) / 2;

var moveY = (oldCompHeight - newHeight) / 2;

var layerPos = layer.transform.position.value;

if (!layer.parent) {

   try {

   //code

   layer.transform.xPosition.setValue(layerPos[0] - moveX);

   layer.transform.yPosition.setValue(layerPos[1] - moveY);

   layer.transform.zPosition.setValue(layerPos[2]);

   } catch (x_x) {

   alert([x_x.message, x_x.line, $.stack, layer.name, i].join("\n"));

   } finally {

   //code

   }

}

1 reply

Justin Taylor-Hyper Brew
Community Expert
Community Expert
August 6, 2019

If your dimensions are separated, you can't set the position property directly, you need to set each dimension on it's own (xPosition, yPosition, zPosition), like this:

var layer = layers[i];

var moveX = (oldCompWidth - newWidth) / 2;

var moveY = (oldCompHeight - newHeight) / 2;

var layerPos = layer.transform.position.value;

if (!layer.parent) {

   try {

   //code

   layer.transform.xPosition.setValue(layerPos[0] - moveX);

   layer.transform.yPosition.setValue(layerPos[1] - moveY);

   layer.transform.zPosition.setValue(layerPos[2]);

   } catch (x_x) {

   alert([x_x.message, x_x.line, $.stack, layer.name, i].join("\n"));

   } finally {

   //code

   }

}

ishanp
ishanpAuthor
Inspiring
August 6, 2019

Thank you. I was wondering if there's any way to check the layer's type programmatically?

I need to add a check for layers that has .wav files. I used .indexOf but I was wondering if there's any standard method in AEScript.

Justin Taylor-Hyper Brew
Community Expert
Community Expert
August 6, 2019

layer.source.typeName

will tell you if it's footage, and to determine if it's audio/video or both, use

layer.source.hasAudio

and

layer.source.hasVideo