>: CG Forums on 3dtotal - The best forums for CG artists :.
threedy forums home
 


top-table-gradient
Go Back   3DTotal Forums > Help, Advice and Chat > General software and hardware help
bottom-table-gradient

Reply
 
Thread Tools Display Modes
Old 03-03-2011, 05:45 PM   #1
YannickLeclerc
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
3DS maxscript - Variable assigned to object

Hi all, quick question, I am assigning a variable to an object, so when I press a button it creates the object, I also have other buttons to hide this object and freeze it, the problem is when i exit the scene and load it again, the variable is not assigned to that object anymore so the freeze and hide button are not working anymore.

ex:

--create button
c= box ()

--hide button
c.ishidden = true

something like that its not exactly it but you get the idea... So my question is how do I tell max to store that variable in the scene...is there such a thing?

Thank you all
YannickLeclerc is offline   Reply With Quote
Old 03-03-2011, 06:10 PM   #2
The Prime
Registered Abuser
 
The Prime's Avatar
 
Join Date: Apr 2010
Location: Staffordshire, UK
Posts: 586
Thanks: 15
Thanked 17 Times in 17 Posts
Awards Showcase
Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! 
Total Awards: 1
You could possibly create a script that runs when Max opens, to rename that variable. I think you would have to place the script in your startup folder, and it should run the script when you open Max... I think. Scripting isn't my strong point.
__________________
The Prime is offline   Reply With Quote
Old 03-03-2011, 07:07 PM   #3
YannickLeclerc
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
yeah I thought about that but my script opens up a window so it would be kind of annoying, moreover I dont think it would work because once you quit the scene, the objects loose its variable so its not associated with it anymore so even when running the script it wouldnt find it.

But someone answered on cgtalk with exactly the answer I was looking for

persistend global variable

http://www.kxcad.net/autodesk/Autode..._Variables.htm

thanks
YannickLeclerc is offline   Reply With Quote
Reply

Tags
3ds max, maxscript, object, scripting, variable


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 08:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
all images displayed on this site are copyright the original artists and may not be reproduced, copied or published elsewhere without their express permission