PDA

View Full Version : Modifier name to listbox as item! need help!


fajar
07-15-2009, 02:55 PM
Hey all maxscripter and scripter man !! please could somebody help me with this script!! bassiclly I want to add some modifier name to listbox if button 2 is pressed and object in selection has a modifier and do nothing if doesnt had any !
===================================================================
(
global mojo=#()
rollout pret "Untitled" width:162 height:149
(
local mojo=#()
listBox lbx1 "ListBox" pos:[4,0] width:154 height:7
button btn2 "Button" pos:[25,119] width:124 height:25

on btn2 pressed do
(
for obj in (selection as array) do
(
if obj.modifiers.count != 0 then
(
append mod_arr ((classOf obj.modifiers[i].name) as string)
)
lbx1.items = mojo
)
)
)
createDialog pret
)
=====================================================================

Thank

MarcoBrunetta
07-15-2009, 03:29 PM
(
global mojo=#()
rollout pret "Untitled" width:162 height:149
(
local mojo=#()
listBox lbx1 "ListBox" pos:[4,0] width:154 height:7
button btn2 "Button" pos:[25,119] width:124 height:25

on btn2 pressed do
(
for obj in (selection as array) do
(
FOR modIndex = 1 to obj.modifiers.count DO
(
append mojo ((classOf obj.modifiers[modIndex]) as string)
)
-- if obj.modifiers.count != 0 then
-- (
-- append mod_arr ((classOf obj.modifiers[i].name) as string)
-- )
lbx1.items = mojo
)
)
)
createDialog pret
)

I've commented out the part that needed fixing. One thing you where missing is a for loop to go trough the modifier indexes. Plus the name of the array you were adding to was wrong. And you where trying to get the ClassOf the name of the modifier which would return String.

fajar
07-15-2009, 10:19 PM
Ups my wrong, I was just edited right into this comment dialog so it was miss!! sorry for cousing you trouble so much!! and by the way I'm still newbie that very interesting in maxscript for increasing my further workflow, I'm interesting after I try a little script from www.scriptspot.com ! I just wondering if I can writte something like this, my background isn't from programmer though but Arsitek which never had something like this before in the class!!Anyway....

Thanks man !! now I can finally continue workin on my script !! Thank U very much!

CGTalk Moderation
07-15-2009, 10:19 PM
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.