Page 1 of 1

Can't seem to use PropertyValueType

Posted: December 3rd, 2005, 7:35 am
by Shinjipierre
I don't really know how to use "PropertyValueType" is an expression

I want to create a script that works for every property type that exist in after effects.... (it's just a fade in/out)

It's annoying to create an expression for each type.

Code: Select all

if(thisProperty.PropertyValueType == oneD) {
	result
} else {
	if(thisProperty.PropertyValueType == TwoD) {
		[result,result]
	} else {
		[result,result,result]
	}
}
I've been trying things like this... but, it doesn't work :/

Posted: December 3rd, 2005, 10:45 am
by vidpat
PropertyValueType is the object that contains the constants where as propertyValueType is the property of Property objects. I'm not certain these notions are available to expressions, likely just scripts. However, a switch statement is often useful for these sort of comparisons as in:

Code: Select all

var retval;

switch (thisProperty.popertyValueType) {
    case PropertyValueType.ThreeD:
        retval = [result, result, result];
        break;
    case PropertyValueType.TwoD:
        retval = [result, result];
        break;
    /*  ...  */
    case PropertyValueType.NO_VALUE:
    default:
        break;
}

retval;