Part 4 – Successfully using the help files

In Xsi you get two main help files or “Guides”. If you click on the help menu in or press F1 in Xsi the “User’s Guide” will open. This can be very useful but not for these tutorials. The one we want is called the “SDK Guide” and is just under the User’s Guide in the help menu. The other way you can access the SDK Guide is by pressing F1 with the Xsi Script Editor as your active window (you can make it active by clicking on it).

In the SDK Guide you will see four tabs:

Out of the four tabs I only really ever use “Index” and occasionally “Contents”. The Contents tab is packed with tutorials and is great to use for refference and to learn a new section of Xsi. I reccomend at least taking a brief look through Contents just to see all the possibilities there are and if you have enough time I reccomend you go through the whole thing, Starting with “Script Development”, then moving to “Plug-in Development” and after that you’ll know enough to be decide what you want to do next.

The Search tab I don’t use because the Index tab is just a LOT quicker and easier to find what I’m looking for.

In a previous tutorial we used Application.ActiveSceneRoot.FindChild to find an object under the “Scene_Root”. If I type in “FindChild” into the search box under the Index tab I get quite a few options.

From here I choose “FindChild, X3DObject” but when I double click it to show the page I get a popup asking me if I want the C++ or SDK version. While using Python, VBScript or JavaScript we will always choose SDK. Then I click Display and the SDK Guide shows the FindChild Function along with the possible arguments (inputs).

So say I have 10 cubes in my scene, each one parented under another object and I don’t know any of their names. All I know is that there only one cube directly under the Scene Root and that is the one I want to get. According to the SDK Guide I can set the “Recursive” argument to False. If set to False Xsi says the FindChild function will only look directly under the Scene Root for my Object and not under any of the Scene Root’s children.

Now to only get cubes I can specify a Type. In the section that says Type, for its description there is a bit of blue text “siType” with a line underneath. Juat like web links clicking on these will take you to a different page. To find the correct argument for a cube, click the siType link.

For now we only need to use the right side of the page is displayed.

So now that we have all the arguments we need we’re ready to go:
As we can see the FindChild can take up to four arguments: “X3DObject.FindChild( [Name], [Type], [Family], [Recursive] )”
for [Name] we will use “*” – to find all names since we don’t know what the name could be.
[Type] = “cube”
[Family] doesn’t really matter for this case
and finally [Recursive] needs to be set to False.
Making our command look like:
cube_obj = Application.ActiveSceneRoot.FindChild("*", "cube", "", False)

Note that for [Family] we used “”. The “” just tells Xsi to use the default value.

Also when setting arguments, you have to set them in the correct order.
Running: cube_obj = Application.ActiveSceneRoot.FindChild("*", "cube", False)
would not have the same effect. Xsi will assume that you are setting the [Family] to False as [Family] is the option for the third argument. This is why even though we don’t want to change or set the [Family] argument, we still need to put something in there to be able to set the fourth argument correctly.

The help file may be a bit overwhelming now but most are at first and as time goes on you’ll get more comfortable with it. With this help file and google you’ll be able to acheive many marvelous things 😉

2 thoughts on “Part 4 – Successfully using the help files

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

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

Leave a comment