-
PropertyValueType not working as expected
Dear expressionists!
I am currently working on a little script to help with effect controls and i need to check the property’s “PropertyValueType” using
.PropertyValueTypeas suggested in the Scripting Guide.However, the results seem somewhat unexpected to me:
When checking the “Scale” (transform.scale) property of a regular solid layer, i was expecting to either get “PropertyValueType.TwoD_SPATIAL” or “PropertyValueType.TwoD” – but comparing myPropery.propertyValueType against these two doesnt work – for some reason it only works with “PropertyValueType.ThreeD” which doesn’t make any sense to me, as it is a 2-dimensional value.
My simplified code does the following:
var myComp = app.project.activeItem;
var numLayer = myComp.selectedLayers;
var ind = numLayer[0].index;
var myLayer = myComp.layer(ind);for (i = 0; i < myLayer.selectedProperties.length; i++) {
var prop = myLayer.selectedProperties[i];if (prop.propertyValueType == PropertyValueType.OneD) {
myLayer.effect.addProperty("ADBE Slider Control").name = prop.name;
} else if (prop.propertyValueType == PropertyValueType.TwoD || prop.propertyValueType == PropertyValueType.TwoD_SPATIAL) {
myLayer.effect.addProperty("ADBE Point Control").name = prop.name;
}The “OneD” works perfectly for e.g. Opacity.. but Scale and/or Position don’t work with TwoD and TwoD_SPATIAL at all.
Any ideas? What am i doing wrong?
Thanks in advance
Kind regards