Help a Noob v0.03? "Seeking A better selection method"

I have 01-39 separate mesh parts (same as last post) that make up a character's body.
I select all the parts except the ones I don't want to attach, then copy the selection to the editor.

MyArray = #($mesh39, $mesh01, $mesh21, $mesh34, $mesh32, $mesh16, $mesh14, $mesh33, $mesh35, $mesh15, $mesh17, $mesh23, $mesh28, $mesh05, $mesh10, $mesh24, $mesh06, $mesh36, $mesh18, $mesh25, $mesh29, $mesh07, $mesh11, $mesh38, $mesh30, $mesh20, $mesh12)

for obj in MyArray do attach $mesh03 obj

Okay, So this works fine but is there a better way to select the wanted $mesh parts without having to paste in the whole $mesh selection.

Maybe something short and sweet like: My Array = #($mesh01, $mesh04 to $mesh25, $mesh27 to $mesh39).

Thanks for some Help with this:)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
toonhound's picture

Hi Anubis, I have to say

Hi Anubis,

I have to say WOW!

The Tutorial was above and beyond helpful:)

I have to say this is the 3rd time you have helped me in timely and informative way, and
I am very, very grateful.

as for why I worry about how the array looks, I think it is some kind of built in personal problem I might have. lol;)

Thank You again

Anubis's picture

Why you worry about how the

Why you worry about how the array looks like :) This "sweet" syntax you looking for is available only in BitArray and they are useful for sub-object level selections (faces/verts/edges), example from the help file:
$foo.verts[#{20..1023}] --selects all vertices between 20 and 1023

my recent MAXScripts RSS (archive here)

Anubis's picture

Hi again, I wrote a simple

Hi again,
I wrote a simple tutorial to help you and post it here:
http://www.scriptspot.com/3ds-max/tutorials/lets-play-with-array

Enjoy ;)

my recent MAXScripts RSS (archive here)

toonhound's picture

After studying your excellent

After studying your excellent tutorial, I finally got it.

(
objs = for i in $mesh* collect i.name
sort objs
objs = for i in objs collect (getNodeByName i)
index = #{1, 4..6, 8..20, 22..31}
objs = for i in index collect (objs[i])
for obj in objs do attach $mesh03 obj
)

This worked perfectly:)

You should be hired to rewrite the maxscript help documentation.

Thanks again and again

Anubis's picture

Thanks for the nice words :)

Thanks for the nice words :)

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.