Export PDI dynamics from Maya to UE4

In this excellent tutorial Esteban Cuesta shows us how to destroy a pile of tubes using Pulldownit in Maya and then export it to Unreal Engine 4, but not only this, he also teaches us how to trigger the destruction in UE4 when a bullet hits the model during the game. Exporting broken models and dynamics to UE4 works with either Pro version and free version of Pulldownit, just follow the tutorial to learn how to add quality destruction effects into your game.

 

thank you Esteban for the amazing tutorial

 

Tips & Tricks: Using Hidden Objects As Barriers

When planning to destroy large buildings or structures you usually want some parts to stand, however other objects may eventually collide with them, that’s why those parts should be set as static bodies in dynamics, sadly if these static parts have complex shapes,  that will increase significantly the computation time despite they doesn’t move. For example in the image bellow we want to destroy only the main tower on the right but when falling it will surely collide with the rest of the castle so we must set the whole thing in dynamics.

castilloinit

A way to speed up the simulation in cases like this is using simple objects as barriers, so flying fragments cannot pass through them. The idea is those barriers separate the real geometry from the fragments, you can use simple shapes as boxes or cylinders to enclose the area where fragments can move, taking care they approximate the shape behind in case the real geometry is very close to the barrier. In our example we can surround all standing parts with simple boxes and some cylinders,

castillobarriers

Modifying  the barriers shape if necessary to approximate correctly the geometry behind, the important thing is keeping always the low poly count. It doesn’t mind if the barriers interpenetrate each other as they are static objects.

At this point you have just to set the barriers as static bodies , you can even hide them from the viewport and PDi will take them in account for collisions anyway. After the barriers are hidden the result can be better than using the real geometry as you are avoiding its complexity and for sure you will save important computation time. See the image at the bottom once the barriers are hidden for our example.

castillobarriersdynamics

castillodynamics

 

Tips & Tricks: Setting Initial States for rigid bodies

When working with groups of objects many times you would like the objects appearing in scene scattered over the ground here and there or starting at random positions, this is done very easily wiht Pulldownit by setting initial states for rigid bodies. This is the procedure:

logsArrayV2

Lets say you start with a grid of objects you have created by cloning a single one using the duplicate tool of your 3D Platform.

Now you have to select all of them and create a dynamic rigid body for each object and then open the Dynamics properties window and set an initial velocity of (4,4,4) also set random values of (200,200,200), make the same for the initial angular velocities if you want random orientations aswell.

initialVelocityWindow

Now set your time range to about 10 frames  and play the simulation, you can also disable gravity if you prefer.

logsArrayRandomV2

Ok, perfect, at the last frame all the objects has modified  quite a few  its initial position and orientation, now we have just to set this configuration as the initial state for the rigid bodies, for doing this, you have to bake keys for the simulation if you havent done it yet and after that click on Delete All Pdi bodies in the Manage Pdi World Window.

Now select all objects and move the slider to the last frame of the simulation, follow by deleting all keys for the objects, and you are done.

From here you can start a new simulation to drop the objects and scatter them over the ground, for this just set a dynamic rigid body for each object as before, open Pdi Simulation Options and enable Use Grid as Ground , make sure gravity is enabled this time, now set the extend of the simulation to 200 frames or so and launch it.

logsScatteredV2

Nice, at frame 200 you get your objects stacked in a natural way, now you can set this configuration again as the intitial state of rigid bodies as we did before.

 

Tips & Tricks: Offsetting simulations in time

Sometimes you have to offset a simulation in time once it is done, to say,
you make your demolition starting in frame 0, you agree with the result but
eventually you decide it is better to start in frame 50, without having to recompute all the stuff again; No problem with this, it is very easy to offset simulations with PDI, simply by exporting/importing the animation curves.

This is the procedure for Maya:

1) Export the keys using the AnimImportExport plugin.
Load the AnimImportExport plugin, select your geometry objects in viewport
and select “Export Selection” from the File menu. Select the “AnimExport” option in the file type dropbox.  Click the “Export” button to export the animation data.

2) Delete all keys from selection and save the scene with a diferent name just in case.

3) Load the animation data into the new scene.  Select “Import” from the File menu then  select the “AnimImport” option in the file type dropbox., setting the options “start” and “startframe” in the AnimImportExport window.

and  for 3D Max:

1) Export the animation keys. Select your geometry objects in viewport and click on Main menu->Animation->Save Animation.

2) Delete all keys from selection and save the scene with a diferent name just in case.

3) Import the animation keys, using the “Load Animation” option in the Max File menu. Choose  “insert” and type the desired frame in “at frame” in the Load Animation settings.

Tips & Tricks: Reverse dynamics

For some effects you would like objects looks like being costructed rather than destructed, this can be extremely dificult to achieve in a direct way, but you can simply reverse dynamics to get it done!  so compute dynamics with PDI as usual, making the object fall, being hitted by another one, or exploding using force fields, and bake simulation keys.

Then use the Dope Sheet to reverse the keys,

Reverse keys in Maya:

Select in viewport all objects you want to reverse dynamics for them,

Open Window -> animation editors -> DopeSheet

select “dopesheet Summary” or alternatively all entrys (they’ll turn yellow),

then open  dopesheet->edit -> scale (option box).

in the option box at method select start/end and then reverse the numbers in the boxes

Reverse keys in 3dMax:

Select in viewport all objects you want to reverse dynamics for them,

Open Graph editos->Track view->Dope Sheet,

Select the tracks of the objects you want to reverse keys for, in the controllers panel,

specify a block of time in the tracks panel,

Click on Time Icon and Reverse Time icon, or choose Time menu->Reverse.

 

Here a music clip using Pulldownit with this technique to break a piano by Tenas

Tips & Tricks: Mapping all cut faces at once

Pdi creates a default cut material in inner faces, this is very useful to apply displacement or bump to these faces only,  you have to replace  this material for the one you prefer and then for mapping it in all cut faces at once just do the following:

 

  • In Maya open HyperShade and right mouse click on the PDI Cut Material icon, then “select objects with material” in the box dialog, Create UVs->automatic mapping ussually get good results, but you can try any mapping method you like.

 

  • In 3dMax, after shattering select all fragments and  apply “edit mesh”  or “edit poly” modifier to them, then select the cut faces by ID and  apply whatever uvw mapping you like, ussually box mapping is nice.

just as easy :)