Easily creating Guids in Softimage XSI

July 1st, 2006 by Patrick Boucher - Viewed 240622 times -

As far as I’m concerned, one of the last few ugly pimples on the face of Softimage XSI is the GUID. A key component of SPDL files in XSI (SPDL files being another pimple), the Globally Unique Identifier helps identify, among other things, shaders and their parameters.

For some info on the GUID check out wikipedia and a previous post by Luc-Eric.

There are many ways you can create these identifiers, they are basically just a unique number written in hexadecimal form. Some even advocate taking a preexisting GUID and changing a few characters. Personally I wouldn’t do this, the opportunity for conflict in my opinion is just too great and creating a GUID is too easy anyway. To create a proper GUID on a windows system you can use the guidgen.exe command or many other methodologies but as long as you’re in XSI why shouldn’t XSI be able to create one for you?

Stick the following Python code in a toolbar button and you’ll turn Softimage’s premier tool into an identifier creating machine. Each time you run the script or press the toolbar button, XSI will create a proper unique GUID for you. On top of that it’ll put the identifier in the Windows clipboard so you can paste it into your SPDL file or whatever other place you want it.

import pythoncom, win32clipboard
# Create Guid
guid = pythoncom.CreateGuid()
# Put Guid in clipboard
# Show Guid

Why should you care about GUIDs? Well Stefano Jannuzzo will have an article on XSIBlog shortly about Phenomenon in the RenderTree that will make you care about Identifiers.

The above code is for Python on Windows. If anyone has alternative versions for JScript, VBScript as well as the Linux platform, please feel free to post them in the comments, I’m positive many people will find them usefull.

5 Responses to “Easily creating Guids in Softimage XSI”

  1. Hello Patrick,
    what”s wrong with
    logmessage XSIFactory.CreateGuid

  2. Absolutely nothing! ;)
    I hadn”t even though of looking there. That”ll teach me not to read the documentation.
    Thanks for the tip.

  3. [...] IBlog
    People and thoughts behind XSI in production…

    « Easily creating Guids in Softimage XSI Writing a Phenomenon for Softimage XSI and Mental Ray [...]

  4. bla says:

    why would one care about these id”s? Can we know?

  5. These GUIDs are a corner stone of SPDLs which are necessary for the writing of Shaders and Phenomenon. Check out Stefano Jannuzzo”s article here for a concrete example.