The case of the scene that wouldn’t play back

or how I learned to love binary search…

In this case, a customer uploaded a scene that always crashed at a certain point in the playback.

After poking around the scene for awhile, I deleted a model and that fixed the crash. The only problem was that the model contained a thousand (1000) objects, so deleting the model wasn’t really a solution. So my next step was to isolate the problem use a “divide and conquer” approach. Sort of like a binary search:

  • delete half of the objects (eg objects 1 to 500)
  • play back
    • if crash, then the problem is one of the objects in the second half (501 to 1000)
    • else the problem is one of the objects in the first half (1 to 500)
  • Repeat as required… at most 10 times (1000,500,250,125,62,31,16,8,4,2,1)

In the end, I narrowed it down to a single mesh object. We weren’t able to save that mesh (it had to be deleted and then recreated), but we did save the scene.


A binary search halves the number of items to check with each iteration, so locating an item (or determining its absence) takes logarithmic time. A binary search is a dichotomic divide and conquer search algorithm.

Dividing and conquering the problem space:

I’m off to Autodesk University this week

This week, I’m off to Autodesk University in Las Vegas. Four days of non-stop lectures, courses, and networking events/lunches/dinners. I’ll study hard, I promise 😉

There’ll be no time for sight-seeing, not like last time, when I took a couple of days to check out the surrounding desert:

I’ve pre-written and scheduled posts, so the blog will keep updating…

Scripting – Importing models without popping up PPGs

The ImportModel command pops up a PPG when it imports a model.

Since there is no OM equivalent of ImportModel, if you don’t want the pop-up PPG, you have to either turn off autoinspect in your script, or use the undocumented SIImportModel command. (SOme commands have a “SI” equivalent that doesn’t require any UI interaction or pop up any PPGs.)

If you want more info on SIImportModel (like what are the arguments), run this Python in the script editor:


Here’s a way to turn off autoinspect using a Python decorator:

def no_autoinspect(func):
	def wrapper(*arg):
		Application.Preferences.SetPreferenceValue("Interaction.autoinspect", False)
		res = func(*arg)
		return res
	return wrapper

def importmodels():
	Application.ImportModel("C:\\Users\\blairs\\Documents\\MyProject\\Models\\dodecahedron.emdl", "", "", "", "", "", "")


More about decorators:

Friday Flashback #45

Manta short from back in 2001 and the days of XSI 2.0. The Manta character was used in a variety of different marketing collateral. Looking back over the previous flashbacks, I see that Manta has already appeared twice, in flashbacks #12 and #34.

From Manta stuff from here and there on the Internet:

Softimage Hints At New Products, Highlights XSI

On April 23, 2001, at NAB, the annual international conference of the National Association of Broadcasters in Las Vegas, Softimage demonstrated version 1.5 of its SOFTIMAGE|XSI software and hinted that a new release would be ready for SIGGRAPH in July. “I can’t say much more,” program manager Michael Smith commented, “but this next release will be big.” Softimage introduced its “INNOVATE::CREATE::COLLABORATE” tagline and displayed the power of XSI with images of Manta, a 3D character created in XSI.

xsibase: What about Manta short

the manta short is already a few years old, and was never released in any form so you can watch it as a video or something. One of the guys who worked on it had some images on his website. There were at the time also some images on the Softimage website for wallpapers and such..

Jan 13, 2003Post id: 130287 You’re never gonna see Manta, or if you do, it will be unfinished. This is what I was told by Michael Sheasby, the marketing guy at Softimage. Manta was developed to demo (understand sell) XSI 2.0, and they left it unfinished after that.

We had the great privilege of seeing the Manta storyboards. However, even if all of them were on the wall, we couldn’t see the end. Michael started to tell us the story, but when he reached the last boards he nearly threw us out of the office! It’s strange, because he told us that the Manta project will never be finished.

I went to an Avid confrence last week (london 26 june 2002) and spoke to someone from the softimage dept. and asked them about this. They said that the Manta animation/film was initially being completed by 15 artists, but now just one person is left working on it as the others are completing other projects and it hopefully (probably not was the impression given) will be finished for siggraph 2002.

On the Experience CD (free when registered at the site) there are very short snippets of animation during the turials for texturing and the fx tree, and they look quite good. I was told at the Avid confrence that an entire CG film made in soley XSI would be released in a year or so (cant remember what its called though)
I also textured the manta character and gave him some hair last year at the computer arts show in angel islington 2001 as a workshop tutorial using a beta of version 2.

Downloading and using undocumented compounds

A few tips for figuring out how to use a compound you downloaded that has no documentation.
Inspired by this thread on xsibase about scatter compounds.

With experience, you can usually figure out where to create the ICE tree and what to plug into the compound. But if you’re stuck, here’s a few of tips:

  • Check out the error messages. Hover the mouse over the compound (not over a port) to see the first error message. To see all error messages, right-click over the node and choose Show Messages.
  • What attributes are unresolved? For example, if the node is red because of the ID attribute, then you probably need to put the compound on a point cloud, not a geometry.
  • Check out what’s going on inside the compound. If you see Add Point, then the compound needs to be applied to a point cloud.

Quick tip for using Select SubArray in Array

The docs for Select SubArray in Array say that

  • Start Index is The start index of the subarray to return.
  • End Index is The end index of the subarray to return.

But the start index is inclusive, while the end index is not.

In standard range notation: [start, end)

That means if start index = 2 and end index = 5, then Select SubArray in Array selects elements 2, 3, and 4 from the input array.

Adding a button to save preference changes

Softimage saves your preferences to %XSI_USERHOME%\Data\Preferences\default.xsipref when you exit Softimage.
If you want to save your current preferences, you can use the Preferences.SaveChanges() method.

Just drag this JScript to a toolbar to create a script button.

// JScript

For example, you could create a button on the Custom tab of the main shelf (View > Optional Panels > Main Shelf):

You probably want to make the button a Script Command (external file), so you can assign a keyboard shortcut to it.