AE ENHANCERS

Expressions/Scripts/Presets
It is currently Sun May 19, 2013 10:54 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Error handling for custom values
PostPosted: Fri Jun 08, 2012 12:11 pm 
Offline

Joined: Fri Jul 23, 2010 11:49 pm
Posts: 29
I have an animated mask path on layer 1 and I am trying to handle an "After Effects error" with the following expression in source text:

Code:
try {
x = thisComp.layer(1).mask(1).maskPath.velocity;
}
catch (err) {
x = "error";
}


The error I keep getting is:
Quote:
After Effects error: can't compute derivative to a non-spatial custom value ( 29 :: 57 )


The try/catch statement doesn't seem to work in this case for some reason. Any ideas on how to handle this error?


Top
 Profile  
 
 Post subject: Re: Error handling for custom values
PostPosted: Fri Jun 08, 2012 12:53 pm 
Offline

Joined: Fri Jul 23, 2010 11:49 pm
Posts: 29
Apparently it's unable to be handled. According to the JavaScript Tools Guide:

Quote:
Messaging error codes
Negative values indicate unrecoverable errors...
-29 Uncaught exception
57 Cannot resolve reference


So, I came up with this ugly solution:

Code:
maskPath = thisComp.layer(1).mask(1).maskPath;
try {
    if (maskPath.numKeys > 0){
        throw ("err1");
    } else {
        x = maskPath.velocity;
    }
}
catch (err) {
    x = "error";
}


I would much rather have a way to read through expressions:
Code:
maskPath.propertyValueType.CUSTOM_VALUE == true

I guess I'll have to do it through scripting for now. So, let me know if anybody has a better solution.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group