Turn on and Off by Scripting Custom Attribute in Holder

Hi everyone

I am new in Maxscript, I want to be able to turn ON and OFF a check button in an attribute holder (costumed attribute)created previously with the Parameter editor . I am doing an UI that collects some custom attributes from different objects.
But when I tried to check the syntax in the max listener and paste it in the script editor, this pops up:

No ""="" function for ((prop Custom_Attributes ((prop modifiers* (%getDollarSel()))[#FACIAL])) 0.1)

and the script for the button is this:

on btn1 pressed do
(
$.modifiers [#FACIAL].Custom_Attributes.1 = on
)

where the number 1 it's the button´s name
and FACIAL the modifier's name (attribute holder)

Any ideas??
Thank you!!!

AttachmentSize
error_max.jpg20.87 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pixamoon's picture

Re: on off

Hi,

In this case I would do :

SetProperty $.modifiers[#FACIAL].Custom_Attributes #1 off

get button state:

GetProperty $.modifiers[#FACIAL].Custom_Attributes #1

The reason is: usually numbers can't be used as variables in max scripts.
Here 1 came from button name but you can't just call it by 1

If the name of button is "Param1" or even "P1" then you can use your way:

$.modifiers[#FACIAL].Custom_Attributes.P1 = on

Hope it helps.
Cheers,
Pixamoon

sebastian_chevy's picture

THANK youuu

It worked!! you were right, it was just the name. It's better not to mess with values that can be taken as variables.

You are the best.

pixamoon's picture

no prob

no prob, Great it helped :)

cheers,
Pixamoon

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.