Ironically it was hard to find a decent tutorial for such a simple object. I was struggling to figure out a way to o about it considering I’ve never done anything at all related to skinning or using bones. After figuring out how its done I made a tutorial.
Make sure you get the Apex Clothing plug-in for 3ds Max or Maya from https://developer.nvidia.com/apex-clothing
- Started out with just a flat vertical plane in 3ds max with the width of the curtain being a little bigger than what I intend in the end. (That’ll make more sense later)
Green line shows how wide I want my end curtain to be for example.
- I turbosmoothed my plane 5 times but its up to you how many iterations you want to do, you need enough for the curtains to look natural though. UVW Unwrap the plane. Next I added a cylinder on top of the plane that represents the bar the curtain hangs from. It doesn’t really matter the radius and it doesn’t have to be perfectly center, just throw it up there. I’d make the width of the cylinder the size of the plane.
- Click auto key on the bottom right and set a keyframe at 0. I went to about 45 then scaled my cylinder down to approximately the same length as the green line above A.K.A The final width of my cloth.
- I followed this tutorial just for using the cloth modifier. However I only concerned myself with the top cylinder, I didn’t make a second one.
The idea is to create a semi already folded cloth before applying the Apex Cloth modifier. I figured since I already have the polys for the physx I might as well add wrinkles. You don’t want it to wrinkle too much. I ran into issues with the cloth being too folded and intersecting with itself when I had too many folds. Once you have the look you want, right click the curtain and convert to editable poly. (I also added the unwrap modifier again because I felt more organized that way, but I’m pretty sure the unwrap information from before stays the same so it’s up to you if you want to do that)
- In the create tab go to systems and make a bone. I placed it here because this is the area they placed the bones for the cloth content examples in UE4.
Next apply the skin modifier, click add next to bones and add the bone you placed on the curtain. Now its time to apply the Apex Clothing modifier.
- After adding the modifier the paint tab is what you want to look at first.
If you expand the Apex Clothing modifier there are 2 viewing options, simulations weights and vertex. I personally used vertex I felt I could be more accurate. Click the green paint brush and start weight painting. The higher the brush value, the more the curtain will move/flow with 0 being static. From bottom to top I used 40-0. But It’s up to you how much or how little you want it to move. This is basically how I did mine.
You can test the cloth simulation by click either the green play button, or the grey play button, there is also an option to adjust the wind in the simulation tab of the modifier. Don’t forge tto mess with teh physical material tab of the modifier to get the cloth to flow how you want. (I opened up the Cloth UE4 content example and copied the setting they used for silk, I’m pretty happy with it)
After you’re satisfied now just export your cloth as an fbx file, and export again but this time as PhysX and Apex file (.apx or .apb) When exporting as an apex file I just used the default settings. After you export watch this tutorial http://youtu.be/oRaStTw0-l0?t=3m52s 3:52 and you should be good to go.
I ran into a few issues, one of them being when tried to make my curtain collide with object around it, it got all wonky and I was getting frustrated so it just doesn’t collide with anything, but I placed it well enough so you don’t see it going through the wall. Also, my basic material for the curtain:
Blend Mode: Translucent | Shading Model: Subsurface | Translucency Lighting: TLM Volumetric Directional. My first time doing a write up like this so if I didn’t explain something properly please let me know.