PDA

View Full Version : global proc herm ( ??? )



ossossso
10-08-2006, 05:15 AM
Hi everyone!

at this site you can take a little code made by myself:

http://www.ossosso.altervista.org/herm.txt

It's quite simple, it create an hermite() function. If you copy all the code and paste it into the script editor and run it, in the scene you'll have "start_control" and "end_control" objects. They are overlying so you have to move one of them or both. If you click play a series of particle move from start_point to end_point with a noise way.

The code works correctly. If you notice the runtime expression for the particleShape1.positionPP, you can see at the top a series of float varibles that control the amplitude and the frequency of the noise. If you change a bit that varible values you can obtein different results.

What I'd like to do is to create an UI interface and change that values from there. So I've saved this code with the name "herm.mel" into the script folder of maya:

global proc herm () { code }

and it still works correctly when I source it and I run it.
The next step was to delete all float variables from the code that control the noise, and add them inside the parenthesis of the global proc, like this:

global proc herm (float $ampX, float $amY etc..) { code without the float variables}

then when I source the script and run it in this way:

herm (2 1.5 etc.);

I obtein an error message, something like that the variables are not initialized.

I followed the passage of this techniuqe from one of your Mel tutorial about a ballStack, but for this situation it seems no work. Any suggestion?

Thanks a lot.