Create A Custom Form¶
Lets create a simple button bar with some useful commands. E.g. a menu bar which allows us to create often used item types with one click. Like area, directional lights, locator and group locator items.
To keep everything tidy we create our new form in a new group. Go to the bottom of Groups and double click on ‘’’(new group)’’’. Enter a name for your group. In our example lets name it ‘’Quick Create’’.
In this new group we now create a new form by double clicking on ‘’’(create form)’’’ which we call ‘’QuickCreateMenu’’.
Now we need to add some commands. The easiest way to do that is to use the Undos tab in the Command History (Script editor layout). With that window open we create as usual in the Item List Editor a new area and directional light, a locator and a group locator. You can now see a couple of new commands in the undo stack. And there are also the commands listed which modo used to create the new items.
We created our first custom form. To preview it select the form node and click ‘’’Preview Form’’’.
Nice but we want a toolbar with bottons. Select the form and under ‘’’Form Properties’’’ change the Layout to ‘’’Toolbar Horizontal’’’, set the ‘’’Icon Mode’’’ to ‘’’Icon only’’’ and the ‘’’Icon Size’’’ to ‘’’Small Icons’’’. Now we have a simple toolbar. You can see that three of the commands already have an icon. That is because some default commands of modo have an icon assigned by default. The group locator has none you can easily assign a new one in the ‘’’Custom Icon’’’ drop down or use an iconResource.
Since we want to insert our toolbar into the modo layout we need to activate Export in the Form Properties panel.
By default modo saves all changes in the UI when we close it or if we do it manually with File > Save Config. The downside is that everything is saved in one big configFile which is not very flexible and not error prone.
The better approach is to separate the configs which makes it to update to a different modo version, move our configs to a different file location or disable specific configuration e.g. keyboard shortcuts.
To export our form do the following: Select the toolbar form in the ‘’’Form Editor’’’ and click on ‘’’Save Form…’’’. As location choose the modo default config location and create a new sub-directory which we call ‘’QuickCreate’’. Save the configuration as ‘’QuickCreateForm.cfg’’
‘’’OS X:’’’ /Users/<username>/Library/Application Support/Luxology/Kits
Now start a new modo instance and if you go to the form editor our cusom QuickCreate Form should be there.
Now we need to insert our new from into the UI. There are many ways to do this in modo but we will do the easiest one first. For that we are using the so called tail marker which every from has. In our case we use the special ‘’modoModesTail’’.
First we search for "modo modes" and under Forms or (ungrouped) we find our insert point.
Clear the search and now we select our ‘’Quick Create’’ form and drag it all the way down into the ‘’modo Modes Tail’’ ‘’’Tail Category’’’.
Now our custom menu shows up in modos main toolbar.
Scroll back up to your original form, select it and Export.
There is a faster way to add a custom menu to the tail section of the modoModes toolbar by manually adding following code snippet to your config.
</hash> The [http://modo.sdk.thefoundry.co.uk/wiki/Form_Categories_and_Groups#Sorting_within_Categories Ordinal] type sets the the order of the form.
We will do this in the next section where we create a custom button.