Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Simple maxscript question
show user profile  3joez
How do you select all via macroscript and store the selection in a variable?
Via listener I use select $*, but somehow I can't use it in the macroscript.

Basically I want to

select all
collapse everthing to edit poly
Photobucket

read 289 times
1/24/2014 10:39:39 AM (last edit: 1/24/2014 10:39:39 AM)
show user profile  donvella
ctrl + A > right click > convert to edit polygon




read 287 times
1/24/2014 10:42:15 AM (last edit: 1/24/2014 10:42:15 AM)
show user profile  3joez
I want to script it, for learning purposes.
Photobucket

read 287 times
1/24/2014 10:54:11 AM (last edit: 1/24/2014 10:54:11 AM)
show user profile  br0t
I would not recommend using $ for more than working with a single selected object, it gets to confusing. Better use "selection" or similar.

To select all you could simply do select objects but that will also select cameras, helpers, every object in the scene and those you cannot convert to an editable poly which is done by calling "convertToPoly" (see mxs docs "Interface: EditablePoly")

Better:

for g in geometry do convertToPoly g

but then "convertToPoly" is a mapped fn, meaning you can give it either a single object or a set of objects:

convertToPoly geometry

never get low & slow & out of ideas


read 283 times
1/24/2014 11:28:51 AM (last edit: 1/24/2014 11:29:25 AM)
show user profile  Garp
select geometry




read 277 times
1/24/2014 11:45:58 AM (last edit: 1/24/2014 11:46:12 AM)
show user profile  donvella
my bad, i read that as you cant use the script and u just need to select all and convert lols




read 274 times
1/24/2014 11:50:47 AM (last edit: 1/24/2014 11:50:47 AM)
show user profile  Garp
I think you read correctly while I only read half of the question :\




read 270 times
1/24/2014 11:56:18 AM (last edit: 1/24/2014 11:56:18 AM)
show user profile  3joez
Ok, select geometry and I'm happy.
How do I store the selection in a variable?
Photobucket

read 261 times
1/24/2014 12:51:39 PM (last edit: 1/24/2014 12:51:39 PM)
show user profile  Garp
sel = selection as array




read 255 times
1/24/2014 1:19:11 PM (last edit: 1/24/2014 1:19:11 PM)
show user profile  3joez
Thenks
Photobucket

read 241 times
1/24/2014 7:59:58 PM (last edit: 1/24/2014 7:59:58 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org