Copy link to clipboard
Copied
Hi guys,
Does anyone know if there is a way to set expressions via script for properties that are currently hidden in the UI but might become visible later e.g. Y Rotation invisible in 2D layer, visible in 3D layer. I know that you can manually set an expression on the Y Rotation and toggle the 3D state of the layer and the expression persists. Basically I want to set the Y Rotation whether or not the layer is 3D so that if the user toggles the layer to 3D, the expression is already there.
Also, is there a way to check if a property is hidden via scripting? I didn't see anything in the Property or PropertyBase spec from the scripting guide. Can this be done?
THANK YOU!
Calvin
AE wont let you set an expression, even by script, on a hidden property. But in the special case you describe, you can turn the layer 3D, set the expression, and revert it back to 2D if the layer was 2D.
I tried and it works: the expression is there in case the user enables 3D.
It would be hard to make that process general, because the reason why a property is hidden depends on that property, and the mechanism to show/hide the property is not always the same.
Also, i think that since CS5.5, any pro
...Copy link to clipboard
Copied
AE wont let you set an expression, even by script, on a hidden property. But in the special case you describe, you can turn the layer 3D, set the expression, and revert it back to 2D if the layer was 2D.
I tried and it works: the expression is there in case the user enables 3D.
It would be hard to make that process general, because the reason why a property is hidden depends on that property, and the mechanism to show/hide the property is not always the same.
Also, i think that since CS5.5, any property that has "canVaryOverTime" equal to true can accept expressions, at least some basic one like "value;", provided it's not hidden. So, for properties that can vary over time, "hidden" should be same as "canSetExpression".
But there are some rare exceptions where this fails to be true, probably a bug (on this forum, there is a thread where this is mentionned, cant find it back).
And for a generic property or propertyGroup, given that there is no "hidden" attribute, you can hardly avoid a try/catch block to see what happens.
Xavier
Copy link to clipboard
Copied
Yeah, that pretty much does the trick. Throw in a check on propertyValueType != PropertyValueType.CUSTOM_VALUE or PropertyValueType.NO_VALUE and you might be good to go.
THANK YOU!
Copy link to clipboard
Copied
Yes, you're right about additional conditions.
For anyone reading this, the "colors" property of a shape layer's Gradient Fill is an example of a property (property type: NO_VALUE) that can vary over time and for which canSetExpression is false, although it's not hidden, and even in the latest ae versions. There might be (many) others.
Xavier.
Copy link to clipboard
Copied
Hi.
I'm getting an error that I think it's related to this:
"can not 'set value at time' with this property because the property or a parent property is hidden"
I get this message when I try to set a value at the time for a text animation preset using script. The weird thing is that works for some of those presets and others not.
The property that is causing the error is the Text -> Animators -> OffSet (Match Name: ADBE Text Index Offset).
I saw some posts about this error and this seems the one that has a more clear approach to what can be happening. Could you explain better why and how a layer or group layer can be hidden or not?
Thanks in advance.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more