Notifications
Clear all

[Closed] Adding an Attribute Holder through Maxscript (Pen Attribute Holder too)?

Hi everyone, quick question.

I’ve been looking through the maxscript reference and I can’t seem to find the right way to add a custom attribute holder on an object through maxscript. Can anybody fill me in on that please. Thanks a lot.
Also, i have the Pen Attribute Holder install on my Max and maybe i’d rather add that attribute holder instead of 3DS Max default attribute holder. Can i do that?

Thanks for you time.

5 Replies

may that be what ur looking for?


weaponDataCA = attributes weaponData

(

parameters main rollout:params

(

hitPoints type:#float ui:hits default:10

cost type:#float ui:cost default:100

sound type:#string

)



rollout params "Weapon Parameters"

(

spinner hits "Screw" type:#float

spinner cost "this" type:#float

dropdownlist sound_dd "I'm" items:#("Out", "sparkle", "zap", "fizzle")



on sound_dd selected i do sound = sound_dd.items[i]

)

)


Hi Insanto, i’m not looking to defining my attribute holder but simply adding one like this for example.

myBend= bend()
addModifier $ myBend

It’s pretty simple, but i can’t seem to find how to do it with an attribute holder. I keep looking into the Maxscript Reference but i don’t find exactly how the call the Attribute Holder modifier.

Thanks for you time

 JHN

It definitly can be found in the manual:

custAttributes.add selection[1].modifiers['your modifier name' or index] WeaponDataCA

-Johan

 PEN

To be able to create modifiers you need to know their class. One way to get that is to use the help the other is to create the modifier by hand and check what the class is, so…

theModClass=classOf $.modifiers[1] --Will get the class of the top modifier on a selected object.

Then you can use this to create modifiers.

In the case of the attrbute holder the class is

emptyModifier

And for PAH you need to take into account the space that I put in the name, something that you should never do by the way.

--The class of the modifier
'PEN_Attribute_Holder 2'
--Create the modifier with the class name
'PEN_Attribute_Holder 2'()

The full thing would look something like…


PAH='PEN_Attribute_Holder 2'()
addModifier $ PAH
custAttributes.add PAH def

Cool! Thanks a lot