Effets spéciaux: la banlieue québécoise d’Hollywood


Special effects: the quebecoise suburb of Hollywood

Montréal –Avec une cinquantaine de productions hollywoodiennes à son actif, dont Avatar, Sin City et 300, la boîte québécoise deffets spéciaux Hybride sest hissée aux plus hauts sommets. Au point où certains studios pensent que son code régional 450 à Piedmont est celui dune banlieue de Los Angeles. «Cest la boîte deffets spéciaux qui men donne le plus pour mon argent», dit le cinéaste Robert Rodriguez, qui a réalisé les effets spéciaux de 11 films avec Hybride. Pas mal pour une entreprise née des suites dune faillite il y a 20 ans.

via Effets spéciaux: la banlieue québécoise dHollywood | La Presse.

Activating the Paint tool in scripting


Easy. You do it like this:

# Python
Application.PaintTool()
# JScript
PaintTool();

The real question is “how would you know about this undocumented command?”.

There’s several ways.

  • Maybe you grepped through Application\DSScripts\*.vbs for “Paint” or “Tool” and found %XSI_HOME%\Application\DSScripts\tools.vbs
  • Maybe you searched Application.Commands for the regular expression /Tool/ig.
  • Maybe you searched the XSI mailing list (Paint Tool by script )

Grouping parameters on an ICE compound PPG


In 2012 AP, you can create groups for your ICE compound PPGs:

  • Edit compound
  • Right-click exposed port
  • Click Properties
  • Use the Group box to add the parameter to a group

Editing the .xsicompound XML may still be the fastest way to do the grouping for large number of parameters. Especially if you’re a markup geek.

The SDK includes a new GetICECompoundPortProperties command that I think makes it possible to write a plugin that pops up a “group editor”. I’m thinking a grid control where you can edit the groups for all parameters, and then call EditExposedParamInICECompoundNode to apply the changes.

Before I knew about this new GetICECompoundPortProperties, I had started writing such a plugin only to find myself blocked because I couldn’t get all the port properties. I had managed to get the groups by parsing through the PPGLayout items, but now that will be even easier with GetICECompoundPortProperties.

Creating all factory ICE nodes


After seeing Vladimir Jankijevic’s screenshot of an ICE tree with all factory nodes and compounds, I decided to try writing a script that creates all the factory nodes and compounds.

So, it takes forever to create all the ICE nodes, at least 10 to 15 minutes or so. At first I thought my script had crashed Softimage (until I used Process Monitor, which showed me that Softimage was still chugging away loading compounds and presets). Dragging and dropping all the compounds from Windows Explorer wasn’t any faster.

I did learn something about Python from this exercise. To find all the .xsicompound files, I used a Python snippet I found on stackoverflow (lines 10-15 below). See the yield statement on line 15? That makes the function a generator function, which means the function returns one item at a time, so you can process items right away without waiting for the function to build the whole list of all files.

o = Application.GetPrim("PointCloud", "", "", "")
tree = Application.CreateSimulatedICETree(o, "siNode", "")(0)
Application.LogMessage( tree )

import os, fnmatch
from siutils import siut	# XSIUtils
from siutils import si		# Application
from siutils import C		# win32com.client.constants

def find_files(directory, pattern):
     for root, dirs, files in os.walk(directory):
         for basename in files:
             if fnmatch.fnmatch(basename, pattern):
                 filename = os.path.join(root, basename)
                 yield filename


d = siut.BuildPath( si.InstallationPath( C.siFactoryPath ), "Data", "Compounds" );

#
# Compounds
#
for filename in find_files(d, '*.xsicompound'):
	print 'Found .xsicompound:', filename 
	Application.AddICECompoundNode(filename, tree)

#
# Private Compounds
#
for filename in find_files(d, '*.xsicompoundp'):
	print 'Found Private .xsicompoundp:', filename 
	Application.AddICECompoundNode(filename, tree)

#
# Presets (compiled nodes)
#
d = siut.BuildPath( si.InstallationPath( C.siFactoryPath ), "Data", "DSPresets", "ICENodes" );
for filename in find_files(d, '*.preset'):
	# There's one compound that generates an error
	try:
		Application.AddICENode(filename, tree)
	except:
		si.LogMessage( "AddICENode failed for " + filename )

All nodes programatically created

Drag-and-drop all compounds