PDA

View Full Version : Adding an Attribute Holder through Maxscript (Pen Attribute Holder too)?


Guibou
01-19-2009, 02:28 PM
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.

Insanto
01-19-2009, 02:46 PM
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]

)

)

Guibou
01-19-2009, 04:45 PM
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
01-19-2009, 04:49 PM
It definitly can be found in the manual:
custAttributes.add selection[1].modifiers['your modifier name' or index] WeaponDataCA

-Johan

PEN
01-19-2009, 07:00 PM
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

Guibou
01-19-2009, 07:13 PM
Cool! Thanks a lot :)

CGTalk Moderation
01-19-2009, 07:13 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.