The startObjectCreation() method is used to simulate the user finding a Create Panel button for a given object class and pressing that button, putting 3ds Max into create mode for that object class.
This method simply opens up the Create Panel at the right tab and category and depresses the appropriate object button.
This method is primarily intended for use in macroScripts, but can be used in generalized scripts. Script execution will continue immediately after entering the create mode, and you must ensure that the script does not interfere with the object creation.
The values that can be supplied to the optional returnNewNodes: keyword argument are true , false (the default) or #first . If true is supplied, all of the nodes created, up until the current create mode is exited, will be returned in an array. If #first is supplied, only the first node created is returned, immediately after it is created. The function doesn’t wait for the create mode to be exited by the user.
The optional newNodeCallback: keyword argument can supply a scripted function of one argument to the create mode that is started, such that the function will be called each time a node is created with the new node as its argument. This is similar to supplying pickObject() filter functions, although the return value of the newNodeCallback: function is ignored.
The returnNewNodes: and newNodeCallback: can both be supplied on the same call; the callback will be called on each node, and they will be returned in an array as the result of the startObjectCreation() function.
Returns true if the specified maxclass can be created in the UI, false otherwise. If the argument is undefined, also returns false .
FOR EXAMPLE: |
will return false unless at least one shape is selected, or if any non-shape is selected. This corresponds to whether the button for the object is enabled. |
Returns true if the specified maxclass is currently being created in the UI, false otherwise.
If called without an argument returns true if ANY object is being created in the UI, false otherwise.
In 3ds Max 2010 and higher, also returns false if the argument is undefined for consistency with okToCreate() .
Available in 3ds Max 9 and higher.