PDA

View Full Version : Trouble making a script work as a macroscript


pete
09-30-2004, 07:41 AM
Hi there,
Just wondering if anyone could help out, we are having a little trouble getting a script to work as a macroscript. It seems to work fine if it is used as a standard script (.ms style) but when it is turned into a macroscript it starts screwing up?? It seems as though the callback can't access the "main.autotransform...", but like i said it works fine as a standard script.

nrf = newrolloutfloater "Naff Animation Toolz" 200 60
global setCallbacks, delCallbacks, autoTransform

rollout main "Tools"
(
fn setCallbacks = (callbacks.addScript #selectionSetChanged "main.autoTransform selection" id:#autoTransform)

If anyone could help out it would be much appreciated
Thanks,
Pete

externe
09-30-2004, 08:55 AM
Trouble to make a thread ?
:)

Well I don't know callbacks... So I can't really answer you for your example.

But a simple macroscript you can include the function locally. Perharps it's an idea for you... Don't know. :shrug:

macroScript test
category:"test"
toolTip:"test"
(
--------------
-- function --
--------------

fn testtest =
(
-- do
)

------------
-- events --
------------

on execute do
(
testtest()
)
)


PS : You avatar is wonderful

pete
10-01-2004, 01:28 AM
Yeah, I had bit of tread trouble too :),
Thanks for the reply however we are already setting it up in a similar way but it still seems to ignor the callback? It works fine when you run it as a .ms file.

Have you ever had this problem before because it has happened to me a few times and is kind of frustrating. You may set up a script in the editor window and evaluate it with everything working fine but as it is turned into a macroscript it stops working properly. Mind you this does only seem to happen in about 5% of cases but when it does, it is pretty anoying because it means to run the script people have to go - run script and then track down the right script instead of just clicking a button.

CGTalk Moderation
01-19-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.