View Full Version : shatter digital asset

08 August 2011, 03:09 PM
hi !

I have just started learning houdini with the free demo version.

but none of the sources of information which I checked was able to help me with the following question :

I'd like to create a simple digital asset which lets me shatter objects, basically using (for starters) just the simple number of frantures of the 'fractureParams' node plus the input MESH. the rest, like the rigid body solver and gravity should all stay inside the DA.

what I want to be able to do is be able to define the input geo as a parameter for the DA, so be able to exchange a cube e.g. for a sphere, then simply run the sim again and again.

is that possible ? or what would be the most similar approach to do something like this ?

thanks for any input !

08 August 2011, 07:52 PM
It is possible, but I'm not the guy to answer directly. Are you having problems creating the effect or creating a digital asset? Because there are tutorials on the latter.
And while not a shatter tool, this is a video of a asset that creates cracks (needs to shatter the area inside the crack). You might find this helpful.
Houdini Cracking Tool on Vimeo

08 August 2011, 08:51 PM
hi !

thanks for the reply and input.

no, here it's about creating the asset.

the effect itself (falling cube which shatters into pieces on the floor) is no problem.

the problem is that the reference to the cube geometry is made inside the autoDopNetwork, thus I have already the problem of handing "down" different objects (sphere) into that autoDopNetwork to shatter instead of the cube.
That jump in the level, from the "obj" level into the level inside the autoDopNetwork is the tricky part.

I am not sure if the autoDopNetwork itself is already an asset or if I need to rebuild that whole rigid body structure to build my own shatter asset.

I'll check out that video too, maybe it clears something. (have seen a lot videos so far)

* * *
so what I want :

asset input : geo (any mesh like cube, sphere)
asset input : max number of shatter parts (one fragmentParams value)
asset function : simple rigid body setup which drops the geo and shatters it.

* * *

possibly this is the issue :
when I add a ground plane, this element is also added inside the autoDopNetwork, then it would make sense that such an asset which has a rbd solver inside would not be able to enhanced by e.g. a ground plane, resulting in just endless falling of the cube. or a second input which defines the geo of the "ground" objects. hmm.

anyone here who has a deeper understanding of the houdini philosophy ?

09 September 2011, 03:18 AM
Hey Deadalvs Can you post your network setup or hip file?

09 September 2011, 01:13 PM
If I understand this correctly, you want to have both an internal dependency and an external dependency to geometry sources in your RBD simulation asset.

You do not have to rebuild any of the assets in the DOP simulation network. You can have as many nested assets inside a wrapper asset as you want.

I would make this tool an Object level asset as you didn't mention this. I would put an object inside the asset along side the DOP object node. This object is set up to feed the simulation.

Use relative references for all paths when building assets. When you wrap up an asset the first time, it tries to make all absolute references in to relative but sometimes it doesn't catch all of them.

All RBD Objects put down by the shelf have this expression in them:

`opinputpath("/obj/sphere_object1/dopimport1", 0)`

This expression is a way of returning a full path from a given path reference. The default behaviour when you create an asset is that it will tunnel in to all the parameters and replace full paths with relative paths but it may not be able to extrapolate the path from inside an expression. You can edit this expression to create a relative path inside the opinputpath() expression:

`opinputpath("../../sphere_object1/dopimport1", 0)`

This expression reads like: "Return the full path to the given SOP from the relative path "../../sphere_object1/dopimport1" or go up two directories first out of this node and then out of this DOP network, find the object called "sphere_object1" and inside that object find the SOP called "dopimport1". If this object is not found, return "0" or null. Because this expression is in a string field, back ticks are required around the string to force it to evaluate because in Houdini, string fields generally don't evaluate expressions unless surrounded by back ticks.

By using a relative path inside an asset, you have now made it self-contained.

In the source object inside the asset, you can use the same technique to reference a top level path to an object sourcing in any object's geometry outside of your asset itself. That Object Merge SOP inside an object which is inside an asset subnet could look like this:

`opfullpathfrom(chsop("../../source_geometry"), "../../RBD_geo_in")`

The opfullpathfrom() expression is handy for returning a full path from a different location. This allows you to put a geometry reference parameter at the top level of your asset (in the above example called "source_geometry" relative to the object that you are referencing containing the Object Merge SOP "../../RBD_geo_in". This will form a nice full path to any object referenced from any where in your scene and make your asset bullet-proof in any scenario.

See the attached example file to see one way to rig this up.

It's important to be familiar with unix shell path constructs when using Houdini as it uses a proper file system to organize operators in folders:

. means here
.. means go up one directory

To build up relative paths, you can enable the "Relative Path" option in all path navigation tools from parms that support this or you can type in the ../ repeating in your head "../ first go out of this node in to the network then ../ out of this DOP network and in to /obj then find my object "my_object" and find the SOP "OUT_source_geometry" to build the path:

These relative path set-ups will make your asset behave nicely with both internal and external geometry sources.


09 September 2011, 04:33 PM
@ Grayolorin : Sadly, I don't have anything to share yet since I am just starting to learn houdini in my spare time with the free apprentice version. Actually I have a goal in mind which has to do with shattering objects, but I guess it'll take quite some more time to learn all necessary. Well, I have ordered 5 dvds plus two books.. :)

@ Jeff :

thank you very much for setting up this demo file plus the extensive reply. It's doing exactly what I wanted so far. Actually, I've been editing the name of the object in one of the expressions before, but it would not update then.

So far, the theory is clear, but I struggle with the precise order of creating a similar network as yours.

Could you note down the order in 1,2,3... which steps you take, from creating the initial object until the end ? Then I see when you edit which expressions and which ones remain untouched.

This would be amazing !

I'll have to create more threads to reach the ultimate goal ... :)

Thanks again.

09 September 2011, 10:35 PM
I have just tried again a couple of times, but I can not figure out at which time I wrap up the asset. Before or after adjusting the expressions ?

An other thing that always happens is that my DA winds up with two folders full of parameters which I can not delete.

The idea seems logic to me, but I fail in timing each step to make this thing work ..

09 September 2011, 04:21 AM
An other thing that always happens is that my DA winds up with two folders full of parameters which I can not delete.

the HDA themselves are actually "subnet" nodes with custom parameters. you can't delete the parameters that are intrinsically part of the subnet. you can however, just turn on the invisible flag on the folders and that will hide them from the parameter interface.

09 September 2011, 03:26 PM

it seems that Jeff creates the DA differently than me.

here's the two versions :


09 September 2011, 12:19 AM
In Jeff's, turn on "Show Invisible Parameters".

CGTalk Moderation
09 September 2011, 12:19 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.