Notifications
Clear all

[Closed] Edit Scripted Custom Attributes

Hi
Is there any way to edit or open a scripted custom Attributes creating by Maxscript.
when you add some slider spiner etc or Ui by max [Parameter Editor] it is editable in [Parameter Editor], but when you add scripted custom Attributes it is not editable in [Parameter Editor].

2 Replies

Hi,

You can extract the attributes using functions like the ones below.

This will get the attribute defs from the current stack item


fn getCurrentObjectDefs = 
(
	atts = (modPanel.getCurrentObject()).custattributes
	attContArray = #()
	if atts.count > 0 then
	(		
		attContArray = for att in atts collect att
	)
	attcontarray
)

And this will extract the source code of the def to the clipboard, where you can edit it in the maxscript editor.


fn getdefSourceToClipboard def =
(
ss = stringstream ""
format (custattributes.getdef def).source to:ss
setclipboardtext (ss as string)
true
)

Once you have the new or edited def as a string, you can use the redefine method

custattributes.redefine (custattributes.getDef currentDef) <newDef>

Thanks for your reply