ScriptSpot

Forum topic · General Scripting

Get class of a modifer

By Ewok · 2012-03-30

Description

I execute  a simple action by script.

I have an object with an 'Edit Poly' modifier on it and the script bevels the selected polygons of the modifier:

$.modifiers[#Edit_Poly].SetOperation #Bevel
$.modifiers[#Edit_Poly].bevelHeight = 3
$.modifiers[#Edit_Poly].Commit ()

This works fine.

What I'm trying to do is replace [#Edit_Poly] by a variable. That for I use:
$.modifiers

which in the MAXScript Listener puts out:
#modifiers(Edit Poly:Edit Poly)


My question is how to get the class of
#modifiers(Edit Poly:Edit Poly)

inorder to be able to use
[#Edit_Poly]


Does anyone have an idea?

 

Comments (3)

Ewok · 2012-03-30

.

jos · 2012-03-30

I'm not sure what you mean. But this is how you can get the class of a modifier :

$.modifiers -- returns #modifiers(Edit Poly:Edit Poly)
classOf $.modifiers[1] -- returns Edit_Poly

Ewok · 2012-03-30

Great!

It's exactely what I meant.

Thank you very much.