Pickbutton

A pickbutton item is used to place a scene object-picker button on the rollout. It operates like a normal pick button in the 3ds max user interface, turning light-green when pressed and causing an object-pick mode to be entered. The user can then choose a scene object by clicking on it. The pick mode exits and the button returns to its unpressed state. The user can right-click to cancel the pick mode. The syntax is:

pickbutton <name> [ <caption> ] [ message:<string> ]  \

                  [ filter:<function> ] [ toolTip:<string> ]

The default alignment of pickbutton items is #center.

Example:

fn foo_filt obj = findString obj.name "foo" == 1

pickbutton chooseit "Select master object" filter:foo_filt

on chooseit picked obj do

(

master = obj

chooseit.text = obj.name

)

Parameters

message:

The optional text to be displayed in the 3ds max status line while in the pick mode. Default is no message.

filter:

The optional filter function that will be called to test the eligibility of the scene object under the cursor for picking. It must be a function of one argument, which will be the object under test, and return true if the object is eligible or false if not. For example, the following filter function allows only objects whose names begin with "foo" to be pickable:

fn foo_filt obj = findString obj.name "foo" == 1

Default is no filtering.

toolTip:

Provides text for a tooltip for the button. No tooltip if unsupplied.

Properties

<pickbutton>.object            Node

The last object picked using the pickbutton, undefined if no object has been picked. This property is read-only.

Events

on <pickbutton> picked <arg> do <expr>

Called when the user selects an object in the scene while in the pickbutton pick mode. The <arg> argument contains the selected object. The handler is not called if the user cancels out of the pick mode.

See also