maxscript

How can I add a custom Parameter to a box in maxscript?


I would like to add a parameter named initialPosx that I can use in this manner:

a = box
a.initialPosx = n

Is there any way?


Solution

  • Read Scripted Custom Attributes and Scripted Plug-in Clauses topics. In your case, a trivial example would be:

    a = Box()
    attr = attributes attr (parameters main (initialPosX type:#point3))
    custAttributes.add a attr
    a.initialPosX = [5, 10, 0]