PDA

View Full Version : Create{} being called during Load


Dodgy
04-04-2005, 01:15 PM
Hiya,

According to the template for Motion Modifiers, Create{} is called one time fro initialisation. However, I did a check and found it's called during loads/load from scenes.

Does it have to be called, or should it be called during loads, as you could place any loading initialisation code in the Load{} procedure, thus leaving Create just for when the plugin is first added. I'm just confused as to the point of calling it during load, when it would be quite handy to just have it called only when added by the user.

I'm only asking this because I'm using it for setup using the Ring, and I found that my plugins were getting other values sent to them by mistake. Now I'm going to have to write around this, which i don't mind, but I would have liked it to be clearer as to what happens during a load cycle. I just thought it would be a load call. The sequence is:

Lightwave loads object:
Lightwave adds plugin: Create{} is called
Lightwave calls Load{}
Scene finishes loading
Process{} is called.


What do other people think?

Should it perhaps be just:

Lightwave loads object:
Lightwave adds plugin
Lightwave calls Load{}
Scene finishes loading
Process{} is called.

kjl
05-06-2005, 05:28 PM
I think it makes sense as it is. I don't think you want to have to double up the code you have in your create: function and copy it into load: as well.

Also, the current way is clean in that your load function really can just be 2 or 3 io.read() lines and that's it...