In part of my script I am trying to find all the groups in the scene.
So as a novice I've tried this.
I open up the max file and pick one of the groups I have
In the listener I type in the following
classof $
ObjectSet --get back this
I then try this but it doesn't seem to work.
I'm looking for a list of names I can populate a dropdown list
sceneGroups = for obj in geometry
where classof obj == ObjectSet
collect obj
#() --get back this
sceneGroups.count
0 --get back this
I have been through the Maxscript reference but can't find the proper syntax.
any ideas?
thanks Lowell
Comments (7)
Comment policy
Ok, something like this? Anubis, do you have a nicer way to do this?? :D
RE: Anubis, do you have a nicer way to do this?? :D
Hey, you did it well ;) If you ask for tips... I think that storing all objects not necessary, and as you loop in objects collection - you can omit isValidNode as well.
Ahh.. Thank you for the information Anubis :)
to continue...
I added this line to create a copy of the selection
maxOps.cloneNodes (getNodeByName DD_Group.selected) cloneType:#copy newNodes:&nnl
I get a copy of the group incremented by one digit.
Now I would like to rename it. but again the syntax eludes me.
this is killing me..
I thought I would try this... but its no good.
theCopy = maxOps.cloneNodes (getNodeByName DD_Group.selected) cloneType:#copy newNodes:&nnl
theCopy.name = "new_name"
thanks for your help
Renaming objects is a large subject (with "many faces", you know ;) ), so better open new thread and describe there in details what exactly your renaming would like.
Something like this?select
Something like this?
EDIT: Ahh.. Sorry, Did not read your post properly the first time
Here is an Example:
Just change
with
if you want it to select all objects in scene.
Ray,Sweet website. Thanks
Ray,
Sweet website. Thanks for replying. The behavior I'm getting is close but not complete. I only get an item in this drop down list if its preselected. Otherwise nothing.
thanks
Lowell
I changed the line from selection to objects and it works fine thanks again.
rollout Dropdownlist "Choose Group"
(
dropDownList dl_Dropdownlist "Choose Group" items:(for i in objects where (isGroupHead i) collect i.name as string)
)
createdialog Dropdownlist witdh:220