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:

Application.EditCommand("SIImportMOdel")

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


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

importmodels()

More about decorators:
https://xsisupport.wordpress.com/2011/01/27/python-decorators/
http://www.xsiblog.com/archives/357

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.

http://vimeo.com/32636717

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..

http://www.creativecrash.com/forums/xsi-general/topics/manta-video

Atyss
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.

http://www.xsibase.com/articles.php?detail=5

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.

http://www.3dbuzz.com/vbforum/showthread.php?6315-Manta/page2

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 softimage.com 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.

http://vimeo.com/32540015

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
Preferences.SaveChanges();

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.

User locations for 32- and 64-bit Softimage


If you have both 32- and 64-bit Softimage installed, both versions will use the same User location. If you want separate User locations, you could modify the XSI.bat file that launches Softimage.

For example, setenv.bat defines an XSI_CPU environment variable, so you can check that and then reset XSI_USERHOME:

@echo off
call "C:\Program Files (x86)\Autodesk\Softimage 2012.SAP\Application\bin\setenv.bat"
if "%XSI_CPU%"=="nt-x86-32" set XSI_USERHOME=%XSI_USERHOME% (x86)
start "" "C:\Program Files (x86)\Autodesk\Softimage 2012.SAP\Application\bin\XSI.exe" %*

This will give you a User location like
C:\Users\blairs\Autodesk\Softimage_2012_Subscription_Advantage_Pack (x86)

Friday Flashback #44


This is a scan of a photocopy of an article that appeared in the November 1997 issue of Digital Magic magazine. If you didn’t know already, now you know where XSI got its UI 😉

November 1997 First Look: SOFTIMAGE|DS

SOFTIMAGE|DS is not like anything else out there–it’s the next step. Because of its nature and $100,000 price point, customers say the decision to purchase DS was a “no brainer”.

This is a huge, feature rich application–its full install consists of 1.9 million lines of code.

The interface has a beautiful, organic look. The ransport controls, although a conventional layout, look like little pillows, quite an inviting metaphor that begs you to dive in. The overall impression is one of friendly, all natural comfort.

Softimage does say that Sumatra, the code name for the company’s next-generation 3D animation system, will not only be available as a stand-alone system, but will also be built as an integral component of the final, shipping version of Softimage|DS.

Softimage users will recognize the “Rooms” concept of the interface, now carried foward with DS. On the left are buttons for NLE, Paint, Compositing, Audio, and Media I/O.

Scripting: Finding comment nodes in ICE compounds


Unless I missed something in the docs, you have to go through the old NestedObjects routine to do it.
Here’s a JScript version. Python to follow soon…

var n = Selection(0);

oEnum = new Enumerator( get_comments(n) ) ;
for (;!oEnum.atEnd();oEnum.moveNext() )
{
	var oComment = oEnum.item() ;
	LogMessage( oComment.Parameters("Text").Value );
}

//--------------------------------------
// Find comments
// Works with an ICENode or a compound
//--------------------------------------
function get_comments( node )
{
	var oComments = new ActiveXObject( "XSI.Collection" );
	if ( ClassName(node) == "ICENode" )
	{
		var oComment = node.NestedObjects("ICE Comment");
		if ( oComment != null ) oComments.Add( oComment );
	}
	else if ( ClassName(node) == "ICECompoundNode" )
	{
		var nested = Dictionary.GetObject( node.FullName + ".ContainedNodes" ).NestedObjects;
		oEnum = new Enumerator( nested ) ;
		for (;!oEnum.atEnd();oEnum.moveNext() )
		{
			var oItem = oEnum.item() ;
			if ( oItem.Type == "ICETreeComment" )
			{
				oComments.Add( oItem );
			}
		}
		
	}
	return oComments;
}
from siutils import si		# Application
from siutils import sidict	# Dictionary
from siutils import sisel	# Selection
from siutils import log		# LogMessage
from siutils import disp	# win32com.client.Dispatch
from siutils import C		# win32com.client.constants

def get_comments( node ):
	oComments = disp( "XSI.Collection" )
	
	if si.ClassName(node) == "ICENode":
		oComment = node.NestedObjects("ICE Comment")
		if ( oComment != None ):
			oComments.Add( oComment );

	elif si.ClassName(node) == "ICECompoundNode":
		nested = sidict.GetObject( node.FullName + ".ContainedNodes" ).NestedObjects
		for o in nested:
			if o.Type == "ICETreeComment":
				oComments.Add( o )

	return oComments
	
	
n = sisel(0)

# Get comments and print out the text
for c in get_comments(n):
	log( c.Parameters("Text").Value )