utility objects

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Display Modes
  10 October 2003
utility objects

Just Started with maxscript...and get stuck

Let's say i need 20 spinners or buttons in my utility
Is it possible to make them with the for loop?

like:
utility test "Test"
(
for i=1 to 20 do
(
spinner......
)
)


Thanx
__________________
The world is a circus, every man is a clown.
 
  10 October 2003
it is possible, but not using the 'conventional' way of creating a rollout. you need the execute command to accomplish this. this command allows you to evaluate a string.

so
execute "10+10" results in 20

using this same technique you can build rollouts dynamically:


-----------------------------------------------------------------------------------

-- this variable will hold the rollout string
strRollout = ""

-- make sure you escape double quotes inside strings using a backslash character
strRollout += "utility test \"Test\"
(
"

for i=1 to 20 do
(
   -- add a spinner and number it using the i-loop
   strRollout += "   spinner spn" + (i as string) + " \"Caption\"\n"
)
strRollout += "
)"


-- execute the string
execute strRollout

-----------------------------------------------------------------------------------


the string strRollout will contain:

utility test "Test"
(
   spinner spn1 "Caption"
   spinner spn2 "Caption"
   spinner spn3 "Caption"
   spinner spn4 "Caption"
   spinner spn5 "Caption"
   spinner spn6 "Caption"
   spinner spn7 "Caption"
   spinner spn8 "Caption"
   spinner spn9 "Caption"
   spinner spn10 "Caption"
)



the execute then evaluates this string just as if it is a normal script that gets evaluated..


good luck
Martijn
 
  10 October 2003
Wow! Thanx man!
__________________
The world is a circus, every man is a clown.
 
  10 October 2003
Quote: Originally posted by Fossor
Wow! Thanx man!


In MAX 5 and higher, there is a set of functions to create dynamic rollouts like that. See "RolloutCreator Functions" in the Online Help. Also see the "How To" - "... Enhance the Morpher Modifier With Floating Controls" tutorial which uses the method magicm suggested...

If you are really just starting with MAXScript, you might find this stuff a bit too advanced for your level.

Cheers,
Bobo the Clown

Last edited by Bobo : 10 October 2003 at 12:41 AM.
 
  10 October 2003
Quote: Originally posted by Bobo
In MAX 5 and higher, there is a set of functions to create dynamic rollouts like that. See "RolloutCreator Functions" in the Online Help. Also see the "How To" - "... Enhance the Morpher Modifier With Floating Controls" tutorial which uses the method magicm suggested...


I'm using max 4

Quote: If you are really just starting with MAXScript, you might find this stuff a bit too advanced for your level.


Really 2 days in fact. Actually I have some experience in programming from Assmbler to C++ and ActionScript. So i don't see any problem.

Quote: Cheers,
Bobo the Clown



Always nice to meet some comrades-in-arms!

Thanx for support!
__________________
The world is a circus, every man is a clown.
 
  10 October 2003
Quote: Originally posted by Fossor
I'm using max 4


This does not mean that you cannot use the MAXScript tutorials - they are pretty much Max 4 compatible (I wrote them for the VIZ4 edition of the help, so they should work except for the one I just mentioned which relies on an extension formerly only available in the SDK and then added to Max 5).
You can download a copy of the MAXScript 5.1 Help from the official discreet support forum page.
http://www2.discreet.com/support/max/download/download.php3
 
  10 October 2003
Quote: Originally posted by Bobo
This does not mean that you cannot use the MAXScript tutorials - they are pretty much Max 4 compatible (I wrote them for the VIZ4 edition of the help, so they should work except for the one I just mentioned which relies on an extension formerly only available in the SDK and then added to Max 5).
You can download a copy of the MAXScript 5.1 Help from the official discreet support forum page.
http://www2.discreet.com/support/ma...d/download.php3


It's good to know! I have not thought of this possibility

Thanx!
__________________
The world is a circus, every man is a clown.
 
  01 January 2006
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



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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 04:44 AM.


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