Copying tangent data with ICE modeling


Here’s an example of using Copy PolyNode Data from Source to copy tangent data from a source mesh to a cloned mesh. Typically you would plug this into the Execute on Copy port of a Create Copies from Polygon Mesh or Clone Polygon Mesh, but here I’ve done something more basic.

To display the tangent data of the clone in the viewport, I’m using the Vertex Color Display Property setting (OpenGL Display tab of the material applied to the clone).

More on getting the version of Softimage used to create a scene


Whenever you open a scene, you’ll see a message like this logged to the script history:

# INFO : 4034 - Loaded scene was created with build number: 10.5.98.0 - compatibility version: 1000
Application.OpenScene("C:\\Users\\blairs\\MyProject\\Scenes\\2012SAP_Scene.scn", "", "")

# INFO : 4034 - Loaded scene was created with build number: 10.1.62.0 - compatibility version: 1000
Application.OpenScene("C:\\Users\\blairs\\MyProject\\Scenes\\2012SP1_Scene.scn", "", "")

If you want to know the version of Softimage that was used to create the scene, you need to check the specific build number (and there’s a couple of ways to do that, we’ll get to that in a second…).

The compatibility version is more a property of Softimage itself than of the scene. You can get the value of the project.CompatibilityVersion parameter, but it’s always going to be the compatibilty version of the current Softimage instance, not of the loaded scene.

p = Application.Dictionary.GetObject( "project.CompatibilityVersion" )
print Application.ClassName(p)
print p.Value

# OR

print Application.GetValue( "project.CompatibilityVersion" )

To find out the version of Softimage used to “build” a scene, you can use the printver utility, or look in the scntoc file. In this context, “build” means the version of Softimage that was last used to save the scene. I note that just opening a scene and saving it isn’t enough to bump up the build version. You need to do something to the scene, or at least do something and then undo it.

From Jeremie Passerin on the Softimage mailing list, here’s a Python snippet that reads the version from the scntoc:

# Python Code
import xml.etree.ElementTree as etree

ext = 'scntoc'
scn = 'C:\\Users\\blairs\\Project\\Scenes\\Test.%s' % ext

tree = etree.parse( scn )
root = tree.getroot()
version = root.get("xsi_version")

LogMessage(version)

Here’s a JScript snippet that reads the version from the scntoc:

var dom = new ActiveXObject("msxml2.DOMDocument.6.0");
dom.async = false;
dom.resolveExternals = false;

ext = 'scntoc';
scntoc = 'C:\\Users\\blairs\\Project\\Scenes\\Test.' + ext;

dom.load( scntoc );
var oNode = dom.selectSingleNode("xsi_file");
LogMessage( oNode.getAttribute( "xsi_version" ) );

If you don’t want to rely on the existence of a scntoc, you could use the printver.exe utility that ships with Softimage. Given a scene file, printver prints a message that looks like “This Scene was built with version: 11.0.525.0”.

Here’s a JScript snippet that runs printver and gets the version number from STDOUT:

// JScript
var WshShell = new ActiveXObject("WScript.Shell");

scn = "\\\\server\\Project\\Scenes\\Whatever.scn"

sExec = "printver " + scn

var oExec    = WshShell.Exec( sExec );

while ( !oExec.StdOut.AtEndOfStream )
{
	s = oExec.StdOut.ReadLine();
	if ( s.indexOf("This Scene was built with version") != -1 )
	{
		var version = s.split(":")[1].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
	}
}

LogMessage( version )

And here’s a Python snippet:

import subprocess

scn = 'C:\\Users\\blairs\\Documents\\Support\\Project\\Scenes\\MySphere.scn'
p = subprocess.Popen( 'printver -l %s' % scn, stdout=subprocess.PIPE )
stdout = p.stdout.readlines()
print stdout
print stdout[-1].split(':')[1].lstrip().rstrip()

See the thread on the Softimage mailing list, which includes a VBScript snippet for getting the build version.

New Tool: ICE Tree Trace from Bradley Gabe


ICE Tree Trace is a new tool from Bradley Gabe. Download it here.

It’s a plugin, so you want to save it in the Application\Plugins folder of either your Softimage User location, or of a workgroup.

Or drag this addon to a viewport.

After you install the plugin, you’ll have a new menu in the ICE Tree view:

ICE_TraceRefString:
Tool for tracing instances of strings inside ICE Trees. Can be used, for example, to track down the number of times a specific attribute is called. Via filters, may also be used to determine how an attribute is called, whether by Get Data, Set Data, or other ICE nodes that handle string parameters.

Here’s an example. I used Tree Trace to find all references to the Texture_Projection attribute in a CrowdFX scene:

Usage:
Specify search options, enter a Match String, then press the trace button. If matches are found, the address of the ICE Nodes are listed in the Match List at the bottom of the GUI. If items are selected in the Match List, their corresponding nodes are selected in the scene

NOTE: At present, there is no access in the SDK to directly select nodes inside an ICE Tree node graph interface. ICE nodes are selected in the scene, and may be accessed via the explorer.

GUI Parameters:
Search Scope:
• Selected ICE Nodes – Search only within currently selected nodes in ICE Tree
• Local ICE Tree – Search all nodes in the currently open ICE Tree
• ICE Trees on Sel Scene Items – Any ICE Tree on selected scene items
• Global Scene – All ICE Trees in the scene

ICE Node Filter:
• All ICE Nodes – No filter
• Get Data only – Search for string matches only in Get Data nodes
• Set Data only – Search for string matches only in Set Data nodes
• Other Nodes – Search for string matches in nodes that are not Get Data or Set Data (Shape Instance, String nodes, etc)

Match String: String to be searched for inside ICE Tree

Cap Sensitive: Consider capitalization in search string (Overridden by RegExpr matching)

Use Regular Expression Matching: Allows user to specify match strings using regular expression syntax

Checking the version used to create a scene


If you can live with the flash of a command prompt window, you can use subprocess.Popen to get the scene file version from printver.

import subprocess

scn = 'C:\\Softimage\\XSI-EXP_3.0\\Data\\XSI_SAMPLES\\Scenes\\dog.scn'
p = subprocess.Popen( 'printver %s' % scn, stdout=subprocess.PIPE )
stdout = p.stdout.readlines()
print stdout[-1].split(':')[1].lstrip().rstrip()
# 3.0.2002.0715


#scn = 'C:\\Softimage\\XSI_7.01_x64\\Data\\XSI_SAMPLES\\Scenes\\ICE\\Particle_Basic_Fire.scn'
# 7.0.2008.0708

Friday Flashback #69


1999 wireframe for the Blue Sky “Bunny”. “Nearly all the animation” in Bunny was done in SOFTIMAGE|3D.

  • While its moving story line has certainly contributed to the popularity of “Bunny,” in CG circles what makes this piece so special is the fact that it is the first computer-animated film whose environments were rendered entirely using radiosity. Radiosity is an advanced rendering technique that mimics the subtlest properties of natural light. For “Bunny,” the use of radiosity created an unparalleled dimensionality and organic realism never before attempted in a computer-animated film. Helping the Blue Sky team accomplish this feat was CGI Studio, the company’s proprietary lighting software.
  • …it took the Blue Sky crew 14.75 hours to render each frame of the animation (rendering was done on 14 Compaq AlphaServer RenderPlex systems, with a total of 164 processors)
  • Bunny’s fur was quite complex. There were more than 14,000 clumps of hair on Bunny’s body. Each clump consisting of approximately 50 hairs—were actually invisible cones that were texture-mapped with a mixture of short and long hairs. In total, there were 5640 long-hair cones, 8524 short-hair cones, and 269 shaggy-hair cones. Adobe Photoshop and Interactive Effects’ Amazon 3D Paint were used for texture-map creation.
  • Work on the models in “Bunny” began long before the NURBS modeling method was developed…nearly all of the models were built using an old modeling method called Constructive Solid Geometry (CSG).
  • Nearly all of the animation was done in Softimage. To make the CSG models animate in Softimage, Blue Sky wrote a program that converted the CSG models into polygonal representations that Softimage could understand. Because Amazon 3D Paint works with polygonal models, the team had to texture the CSG models using a combination of Photoshop and proprietary tools.
  • The only animation in “Bunny” that was done in CGI Studio is the scene at the end of the film in which 100 or so moths are flying around the afterlife environment. To animate the moths in that sequence, Blue Sky animator Rhett Collier wrote procedural animation code implemented through CGI Studio. “He figured out through math formulas how a moth would flap its wings. Then he transferred that over to his procedural program, which controlled how the moths came into the scene, making sure they didn’t interpenetrate each other, and varying the way each one flapped,” says Doug Dooley, one of the lead animators on the project. “It was a brilliant program, and very sophisticated procedural animation.”
  • All modeling and animation were done on Silicon Graphics workstations.

New product support offerings from Autodesk


Autodesk recently unveiled its new support offerings. What does this mean for a Softimage customer?

  • Advanced support is basically Gold support renamed. You don’t lose any Subscription benefits that you already have.
  • Basic support is not available for Softimage and a handful of products, such as MotionBuilder, Showcase, Alias, and Simulation. In general, the reason why these products don’t have Basic are 1) they are acquisitions and we are maintaining the same level of support as they had before, and 2) they are complex products that require a high-level (eg expertise level) of support that our partners cannot provide.
  • Up & Ready support is available for 90 days (it was previously 30). So if you buy Softimage but not Subscription, you get 90 days of Up & Ready support for install and licensing problems.
  • Per-incident support is available for Softimage (it wasn’t before). Again, this is good for non-Subscription customers only. I believe it costs something like $150US.

Overall, the purpose of these new support offerings is to let the [majority of] customers choose the support that is right for them.

Crosswalk, Common Files, and the PATH environment variable


Anytime you have problems with Crosswalk not showing up in Softimage or Crosswalk missing or dotXSI liberaries missing, it’s probably because the Common Files location is missing from your PATH environment variable.

Now, setenv.bat does add the Common Files location to the PATH:

rem Adding folder(s) to the Path
set SOFTIMAGE_COMMONFILES=C:\Program Files\Common Files\Softimage
if not "%XSI_SetenvDone%"=="" goto Done_Path
set Path=%XSI_BINDIR%\%XSI_CPU%%_CPU_REVISION%;%XSI_BINDIR%;%SOFTIMAGE_COMMONFILES%;%Path%
:Done_Path

but strangely, this doesn’t [always] help.

  • If you start Softimage from the Start menu, this Softimage still can’t find the common file Crosswalk_2013.0.64.dll (which is installed in C:\Program Files\Common Files\Softimage).
  • But if you start Softimage from a command prompt with XSI.bat, Softimage does find Crosswalk_2013.0.64.dll.

I stumbled on this when I wrote a little script to check whether or not Common Files was in the PATH. Because setenv.bat prepends the Common Files location to PATH, I need to check whether there is more than one occurrence in the PATH. If there’s just one, then that’s a problem because Crosswalk won’t be found when you start Softimage from the Start menu.

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


path = XSIUtils.Environment( 'PATH' )
cf = "".join( [XSIUtils.Environment( 'CommonProgramFiles' ), '\Softimage'] )
#cfx86 = "".join( [XSIUtils.Environment( 'CommonProgramFiles(x86)' ), '\Softimage'] )

# Check Common Files

# Log number of times Common Files is found in PATH
# log( path.split(';').count(cf) )

if path.split(';').count(cf) > 1:
	log( "'%s' is in PATH" % cf )
else:
	log( "'%s' is missing from PATH" % cf, C.siError )

The case of the missing dotXSI.dll (NT) or libdotxsi.so (IRIX)


A customer reported that he couldn’t import or export dotXSI, and that he got this message in the history log:

# INFO : 4011 - Import/Export .xsi: The dotXSI.dll (NT) or libdotxsi.so (IRIX) is missing or the class is not registered.

From past experience I was pretty sure this was a PATH problem, but just in case I also suggested running runonce.bat to make sure everything was registered:

  • Check that “C:\Program Files\Common Files\Softimage” is included in your system PATH environment variable.
  • In a Softimage command prompt, run runonce.bat, to make sure all DLLs are registered.

It turns out the problem was indeed the PATH environment variable: it was missing C:\Program Files\Common Files\Softimage.

To check the PATH, click Start and open the Control Panel. In the Control Panel window, type “environment” in the Search box, and then click Edit the system environment variables