PDA

View Full Version : Custom Attributes For Command Panel!


HornBerger
01-16-2010, 08:37 PM
hi,
custom attributes are user defined parameters assigned to objects in 3d studio max the value of these parameters can be modified by ui controls specified in the attribute definition (ui controls like spinner and slider etc.. ) these parameters can then be wired to control the transformation or modification of other 3d objects
for eg:
--script by charles purpose to demonstrate custom attributes
/* after running the script select the red box in scene and ope the modify panel to see a new rollout called uniform scale*/
resetMaxFile #noprompt
thebox = box length:10 width:10 height:10 pos:[0,0,0] wirecolor:red
my_Attr = attributes scale
(
parameters param rollout:scaler
(
uscale type:#float ui:scaleSp
)
rollout scaler "Uniform scale Rollout"
(
spinner scaleSp "Uniform Scale" range:[-100,100,100] fieldwidth:60
)

)
custattributes.add $box01 my_Attr -- adds the attribute to box01
select $box01
paramWire.connect $.baseObject.scale[#uscale] $.transform.controller[#Scale] "[uscale,uscale,uscale]"
$.uscale = 1

this is all fine and dandy but now i wont to know how to add such custom attributes to the command panel so i can have my own custom rollouts in the create panel

any help is appreciated! thanks

JHN
01-17-2010, 05:29 PM
You can't.

What you want is a scripted plugin, it's behaviour looks a lot like custum attributes but it is implemented as a "plugin". Look up scripted plugins in the mxs help file and try some of the samples to get a grip on how to use them.

CA's are for adding well "custom" attributes to "existing" objects/rollouts/controllers, but I think you want a new object or modifier or light type extending the original one, and you can do this with scripted plugins.

-Johan

HornBerger
01-17-2010, 07:26 PM
An eye opener! you are right only plug-in scripts can do this.
I have electric rains vector renderer plugin. (it renders 3d max scene as a .swft which contains vector data understood by flash) for more information check out http://www.erain.com/Products/Plug-ins/
its a blessing for flash website developers ... anywaz. This plugin shows its own rollout on the create panel so i wondered... i am gonna checkout the 3dsmax sdk and see where it leads me. :)

JHN
01-17-2010, 08:51 PM
No need for the SDK to create a scripted plugin, it's a maxscript behaving like a plugin. Again lookup scripted plugins in the maxscript helpfile. Offcourse the sdk will take you there eventually, but if you don't need new technology in max, but change some bits of existing tech, maxscript is the fastest way!

-Johan

CGTalk Moderation
01-17-2010, 08:51 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.