Part 1 – Easily turn echoed commands into buttons.

Firstly you need to have your script editor open (Alt+4) or use the icon Image.

For this tutorial we’re only going to be interested in the bottom half of the script editor (the “output”). This is the section of the script editor that shows the basic commands resulting from you clicking and editing things in Xsi.

Its often cluttered with all the commands that have been run so right-click on it and from the popup menu choose “Clear All”. This will make it easier for us to see exactly what code needs to go into our button.

In my case I want to freeze the modeling on all of the objects in my scene. So, I select all the objects in my scene (with Ctrl+A) and then using the Freeze M button  Image

The script editor echoes the commands:

Application.SelectAllUsingFilter("object", "siCheckComponentVisibility", "", "")
Application.FreezeModeling("", "", "")

This is what I need to add to my button. But I need a “Toolbar” to add the button to first.

You can either add a button to an existing toolbar or you can make a new toolbar (View > New Custom Toolbar).

Then all I need to do is to select the commands from and drag them onto the toolbar.

Image

Once you let go Xsi will ask you which type of button you wish to create, leave “Script Button” checked and press OK. This brings up the button’s settings. You’ll notice your code in the top “Script Commands” section. Give it a name (something descriptive, its not much fun having a toolbar filled with buttons called button1, button2, button3 etc). I also reccomending giving the button a tooltip (description of what the does).

And thats it! You’ve just made your very own custom button 🙂

Before you close Xsi and start bragging to your friends about the awesome button you’ve just made, you might want to save the toolbar so you can use the button next time you open Xsi. To do this just right-click the toolbar and choose save. Give your toolbar a name and after you’ve clicked OK a file browser will open asking you where you want to save your toolbar. Don’t change anything, just press OK again and your toolbar will be saved to your personal Xsi folder filled with all your prefferences and other things.

2 thoughts on “Part 1 – Easily turn echoed commands into buttons.

  1. Pingback: Start Here!!! « Conquering the Code in Softimage Xsi

  2. Pingback: Start Here!!! | Conquering the Code in Softimage Xsi

Leave a comment