Friday Flashback #152


Kaboom! “In SOFTIMAGE|3D, the Effects > Kaboom custom effect in the Motion module allows you to explode complete hierarchies using dynamics and collision detection. Now you too can create your own earth-shattering kabooms!”

1997 screenshot
kaboom

Exploding Hierarchies with Kaboom

The Effects > Kaboom custom effect in the Motion module allows you to explode complete hierarchies using dynamics and collision detection. Now you too can create your own earth-shattering kabooms!

Features include:

  • Speed.
  • Complete interactivity. Move the source of the blast around and the pieces rearrange themselves.
  • Collision detection: bouncing and sliding.
  • Hierarchies: explode a whole hierarchy instead of individual objects.
  • Non-polygon mesh objects are treated as solid objects.

Using the Kaboom Effect

The Kaboom effect explodes the currently selected hierarchy. Dynamic calculations are done on the object, including gravity, wind, and collision detection with a ground plane. Objects can collide with the ground plane (from either side), bounce, and slide (continuous contact). Polygon mesh objects can be exploded into their constituent polygons.

Here’s an example of how to use the Kaboom effect:

  1. Get a primitive cube.
  2. Choose the Effect > Subdivision command in the Model module to subdivide the cube into polygons. Use the default values: 4, 4, 4.
  3. Choose the Polygon > BreakUp command in the Model module to “separate” the cube into polygons.
  4. Translate the cube upward so that it is completely above Y=0.
  5. Get a primitive grid.
  6. Choose the Effects > Kaboom command in the Motion module. The Kaboom dialogue box appears:
  7. Accept the default values and click Ok.
  8. You are prompted to select the ground object (click the grid).
  9. You are prompted to select the hierarchy to explode (click the cube).
  10. Play back the animation. The cube explodes and collides with the ground.

For a full description of parameters, see this command’s description in the Reference Guide.

Tips for Using the Kaboom Effect

  • If you are exploding polygon meshes, make sure to use the Polygon > BreakUp command in the Model module on them first (or PolygonDetach); otherwise the polygons stay connected.
  • If the Explode Meshes option is selected, polygon meshes are exploded into individual polygons. If Explode Meshes is deselected, polygon meshes are treated as solid objects. All other object types (NURBS, patches, nulls, etc.) are always treated as solid objects.
  • Don’t worry about deselecting Collision Detection for greater speed: it doesn’t slow things down much (if at all).
  • Deselect Tumble Rate unless it is required: it slows things down by at least half.
  • Polygon grouping is logical, not topological. This means that polygons are grouped according to their order in the model, not according to the geometry of the model.
  • The Collision Detection for the ground is based on the Y height of the object selected for the “ground” object: the plane at this height is used as the ground plane. The collision detection is not based on actual geometry.
  • The ground plane is double-sided-you can bounce an object off it from above or below.

Things to Try

  • Use a strong Pull value with a slow speed: it tears objects apart.
  • Move the Kaboom effect icon around and watch the blast rearrange interactively.
  • Use a negative value for the Falloff power: the blast strength increases with distance from the icon.
  • Use no Blast Strength (value of 0) and a slow Speed to “collapse” your model.
  • Create a strong blast with a 0 distance Falloff, high Bounce, some Tumble, and very little Slide, and place it above an object that is close to the floor. You’ll get a nice “splashing” effect.

Fixing DLL problems


If you ask me, these are all bad ideas:

  • Downloading missing DLLs from some DLL download site you found via a web search
  • Copying DLLs to your system32 folder
  • Copying DLLs from one version of Softimage to another

Fixing DLL problems involves doing some troubleshooting to figure out the root cause of the problem. Often, an error message about a DLL is just a symptom.

For missing DLLs, don’t download the DLL from some dll-download site. Usually a re-install of your software package, or an install of the appropriate redistributable package, will fix the problem.

Copying a DLL from one version of an application to another is a little crazy. You’re just asking for trouble 😉

Scripting FBX export and import


You can use the FBXExport command to create the ExportFBXOptions property, and then use either the OM or SetValue to set the FBX options. For example, this Python snippet creates the FBX property by calling FBXExport( “option” ), and then sets the FBX SDK version (for which there is no separate FBXSetExport command).

si = Application
si.FBXExport( "option" )
o = si.Dictionary.GetObject( "ExportFBXOptions" )
o.Parameters( "FBXSDKVersion" ).Value = "FBX201300"

You can do the same thing for FBXImport with FBXImport( “option” ), but I always got an error, even if the property was created.

si = Application

try:
	si.FBXImport( "option" )
except:
	o = si.Dictionary.GetObject( "ImportFBXOptions" )
	
si.LogMessage( o )

Emitting strands from a polygon cluster


Here’s a simple ICE tree that emits strands from a polygon cluster.
emit_strands
A general technique for these kinds of filtered emissions is to delete the points you don’t want. In this case, we check Cluster.IsElement. The tricky part is that Cluster.IsElement is a bool-per-polygon attribute, so we need to get into a per-point context. To do that, we get the emit location, which is per-point, and then at that location, the value of Cluster.IsElement. Now we’re in a per-point context, and we can use those per-point boolean values to delete points.

Note the use of Not instead of an If. We know IsElement is False for points that were not emitted from the polygon cluster, so we can logically negate it with Not to get True and feed that into Delete Point.

In pseudocode, we do this:

if not( IsElement ) delete point

instead of

if (IsElement == False) then delete point

Of course, for filtering we could just drill down into Emit Strands and set the filter on the Generate Sample Set nodes.
generatesampleset_filter

Adding ReferenceWidgets to PPGs?


It used to be possible to add a ReferenceWidget by calling oLayout.AddItem( “Param”, “ref”, “ReferenceWidget” ) in your DefineLayout. But that was four or five years ago, and it no longer works.

def MyProperty3333_DefineLayout( in_ctxt ):
	oLayout = in_ctxt.Source
	oLayout.Clear()

	# Test some other control types
	oLayout.AddItem( "Param", "txt", "Texture Space" )
	oLayout.AddItem( "Param", "scnref", "SceneReferenceWidget" )

	# Doesn't work
	oLayout.AddItem( "Param", "ref", "ReferenceWidget" )

	# Doesn't work
	oPPGItem = oLayout.AddItem( "Param", "", "dscontrol" ) ;
	oPPGItem.SetAttribute( "UIType", "ReferenceWidget" );

For reference 😉 this is a ReferenceWidget:
ReferenceWidget

And this is how a ReferenceWidget is added in SPDL:

	Parameter "inst_source" input
	{
		title = "Instance source";
		guid = "{5620730D-AEFC-4C4A-B1DF-9377E808E27B}";
		type = reference;
	}
...
	inst_source
	{
		Name = "Source Object";
		UIType = "ReferenceWidget.ReferenceWidget.1"
		{
			filter = "{6B579D20-3DC5-11D0-9449-00AA006D3165}";
			mode = "single";
		}
	}