Can't seem to use PropertyValueType

Moderators: Disciple, zlovatt

Post Reply
Shinjipierre
Posts: 36
Joined: December 4th, 2004, 10:10 am

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 :/
vidpat
Posts: 86
Joined: October 21st, 2004, 12:36 am
Location: Phoenix, AZ
Contact:

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;
Post Reply