Python – Getting rules from a connection mapping template

This snippet shows how to read a connection (or value) mapping template into a Python dictionary.

t = Application.Dictionary.GetObject( "Model1.Mixer.MappingTemplate1" )

n = Application.GetNumMappingRules( t )

d = {}
for i in range(1,n+1):
        r = Application.GetMappingRule( t, i )
        d[r.Value("From")] = r.Value("To")
for k, v in d.iteritems():
     Application.LogMessage( k + " > " +  v )

Line 8 GetMappingRule uses output arguments, so we have to take the returned ISIVTCollection and extract the From and To output arguments. We use From as the dictionary key.

PhysX and CUDA-enabled GPU

Softimage 2011 includes PhysX 2.83 and supports CUDA acceleration for PhysX rigid body dynamics (this includes ICE rigid bodies). So what do you need to do to take advantage of CUDA ?

You need an NVidia card that supports CUDA, and you need to enable PhysX hardware acceleration in the NVidia control panel.

If all requirements are met, an INFO message “PhysX Hardware is Enabled” is logged in the script editor the first time you use ICE RBD.