Softimage 2013 Python shortcuts gotcha

Softimage 2013 includes some changes to the Python shortcuts:

from siutils import si
si = si()					# win32com.client.Dispatch('XSI.Application')
from siutils import log		# LogMessage
from siutils import disp	# win32com.client.Dispatch
from siutils import C		# win32com.client.constants

The big difference is that si shortcut is now a function that returns the Application object. We had to make this change to fix some weird memory leak (the si object was out of scope in the module where it was created, and the Python parser could not properly delete it upon exit).

Here’s a suggested workaround from the Dev team to maintain backward-compatibility:

# ---python code begin ---
from siutils import si

if Application.Version().split('.')[0]>= "11":
	si = si()					# win32com.client.Dispatch('XSI.Application')

from siutils import log		# LogMessage
from siutils import disp	# win32com.client.Dispatch
from siutils import C		# win32com.client.constants
# --- python code end ---

The if block executes only if the current Softimage version is later than 11, which corresponds to 2013 or later.

hat tip: SS

Friday Flashback #67

Pull-quote from a 2002 datasheet for Softimage|3D 4.0:

“Nothing was comparable to SOFTIMAGE|3D, so we stuck with it again—and I’m glad we did. Softimage offers everything we need, and the animators here know the tools so well that we can play with different combinations, so it’s rare to get into a jam.

In fact, we’ve gotten crazy clever with it!”
Dan Taylor
Animation Director, ILM on Jurassic Park III

Here’s the actual datasheet. It’s kinda text-heavy, but as I remember it, the image quality of screenshots in PDFs was not so great back then.

The datasheet has one mention of XSI: SOFTIMAGE|3D also offers an easy upgrade path to the next-generation SOFTIMAGE|XSI™ nonlinear animation (NLA) system.

ObjectIDs and objects that don’t exist

As noted by iamVFX on si-community, the new Python method Application.GetObjectFromID2 doesn’t deal well with IDs that don’t match an object that exists in the scene (in fact, it crashes Softimage). The JScript version, Application.GetObjectFromID simply returns null in that situation.

So, it is probably best to use DataRepository.HasData to check if the ID represents a real object.

Note that Dictionary.GetObject can also be used to get objects by ID.

from siutils import si
si = si()					# win32com.client.Dispatch('XSI.Application')
from siutils import log		# LogMessage
from siutils import disp	# win32com.client.Dispatch
from siutils import C		# win32com.client.constants

MAX_IDS = 2000

for i in range(0,MAX_IDS):
	if XSIUtils.DataRepository.HasData( i ):
			o =  si.GetObjectFromID2( i )
			log( "%s : %s" % (str(i), o.FullName) )
			o = Application.Dictionary.GetObject( "object<%s>" % str(i) )
			s = "%s : GetObjectFromID2 failed. Dictionary.GetObject found %s (%s)" % (str(i), o.Name, si.ClassName(o))
			log( s )
		log( "%s : No object with this ID exists" % str(i) )

A new, blank Softimage 2013 scene has 757 objects. For your reading pleasure, the full list is below the fold.
Continue reading

The case of the missing crowd

Our first CrowdFX-related case in Product Support!

A customer reported that CrowdFX wasn’t working. When he opened a sample CrowdFX scene, he got all these “plug-in is not installed” errors [Hey, that’s the same error I blogged about yesteday, but this time it’s something different–Steve]

// ERROR : 2356 - This plug-in is not installed: CrowdFX_RigProxy
// ERROR : 2356 - This plug-in is not installed: CrowdFX_SkeletonsCloud
// ERROR : 2356 - This plug-in is not installed: CrowdFX_ActorProxy
// ERROR : 2356 - This plug-in is not installed: CrowdFX_ActorsProxies
// ERROR : 2356 - This plug-in is not installed: CrowdFX
OpenScene("C:\\Program Files\\Autodesk\\Softimage 2013\\Data\\XSI_SAMPLES\\Scenes\\ICE\\CrowdFX_Walk_Along_Paths.scn", null, null);

The real clue was an error logged at startup:

// ERROR : Traceback (most recent call last):
// File "<Script Block 2>", line 55, in XSILoadPlugin
// in_reg.RegisterMenu(C.siMenuTbICECrowdFXActorsID,"Actors_Menu",False,True)
// File "C:\Python26\lib\site-packages\win32com\client\", line 168, in __getattr__
// raise AttributeError, a
// AttributeError: siMenuTbICECrowdFXActorsID
// - [line 54 in C:\Program Files\Autodesk\Softimage 2013\Addons\CrowdFX\Application\Plugins\]

First, this shows the customer is using the version of Python 2.6 installed on the system (not the version shipped with Softimage). More importantly, it shows that the CrowdFX constants, like siMenuTbICECrowdFXActorsID, are missing.

For Python, all the Softimage constants like siMenuTbICECrowdFXActorsID are cached in the Python install folder. For example, the Softimage constants are cached in the folder C:\Python26\Lib\site-packages\win32com\gen_py\269C4D8C-E32D-11D3-811D-00A0C9AC19A9x0x1x0\

The solution in this case was to zap (delete) the gen_py folder, forcing Softimage to regenerate the generated type info cache.

The case of the missing Previous Version licenses

In this case, a customer received his new 2013 license for four seats of Softimage. He was able to start Softimage 2013 on four machines, but he could run Softimage 2012 on two machines only. What could be the problem?!?

Now, to diagnose this problem, you could do any one of a number of things:

  • Check the license file to make sure it has the right licenses.
  • Check the Perform Status Enquiry output from LMTOOLS, to make sure the license is actually installed.
  • Check the LMTOOLS debug log file, to see why the workstations are being refused Softimage 2012 licenses.
  • Check the workstations, to make sure they are configured properly for licensing.
  • Verify that when the customer tries to start 2012, they don’t have copies of Softimage 2013 still running.
  • Check the customer’s assets in our database (make sure they really have four licenses).

In this particular case, I could identify the issue by either checking the customers assets OR checking the actual license file. Because the problem was this:

The customer had two seats of 2013 on Subscription, and two seats of 2013 not on Subscription. Previous version usage (aka running 2012) is a Subscription benefit, so he had two 2012 licenses only.

Here’s a video walkthrough of a license file, where I point out what to look for when you’re trying to understand a license file.

In this video, I show you to tell what you’ve got in a license file.

# ERROR : 2356 – This plug-in is not installed

If you see errors like this at startup or in the script history:

# ERROR : 2356 - This plug-in is not installed: rcCustomFilterSettings
# ERROR : 2356 - This plug-in is not installed: jhBatchieOptions 
# ERROR : 2356 - This plug-in is not installed: CM_DefaultPrimitives_Preferences
# ERROR : 2356 - This plug-in is not installed: Arnold Render Options

it is because of custom preferences. Notice how all the errors include works like “settings”, “options”, or “preferences”.

These custom preferences use a custom property plugin to define their PPG (property page) layout. You’re getting an error because the custom property plugin isn’t loaded into Softimage.

It could be that the plugin is no longer installed on your system. In this case, you can delete the instance of the custom property from Preferences > Custom in the explorer, and delete the corresponding .preset file from the Data\Preferences folder (of your Softimage User folder, or from a workgroup folder, depending on how the plugin was installed).

The other possiblity is that some other plugin is calling RefreshCustomPreferences before the custom property was loaded. For example, this can happen if a plugin installed in your User location calls RefreshCustomPreferences, and the custom property used by a preference is installed in a workgroup. Softimage loads plugins in the User location first, before workgroup plugins, so this would give you the “plugin is not installed error”.

Checking the Softimage 2013 startup with Process Monitor

The other day, I ran Process Monitor to check out the Softimage 2013 startup.

After a restart of my machine:

  • Softimage 2012.SAP took about 44 seconds to start up.
  • Softimage 2013 took about 42 seconds to start up.

The process activity for 2012.SAP and 2013 look pretty much the same, except that 2013 does all its file and registry activity sooner, rather than later. I don’t know if that’s signficant (my 2012.SAP is an existing install that’s been there for awhile, while I just installed 2013 the other day).

One interesting thing I noticed is the Read Bytes info in the File Summary for Softimage 2013.
Notice how ICE compounds are at the top of the list. Softimage 2013 loads about 53MB of .xsicompound files.

Here’s a look at how the size (in MB) of the factory ICE compounds has grown by release:

2013 55MB
2012.SAP 49MB
2011 SAP SP1 33MB
2010 SP1 13.3 MB
7.5 13.1 MB
7.01 14.5MB