Running batch files from inside Softimage

You can use the System command:

var sCommandLine = "C:\\users\\blairs\\test.bat";  
System( sCommandLine );

You can also use WScript.Shell:

// Use XSIFactory.CreateActiveXObject if in NetView
var wsh = new ActiveXObject("WScript.Shell"); ("c:\\temp\\_SI.bat" )

If you want to use XSIUtils.LaunchProcess, you will have to do something like

XSIUtils.LaunchProcess( "cmd /C start C:\\test.bat" );

LaunchProcess is like the Win32 CreateProcess() api. You have to start a command interpreter session to run your batch file.

Using arrays to avoid Repeat

Here’s one of the basic building blocks for avoiding Repeat nodes when you want to loop over the elements of an array. The “trick” is to use an array like [0, 1, 2, 3, 0, 1, 2, 3] as the indices for Select in Array. That way, you get an array that repeats the selected elements over and over. So instead of looping N times over an array of 4 elements, you simply have to process an array of 4 x N elements (in this example, the number of repeats N is = 3).

The above is effectively the equivalent to doing this using a Repeat node:

PS To build an array like [0, 1, 2, 3, 0, 1, 2, 3], you use the Modulo node:

To be continued…

Licensing: Buying new licenses to run older versions

Occasionally I hear from a customer who has purchased new licenses but wants to use an older version of Softimage (because they are mid-project and don’t want to switch versions right now). For example, I recently heard from a Softimage customer who had purchased some additional 2012 licenses, but wanted to use them to run 2011.

The Autodesk licensing is not like the old Softimage licensing (where XSI 4.2 would run with a 4.0, 5.0, 6.0, or 7.0 license).

Previous version usage (the ability to run older versions of the software) is a Subscription benefit. If you buy licenses without Subscription, those licenses will run only one version of the software. For example, if you buy some Softimage 2012 licenses without Subscription, those licenses won’t run 2011 (or 2010 or 7.5).

When you are on Subscription, a 2012 license also includes a 2011 license, a 2010 license, and a 7.5 license. In a network license file, this looks like this:

PACKAGE 78900SFTIMA_F adskflex 1.000 COMPONENTS="85705SFTIM_2012_0F \
                85563SFTIM_2011_0F 84000SFTIM_2010_0F 78600SFTIM_7_5F" \

You’ll also see something like this in the Perform Status Enquiry output (in LMTOOLS):

Users of 85705SFTIM_2012_0F:  (Total of 2 licenses issued;  Total of 0 licenses in use)
Users of 85563SFTIM_2011_0F:  (Total of 2 licenses issued;  Total of 0 licenses in use)
Users of 84000SFTIM_2010_0F:  (Total of 2 licenses issued;  Total of 0 licenses in use)
Users of 78600SFTIM_7_5F:  (Total of 2 licenses issued;  Total of 0 licenses in use)

As far as I know, you can’t buy old licenses when a new version is available. There may be a short period of time after a new release when the previous version is still available for purchase, but that would be only for a few months.

Creating a point cloud using the positions of model instances

This is a scenario that came up on xsibase: suppose you have a model that includes multiple objects, and that you create many instances of that model. How do you create a point cloud that has a point for every object in every instance?

Put the model objects in a group, and put the instances in another group, so that you have a setup like this:

Then you can use Get Data with the groups to get two arrays: an array of the object positions, and an array of the instance positions. The objects are all positioned relative to an instance, so you can work out where to add the points.

Here’s how to do it with a Repeat node. Note that you need just one Repeat node: you don’t have to loop over the object kine.local.pos arrays, you can just use Multiply Vector by Matrix to multiply an array of vectors by an array of matrices. If you understand that, then you’re “thinking in ICE”.

Here’s how to do it without a Repeat node. Again, if you understand this, you understand how to think in ICE.