Slow execution of JS

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
mpowers

I wrote a 3dsMax scene to AE exporter. Maxscript writes a .jsx that I execute with the file>run command in AE.

The problem I'm having is that it executes insanely slowly! Today I was importing a 12 object scene, it took 45 minutes to run! Sometimes they just hang. Maxscript writes the .jsx file in under 2 minutes.

Do I need to do some type of gc()? (which I get an error when invoking).

I've heard Cinema4D has an exporter which creates an .aec file; however, I haen't seen any info about it in the AE SDK.

If anyone has any suggestions, I'd appreciate them!

Here is an example of just the camera
Just the camera is ~3000 lines long (without any FOV changes)

{
var compName = "Globe_section02_14.max";
var compW = 720;
var compH = 486;
var compA = 0.9;
var compL = 36.0;
var compRate = 30;
var compBG = [0,0,0];
var myItemCollection = app.project.items;
var myComp = myItemCollection.addComp(compName,compW,compH,compA,compL,compRate);
myComp.bgColor = compBG;
myCam = myComp.layers.addCamera("Camera01",[0,0]);
var myPosition = myCam.property("position");
var myRotationZ = myCam.property("rotationZ");
var myRotationX = myCam.property("rotationX");
var myRotationY = myCam.property("rotationY");
var myZoom = myCam.property("zoom");
myPosition.setValueAtTime(0.0,[6360.66,-242.995,-32943.2]);

//...excised.. for brevity...

myPosition.setValueAtTime(36.0,[-309.344,-27899.2,36737.8]);
myRotationX.setValueAtTime(0.0,7.98933e-006);
myRotationY.setValueAtTime(0.0,-9.25086);
myRotationZ.setValueAtTime(0.0,10.0);

//...excised.. for brevity...

myRotationY.setValueAtTime(35.9667,0.68133);
myRotationZ.setValueAtTime(35.9667,-167.861);
myZoom.setValueAtTime(0.0,782.205);
myComp.layers.addText("This is a Free Camera \r Select the Camera\r Go to:\r Layers>Transform>Auto-Orient: off")
}
Post Reply