Finding point clouds


Point clouds are a type of X3DObject, so you can use FindChild and FindChildren to find point clouds.

BUT watch out, the SDK docs list the wrong type constant: siCloudPrimType.
That type was for the old, obsolete particle system.
For ICE point clouds, use the constant siPointCloudPrimType (“PointCloud”).

from win32com.client import constants as c

PointClouds = Application.ActiveSceneRoot.FindChildren2("*", c.siPointCloudPrimType ) 
for pointCloud in PointClouds :
    Application.LogMessage(pointCloud.FullName )

Friday Flashback #11


Softimage and Maya releases are now synchronized (same release data, same “version” number), but it wasn’t always that way. Here’s a timeline comparison of the XSI and Maya releases between 1998 and 2003.

And at Siggraph 1998, back near the start of this timeline, here’s what was happening:

  • Alias announced price reductions of 25 percent to 40 percent, which was welcome news to many studios interested in adding Maya to their tool set.
  • Softimage showed the 2.0 version of Digital Studio (now shipping). 1.0 had been released in Nov ’97.
  • Softimage continued to tantalize customers with extended previews of Sumatra.

Softimage 2012 delivery options


UPDATE: Softimage 2012 is not released yet, but it is coming, so I thought I’d start posting some information about the release.

For most customers on Gold Support, download is the default delivery method for the 2012 upgrade.

If you want a box, head over to the Subscription Center and change the delivery preference from “download” to “box” in your Subscription Center profile settings.

There’s a number of Subscription Center tutorials posted on autodesk.com, including one on downloading your software.

A brief history of the Python multi-dispatch issue


For the most part, this is no longer a problem, although there may be a few cases where you have to use win32com.client.dynamic.Dispatch. A huge effort was put in to XSI 6.0 to get rid of this “dispatch” issue.

The main problem was that XSI used a technique called “Multi-Dispatch” rather than normal inheritance to organize the interfaces supported by each object in the Scripting Object Model. In the original SDK, this was designed to maintain binary ompatibility for the now-obsolete COM C++ API.

The problem was that because Python used optimizations to read and compile the contents of typelibs rather than communicating with XSI directly via IDispatch, objects did not always appear to have all the methods and properties that they are supposed to.

For XSI 6.0, the OM hierarchy was overhauled to use derivation and inheritance instead of the multi-dispatch mechanism.

Prior to XSI 6.0, the workaround was the __init__.py file hack, as described in this 2005 post to the XSI Mailing List by Jerry Gamache:

—–Original Message—–
From: owner-xsi@Softimage.COM [mailto:owner-xsi@Softimage.COM] On Behalf Of Jerry Gamache
Sent: March-17-05 2:23 PM
To: XSI@Softimage.COM
Subject: RE: avoiding using get value with python

XSI sometimes return objects with an incorrectly set (as per PythonWin standards) multi-dispatch interface.

The way to work around that is to re-wrap the object in a dynamic dispatch. This allows you to skip the Application.GetValue:

def dispFix( badDispatch ):
	import win32com.client.dynamic
	# Re-Wraps a bad dispatch into a working one:
	return win32com.client.dynamic.Dispatch(badDispatch)

# Let's see if this works:
Application.CreatePrim("Sphere", "MeshSurface", "", "")
Application.ApplyHairOp("sphere", "")
oHair = Application.GetValue("hair").ActivePrimitive.ConstructionHistory.Find("HairGenOp")
try:
	Application.LogMessage(oHair.Parameters['EmitterMeshSubdlevel'].Value)
except:
	Application.LogMessage("Incorrect dispatch pointer")
oHair = dispFix(oHair)
Application.LogMessage(oHair.Parameters['EmitterMeshSubdlevel'].Value)

# or, as a single long line:

dispFix(Application.GetValue("hair")  
	   .ActivePrimitive.ConstructionHistory 
	   .Find("HairGenOp")
	 ).Parameters['EmitterMeshSubdlevel'].Value = 1

If that really really annoys you and you don’t want to dispFix at all, there is a way to make sure everything works, but you need to modify a Python file to always return dynamic dispatches:

Change %PYTHONPATH%\Lib\site-packages\win32com\client\__init__.py

Look for the function called __WrapDispatch

And comment all lines except the last one that begins with “return dynamic.Dispatch( … ”

Of course it is always a good idea to backup files you are about to modify.