[TUTORIALS] Photons Be Free: Mini-tutorials and other curiosities

**Other How-To 2: Creating (Mostly) and Importing a APEX Cloth asset created with 3Ds Max and PhysX DCC Plugin
**
Requirements using this method: 3Ds Max/Maya and PhysX DCC Plugin

If you need the PhysX DCC plugin you can sign up at Nvidia.com. This page will help get you started: PhysX DCC Plug-Ins|NVIDIA

Overview:

This will be a short tutorial to quickly cover creating a simple cloth asset and importing it into the Unreal Engine 4. There have been similar tutorials already, but mostly wanted to cover a written tutorial for this. The video is just an added bonus as I had made it while troubleshooting the process for an AnswerHub post.

FBX and APB Files: Dropbox - Error - Simplify your life

Video: This will not cover much other than a run through of the process.

Step 1: Create a plane with a lot of verts (within reason) and convert to Edit Poly

Pretty straight forward. Create a plane and add some verts to it. I just used an arbitrary size and set the length and width segments to 24 for this demonstration.

Step 2: Apply a material to the plane (Important!)

This, at least to me, is a very important step that confused me quite a bit when I first started using cloth. If you do not apply a default material to your mesh and use the one that is on the mesh when you created it there will be no material assigned to the cloth asset when you import it into UE4.

So make sure to add a default material otherwise you’ll not have a material to be able to assign the cloth apb file to your mesh later when imported into UE4.

Step 3: Create a bone

Create a bone that we can use in the next step to “skin” to our mesh.

Step 4: Add a Skin Modifier to your Plane

Add a skin modifier via the drop down modifier list to your cloth plane.

Once the modifier is selected locate the Bones: “Add” button and click this. This will bring up a small window where you can select the bones in the scene to skin your mesh to.

Step 5: Add the PhysX cloth modifier via the PhysX toolbar

Next you’ll need to add the cloth modifier from the PhysX DCC Plugin toolbar

5_ClothPXL.png

Once this has been added you will see it populate in your modifier stack along with its settings when selected.

Step 6: Paint weight accordingly for your cloth and test with the simulation

Under the settings locate “Paint” and set a value for the Brush Value.

I will use 200 for mine. The default is 0 which effectively means there will be no cloth simulation for any areas painted with a 0 weight.

6_paint.PNG

Select the brush to paint the weighting.

As you paint you will see red trace lines that come out. This is the 200 cm value that we used. If you use higher or lower values this will be longer or shorter. 0 will have no trace lines.

Step 7: Test your assets simulation

Select the play button here to see your cloth simulation.

7_play simulation.png

If you want to see wind simulation to see a more practical use of your cloth in the settings locate the Wind section and use these settings before hitting play.

Adjust according to your needs.

Wind.PNG

Simulation result:

simulationresult.PNG

Step 8: Select the Cloth and Bone to export selected as and FBX

Select the bone and the cloth plane. Then go to File > Export > Export Selected > Choose a name for your file > Change File Type to FBX > Click Save

**Step 9: Export the scene (not just selected) with the file type PhysX and APEX
**

Same as above with exception that we will just export the scene this time and not just the selected object.

File > Export > Change file type to “PhysX and APEX” > Click Save

After you click save a new window will pop up. Use these settings:

Step 10: Open UE4

Self explanatory. :smiley:

Step 11: Import the FBX we just created for our Cloth plane

Locate your FBX that was first exported with just your Cloth plane and bone and import this into UE4.

Use these settings:

Once that is imported locate the cloth skeletal mesh and open the asset.

Once this is opened verify that you do have your material slot. If not, you’ll need to go back to Max/Maya and add a default material.

Step 12: Open the our Cloth plane skeletal mesh to apply the cloth apb file we exported last

Now we’ll click the the option to “Add APEX clothing file…” and navigate to where we saved our APB file we created.

After importing the apb file you’ll be able to assign this to the material via a drop down.

You will also notice that you can adjust various settings for your apb file to control how the cloth reacts. These are all settings that can be setup via the PhysX DCC Plugin as well.