Where does PPG come from?

In property page callbacks like OnClicked and OnChanged, you can use the PPG object to access the parameters on the property page. For example:

def TestProp_text_OnChanged():

The docs say that PPG is a global variable, but if you try to use PPG outside of a callback, you’ll get a “name is not defined” error.
Or, if you try to put all your callbacks into a separate module, you’ll get that “name is not defined” error again. Several XSI users have hit this problem:

Subject : Re: PPG in self-installable plugins
Interpreter global?
If you just start the script editor and type:


You’ll get:

#NameError: name 'PPG' is not defined

But in the aforementioned callback if you do:
def TestProp_text_OnChanged( ):
if 'PPG' in globals():

It’ll find PPG in the globals. When did it get there and how? And more importantly who’s globals?

globals() is module specific (Dive into Python, 8.5 – locals and globals) so if I define a decorator in a separate module it can’t access the global PPG that lives in the global namespace of my plugin.

Arrggsjabcsjdbhcsd!!! My brain is turning to mush!

So what’s up with this PPG object? Where does it come from, and why can’t you access it when you put the callback function into a module?

The answer is that the callback is executed in its own instance of the scripting engine, with its own namespace.
To execute the callback, XSI creates a script engine for the logic (aka the ppg callbacks), and inserts the PPG object into the scripting engine namespace.

When I answered this question back in 2005 on the XSI list, I was officially named one of the ten coolest people in the Universe :-).

The case of the missing VBScript

Softimage (formerly known as XSI) depends on VBScript. If there is a problem with VBScript on your system, Softimage just won’t start. Typically, you won’t see anything when you try to start XSI.exe, or you may see the splash screen just before XSI crashes. I see a couple of these cases each year.

Here’s a quick way to check whether VBScript is working on your system:

  1. Click Start > All Programs > Softimage Products > SOFTIMAGE XSI 7.01 > Command Prompt.
  2. In the command prompt, run this command notepad hello.vbs.
  3. Click Yes to create the file.
  4. In Notepad, type this: LogMessage “hello”
  5. Click File > Save.
  6. In the command prompt, run this command: xsi -script hello.vbs
  7. If VBScript is not registered properly on your system, you’ll get the error

    ‘ FATAL : The VBScript engine is not installed. This application requires VBScript to run.

To resolve the problem, use these steps:

  • Click Start, Run and type regsvr32 %systemroot%\system32\vbscript.dll
  • If the registration was successful, you should now see the following message: DllRegisterServer in vbscript.dll succeeded.

If the above does not help, of if you receive an error message when registering vbscript.dll, then try installing Windows Script 5.6.

Another way to test VBScript, is to create a .vbs file with this code:

WScript.Echo "Hello World"

and then run it from the command-line:

cscript hello.vbs

If you get the Can’t find script engine “VBScript” for script error, then run regsvr32 %systemroot%\system32\vbscript.dll.

Using ray3 to help the render region in XSI

I actually did not know you could do this. But I was speaking with a customer the other day who does this. He is using his mental ray standalone licenses to get 16 CPUs help out his render regions (there is no limitation on the number of ray3 “satellites” that you can use).

This is an example of “standalone” distributed rendering, which is like “satellite” rendering, but with ray3 and mental ray standalone licenses.

You just have to fill in your ray3hosts file with the names of the ray3 slaves.

Show Values doesn’t work if you have Geometry Approximation

I was trying to debug an ICE graph with Show Values, but the values would just not show. Eventually I turned to the docs, and I found my answer (in the Debugging ICE Trees > Displaying Port Values topic):

Per-component attributes cannot be displayed on polygon meshes that are subdivided using the geometry approximation method.

Sure enough, my mesh had a Geometry Approximation property on it.

Hat tip to the doc team for adding this info to the 7.5 docs (it wasn’t there in 7.0).

Shaders loaded by XSI

In general, mental ray, from inside XSI, only loads shaders from $XSI_BINDIR and $XSI_CPU_OPT.
Both these environment variables are set in setenv.bat (.xsi_7.X on Linux), unless the ray3rc location has been overridden by MI_ROOT.

So if you find that XSI is looking for shaders in the wrong place (eg you are getting black tiles/images rendered), then check that MI_ROOT is not set system-wide to an old location.

h/t: Halfdan

Borrowing Licenses

Network licenses can be borrowed from the license server.

For example, you can borrow a license onto your laptop, and then disconnect from the network and still run Softimage.

To borrow a license:

  1. Connect your laptop to the network (so you can access the license server).
  2. Start Softimage on your laptop.
  3. In Softimage, click Help > About Autodesk Softimage.
  4. Click Product License Information.
  5. Click Borrow License.
  6. Specify a start date and end date for the borrowing period.
  7. You can click Help to read the License Borrowing documentation.