View Full Version : Custom buttons in (PEN) attribute holder?

09 September 2009, 08:10 AM
I'm trying to add a button as a custom attribute to a modifier (in this case, a PEN attribute holder). The button should ideally be able to execute a custom bit of MaxScript when pressed, so that I could make it do "anything" that I was able to script. I've looked through the parameter editor, and I didn't find a custom button anywhere - only standard UI elements like pickButton or checkButton, neither of which I could get to execute custom MaxScript.

I may very well be missing something essential and easy here, since I think I've seen rigs that have exactly that. However I've been unable to duplicate those rigs myself.

I hope someone will be able to help - and my apologies if this is explained in another post, I've been unable to find it if so.



09 September 2009, 10:47 AM
You are going to have to code the CA Def your self and use a button. In the event handler or a function create the code you want.

09 September 2009, 11:14 AM
Hi Paul, thanks for your answer.

Would you mind giving me a pointer on how to get started with this? I did read the tutorial on your site about "Calling Custom Attributes from Script Controllers", but I'm afraid I don't see the connection to my problem yet (if indeed there is one).

09 September 2009, 01:15 PM
You store your reference objects and functions inside a custom attribute then you can call the function inside the on pressed handler of your button.

Script controllers and custom attributes are used together when you need to reference an object in a script controller without having to worry about the reference objects name. The node will be stored in the custom attribute.

Sorry for the poor explanation but hope it helps. I believe Paul explains this in his DVD's you should probably buy them. You'll learn a lot.

09 September 2009, 08:46 AM
Thanks again. It does help, though I am still having a bit of trouble with this.

I have managed to add a custom rollout to a PEN attribute holder (or indeed any modifier, heh). Was deceptively simple, but then most things are once you figure them out (not without help, of course).

However, is there a way that I can get the Parameter Editor to interface with this newly created rollout? Not necessarily with the items in the Rollout, but "just" add elements from the Parameter Editor to the Rollout?

09 September 2009, 11:09 AM
No you can't, well you could if you wrote it exactly the same way that the PE would and added the defData that is needed for it to work.

It is easier to just manage it your self.

def=custAttributes.getDef $.modifiers[1] 1
format def.source to:(newScript())

Then add the line


just after the header line.

attributes theAttribName
--Everything goes here.

CGTalk Moderation
09 September 2009, 11:09 AM
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.