Create Objects Toolbar API

editor.addObjectCreateGroup(name, icon, objectClasses)
  • name – the name of the custom create group
  • icon – the icon for this group’s button (editor.icons.<some icon name>)
  • objectClasses – an array of object class info tables to create the buttons in this group, the info table for a class can be created with the editor.makeCreateObjectItem function

Add a new create objects group button to the create toolbar.

Parameters:name – the name of the create group

Return a create group info table by group name.

editor.makeCreateObjectItem(icon, classname, title, buildFunc, singleInstance)
  • icon – the icon for the create object button
  • classname – the C++ classname for the create object button, to create the instance for
  • title – the display name for the class
  • buildFunc – the function to be called right before the instance is created, so you can setup the object
  • singleInstance – true if this button will create a single instance on click, otherwise if false, you create instances by clicking in the 3D viewport until ESCAPE is pressed

Prepare a create object item for the toolbar. Used as a helper when creating the array for the new group.