CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 01-23-2009, 11:03 AM   #1
New Member
Join Date: Nov 2004
Posts: 15
Callbacks problem


For some reason callbacks behave differently when excuted from a script then when executed from the listener window. The problem i am having is when assigning a fileIn #filePostOpen callback. The callback refuses to load the script when i ser the callback from script, but it works fine when i do the same thing in the listener window.

callbacks.addscript #filePostOpen fileName:("path...") id:#new persistent: true

I get a callback fileIn exception when i set the callback from script.

Anyone know why this happens or a good workaround?


Old 01-23-2009, 12:29 PM   #2
Lord of the posts
ZeBoxx2's Avatar
Richard Annema
Caustic Graphics / SplutterFish
Groningen, Netherlands
Join Date: Jul 2006
Posts: 1,461
think we might need more information than that.. what's the script you're trying to set it in?

the below worked fine, at least...

-- just a file to work with f = createFile "$temp\\" format "print \"TESTING, 1 2 3\"" to: f close f -- set up callback in listener callbacks.addscript #filePostOpen fileName:("$temp\\") id:#new persistent: true -- save the max file saveMaxFile "t.max" -- load the max file loadMaxFile "t.max" "TESTING, 1 2 3" true -- hey presto -- remove the callbacks callbacks.removescripts() saveMaxFile "t.max" -- make sure it's gone loadMaxFile "t.max" true -- good, good -- now for a non-listener test... a button! rollout roll_test "test" ( button btn_test "test" on btn_test pressed do ( callbacks.addscript #filePostOpen fileName:("$temp\\") id:#new persistent: true ) ) createDialog roll_test -- press button here -- ... -- no errors, let's continue saveMaxFile "t.max" loadMaxFile "t.max" "TESTING, 1 2 3" true -- hooray!
Old 01-23-2009, 12:37 PM   #3
New Member
Join Date: Nov 2004
Posts: 15
The script is saved to a network address


Using "doesFileExists" results in true however setting a callback with that path using a script gives me callback filein exceptions.
Old 01-26-2009, 09:25 PM   #4
New Member
Join Date: Nov 2004
Posts: 15
In the end i decided to not use an external script but instead build the script into the callback. I never found out why i couldn't get the ms file to load properly.
Old 01-26-2009, 09:25 PM   #5
CGTalk Moderation
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:16 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.