how to short this script ?
Hello again,
Sorry i'have an other question (but believe me i search a lot before asking)
I'm sure that it's easy but i can't find the right grammar.
I would like to add a variable into a variable name
Like
I mean i would like to be able to add variable into the an other variable name like
for i = 1 to 5 do ( var_number_[i] = "hello" ) print var_number_1 print var_number_2 print var_number_3
In my case i've that to short
macroscript Light category:"gabi" ( rollout lumiere "Gestion de light" ( group "Group" ( radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2 ) button ajout "Add selection to group" width:210 height:25 align:#center On ajout pressed do ( if groupe.state == 1 do ( sel_courante = selection as array lum1 = lum1 + sel_courante makeUniqueArray (lum1) utilitaire = for s in lum1 collect s.name liste_lum1.items = utilitaire ) if groupe.state == 2 do ( sel_courante = selection as array lum2 = lum2 + sel_courante makeUniqueArray (lum2) utilitaire = for s in lum2 collect s.name liste_lum2.items = utilitaire ) if groupe.state == 3 do ( sel_courante = selection as array lum3 = lum3 + sel_courante makeUniqueArray (lum3) utilitaire = for s in lum3 collect s.name liste_lum3.items = utilitaire ) if groupe.state == 4 do ( sel_courante = selection as array lum4 = lum4 + sel_courante makeUniqueArray (lum4) utilitaire = for s in lum4 collect s.name liste_lum4.items = utilitaire ) ) ) createdialog lumiere width:600 height:600 )
And i would like to do something like that
macroscript Light category:"gabi" ( rollout lumiere "Gestion de light" ( group "Group" ( radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2 ) button ajout "Add selection to group" width:210 height:25 align:#center On ajout pressed do ( sel_courante = selection as array lum[group.state] = lum[group.state] + sel_courante makeUniqueArray(lum[group.state]) utilitaire = for s in lum[group.state] collect s.name liste_lum[group.state].items = utilitaire ) ) createdialog lumiere width:600 height:600 )
thank for any help

Comments
Glad to help. :)
Glad to help.
:)
Tools and Scripts for Autodesk 3dsMax
Try this script. Tested on
Try this script. Tested on max2009 and there is no need to select the lights to turn them On or OFF.
In the new script(posted as code in your last post) I added
button active "Activer le groupe"
but don't know if it has to works as in my code.
Also, I don't know what the
button ajout "Ajouter Selection au groupe"
have to do in the new script.
Tools and Scripts for Autodesk 3dsMax
hell yeah !
Thank you a lot for the time you passed on !
Everything works fine !
The button "ajout "Ajouter Selection au groupe" is a old part of the script i forgot to delete.
I learn a lot from you correction (especially with getNodeByName )
Now i'm gonna add some stuff (rename groups button, save data to max scene ect...)
Thank again.
euh...
Your script worked fine but it's was not enough.
Hard to explain, i don't speak english very well.
In fact i used variable lum1, lum2, lum 3 ect... after for an other part (a button which enable or disabel lights)
Variables lum? store informations (in a array ?) of which object are in groups.
I can't manage to do the same things from information store in drop down list. (but i'm pretty sure that's it's possible)
In an other part i changed the interface of the script (become more complicated)
OLD VERSION => http://nsa32.casimages.com/img/2012/11/03/121103080215710694.jpg
NEW VERSION => http://nsa32.casimages.com/img/2012/11/03/121103080021180086.jpg
(juste fin case i put the script of the old one (it's worked but
style heavy code and useless (i put in txt to short the post)
OLD SCRIPT http://textup.fr/32631Q0
The script become different. You're way worked for a single one button. but i have now plenty off "Add" button.
So i tried to create some functions.
(i add somme note to explain the mess)
Issue:
The function to add to a list work. But doesn't store information
On new selection it's erase old selection.
The function to turn light on/off doesn't work at all because can't find back the object previously selected.
I don't find a way to enable/disable lights without selected then in 3Ds max view... Cause it's work so i don't don't search an other way 'cause i'm laisy. but i'm sure it's easy
I can make the script work but with the old heeeeeeavy code style.
If somebody read me, thank you a lot because it's take time.
Gabi
Works or not?
Works or not?
Tools and Scripts for Autodesk 3dsMax
ok thank you !
ok thank you !
Try this:
Tools and Scripts for Autodesk 3dsMax