Answered my own question:

I was trying to set 


params["ScaleX"]= ScaleX;
params["ScaleY"]= ScaleY;

params['MeshRes']= MeshRes;

to variables that hadn't been declared as input ports.
Very silly.

Sorry to have wasted your time guys...

a|x





----- Original Message ----
From: Alex Drinkwater <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, 4 July, 2008 11:54:34 AM
Subject: JavaScript and Structures


Is there a problem with this JS code:

/*
Creates output structure from inputs
*/

__structure params = new Object();

function (__structure outputStruct) main (__number M,
__number N1,
__number N2,
__number N3,
__number Mb,
__number N1b,
__number N2b,
__number N3b,
__number dummy)
{
var result = new Object();

if(!_testMode) {
// Superformula controls
params["M"]= M;
params["N1"]= N1;
params["N2"]= N2;
params["N3"]= N3;
params["Mb"]= Mb;
params["N1b"]= N1b;
params["N2b"] = N2b;
params["N3b"] = N3b;
// Pre-transform controls
params["ScaleX"]= ScaleX;
params["ScaleY"]= ScaleY;
// Mesh resolution
params['MeshRes']= MeshRes;
}

result.outputStruct = params;
return result;
}

It's basically just taking a load of input values and making a structure out of 
them. Unfortunately, it seems very unreliably, for some reason. Sometimes it 
works fine, but just as often, it doesn't seem to produce an output. If I hover 
the mouse over the output port, I don't get a list of the structure items as I 
should, and Structure Key Member patches connected to the output aren't 
receiving any values. I've tried declaring the params __structure both inside 
and outside the main loop, which doesn't seem to make any difference.

Anyone any thoughts?

I'm using QC 3.0
MacOS 10.5.3
QuickTime 7.5
on a 1st-generation MacBook Pro.

Cheers,

a|x
http://machinesdontcare.wordpress.com
________________________________
 Not happy with your email address? 
Get the one you  really want - millions of new email addresses available now at 
Yahoo!


      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at 
Yahoo! http://uk.docs.yahoo.com/ymail/new.html
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to