Category Archives: 3ds max

Creating a Sliced Animation Model in 3DS Max

by Adnan Hussain

In this lesson I’ll go over a streamlined process to create animation models, and even include a script for 3DS Max that can help automate the process for you.

Download maxscript
mg_slicer_v01.zip

Why create an animation model?

So you just finished creating that amazing new character, with 600 million polygons, muscle rigging and every bell and whistle under the sun. You render it and it looks amazing. Try animating it and watch it chug. When doing character animation, it is best to have a simple, low resolution model with a fast performance rig. You can animate with the light animation rig and then load that animation on the heavier render rig in a separate scene file for where you do all your lighting and rendering. No one likes doing extra work, so let’s see how we can minimize the extra work up front and still reap all the benefits in performance. Trust me, the bit of extra prep work really pays off when you start animating. Even better, you can use this same method to prototype models in the design stage to see if your character design works the way you want in 3D. See if the proportions look good in performance. It is also a great way to test out an animation rig before your character model is finished.

Simplify your Rig

I won’t get into this in this lesson, as it is specific to your rig, but your first step should be to remove any extra bits on your rig that you don’t need for animation. If you have a lot of expression driven parts that are only for deformations, you can get rid of that and possibly speed up the performance of your rig during animation. (The above is just an illustration to show the idea. I actually did not use any complex deformations on this character beyond skinning. I’ve used Brad Noble’s excellent rig, which you can download and purchase a resizing script for here).

Simplify your Model

Start with the lowest resolution model that matches the shape of your final model. If you have a cage that is subdivided at render time, you can use that or use polygon reduction tools like the multires modifier to get a simple model that gives you the right volume and shape, without all that extra overhead. Try and keep enough resolution so the model can be broken up into parts for each joint in your skeleton. You can even attach objects, like the eyebrows, modeled hair, nails into one object.

Slice it up

You can manually break the model into parts and parent them to their corresponding bones in your rig to get a pretty light weight setup that is perfect for animating. Without all those complex deformations, in most cases it should play in real time in your viewport, which is perfect for animating.

Boo extra work, Yay MG Slicer Maxscript!

(Download maxscript mg_slicer_v01.zip)

Now that you get the basic concept, let’s use a script to automate the process. As I’m building up the pipeline for my next film, I decided to write a script to help automate this tedious process of breaking up a character model, naming each part and parenting it to the corresponding bone. Here I’ll go over how to use the Mg Slicer maxscript to help you automate the process in 3DS Max.

Behold, the MG Slicer script interface:

Depending on how you work, you don’t have to use all of these buttons, but I’ll go over what they do.

Set Variables

This first set of buttons sets some variables, or gives the script information it needs to work its magic.

Char String: Type in a name or code. For example, if your character is named Monkeytastic, you can write something like mks and hit <enter>. This will be used later for naming an optional slice file and for naming the sliced parts.

Set Variables: This is a button I use internally. Most people can skip over this one. If you know a little scripting, you can customize the function in the script code to predefine the variables set in the next two buttons with this button.

Set Slicer Objects: Select the objects that will define how slices are cut (in most cases this would be the bones in your rig), then click the button.

Set Objects to Slice: Select the objects you want to slice (this can be the body, clothes etc), then click the button.

Utilities

Attach Parts: In case you need to attach multiple objects into one. Select the main object, then ctrl select additional parts to attach to it. For example, I selected the character body, then control selected eyebrows, hair and nails, then clicked the button. This attached the parts to the character body. If you use this, after attaching select your objects to slice and click Set Slicer Objects after attaching them.

Create Material: Creates a multimaterial based off the number of Slicer Objects you have set. This will be applied to the parts once they are sliced, so click this before continuing.

Divide Model

These buttons are for breaking the model into parts.

Create Slices: Click this button, to take your Objects to Slice and divide them by assigning material ids to faces based off the closest Slicer Object. This can take a minute or longer, depending on how many polygons the models have.

Once slices are created, you should see different colors for regions defined by different matIDs. The automatic process does its best, but you’ll probably want to do a little editing to get it just right.

The next two buttons will help you edit matID assignments before you actually break the models up.

Get MatID: Select a single face and click this button to store the current matID number.

Save MatID: Click to assign the Get MatID saved material ID to the selected faces.

Save Slices: Saves the matID slices/id assignments to a text file which can be loaded.

Load Slices: Loads a presaved matID file.

Break Slices: Once your matIDs are set the way you want, click this button to break the model into pieces based off Material IDs and parent them to their corresponding Slicer Object (bone).

There you have it. You should now have a light weight rig with a model broken up into parts for fast animation performance.

I hope you found this lesson helpful. Feel free to leave a comment below or send me an email with your thoughts and suggestions.

Related Links:

The idea for this material ID based approach to cutting up the model came from a page by the very talented Kai Stavginski. He wrote a similar tool according to the page, but as far as I know he never released it to the public, so I wrote my own. I don’t pretend to have written a better tool by any means. I just needed it for my own use, and so here it is available to all of you as well.

Xaml Error and Reset Ribbon

By Adnan Hussain

Software: 3DS Max 2011

OS: Windows Vista

During startup of 3DS Max I have run across this error. First a window will appear:

Followed by:

You can click through these error messages and still launch the program, but our ribbons menus will be gone.

The problem is that a file called MaxManaged.xaml has become corrupt for whatever reason.

First close 3DS Max.

You can find the MaxManaged.xaml file in your user, appdata folder, which for me was:

C:\Users\<username>\AppData\Local\Autodesk\3dsmax\2011 – 32bit\enu\UI\

You’ll notice that this file has a size of 0KB if it is corrupt. Simply delete it, and make a copy of the backup file MaxManaged.xaml.backup, renamed to MaxManaged.xaml.

Relaunch 3DS Max and you should be good now. Unfortunately, this problem is likely to occur again, but at least now you have a solution.

Panel Cloth in 3DS Max Part 2/2

by Adnan Hussain

In the previous lesson, I showed how to create flat cloth panels. Now I will show you how to stitch those panels into a garment and sim it into cloth. Start with the scene from where we left off.

1. Go into Garment Maker, Sub-object Panel and select, move and rotate panels around the character’s body. Use a clean, low res stand in for your body.

Tip: With cloth sims, it is best to use a lower res, cleaner model based on your character’s body that is specifically for cloth sim collisions.

Arrange the Cloth Panels as if you were going to sew the clothes on the standing character’s body. Placement position and angle as well as relationship to other panels is crucial to creating a proper garment for cloth simulation. Again, it can take a good deal of back and forth depending on how complex the garment is.

For things like sleeves and collars, you’ll want to curve them by adjusting curvature.

2. Next Create Seams between panels. This defines how the cloth panels are sewn together. First seam panels on each individual section before connecting them. For exampl, the back of the Kameez is two panels, so in Sub Object Seam, I selected the two edges of the panels where I wished to create a seam and then clicked Create Seam. Likewise the cuffs on the sleeve were seamed to the sleeve before the shoulder area of the arm was seamed to the front of and back of the Kameez.

The green lines are seams. Notice how the panels are arranged so that seams don’t generally go through the body. When it is simmed into shape, the cloth panels will be pulled together along these green seams. Make it easier on the cloth solver and you’ll have less crumpled up mess and more properly simmed cloth. Likewise, when running the Local Sim, at first the shoulders had large bumps on them. I moved the sleeve panels away from the torso a bit and it had enough room to sim down cleanly. Likewise, this is where I adjusted fitting, based on simmed down results. Some areas needed more cloth and some needed less cloth, so I resized the original cloth splines in the top view then clicked Mesh It! in Garment Maker on the Reference object. This maintains the panel position (unless you move the splines around, which will shift it a bit or change the number of panels, which starts off flat again).

3. Next apply the Cloth Modifier to your Garment (Reference Object that has Garment Maker). This makes it Cloth. Click on Object Properties and click Add Objects to add the body. Assign the Kameez as a cloth object. You can load preset cloth properties from the drop down menu. These parameters can and should be adjusted based on simulation results.

Select the body in the Objects in Simulation list and click Collision Object below. Adjust Offset to specify how far cloth stays away from the body during simulation. Hit OK to apply changes in the Object Properties dialogue.

4. Scroll down to the Simulation Parameters rollout in the Cloth Modifier.

Make sure Use Sewing Springs is checked as that will pull the panels closer together based on the seams you created when we run the Local Sim next. Set Self Collusion if you want Cloth to collide with itself and Check Intersections etc as needed. If you have trouble with cloth crumpling up when simming down, these are some options that can be tried on or off to help it.

5. Scroll back up to the Object rollout and click Simulate Local (Damped).

This sims the cloth down on the local frame. Simulate Local does the same, but faster and Simulate goes frame by frame (what we use to simulate cloth on animated characters later). It can be good to slow it down a little with damped when you are simming the clothes down on the character.

Watch in the viewport as the cloth panels come closer to each other. At any time, click Simulate Local (damped) again to stop the simulation if it isn’t the way you want it is as you want it.

If you don’t like the results, or you have changed things earlier in the stack (adjusted panels etc) hit Reset State to prepare to sim local again.

Sim Local or Sim Local (Damped) can be stopped when the cloth panels are closer together and the shapes starts to drape on the body properly. The panels won’t connect yet as seen below.

6. Now that the panels are close together, we need them to connect. For this, scroll down and uncheck Use Sewing Springs, then scroll up and click Simulate Local (Damped) again.

It should usually closes the gaps very quickly and you don’t want to run it too long or the ship could start to get messy.

Generally any complex clothes will require a good deal of back and forth, adjusting the shape and size of the panels, then adjusting panel positions and adjusting simulation parameters and cloth properties to get the cloth draped. Remember, when draping cloth, you can use different cloth settings or add collision objects and animated locaters that move cloth etc as needed to get the cloth the way you want. You can later change the cloth properties etc for running shot simulations.

Below you can see how the Shalwar panels were arranged. In this case I had large cloth panels (on the legs) seamed into a smaller panel for the waist. Shalwars have naalas in them (like a draw string in the waist). So you have a large volume of cloth, scrunched up at the waist.

Here, because the bottom opening of each leg is quite narrow, placement of the panels was really tricky. I need to to rotate them and give space for the pieces to slowly come together and also wrap around each leg properly. For the waist panels, I did something a little odd. I’m not sure if there is a better way, but I created a group out of the waist panel vertices by going to Sub Object Group, selecting the verts and clicking Create Group. Then I clicked Sim Node and chose the body, collision object for those points to stay with.

I scrolled down and adjusted the constraint options on the group to make it soft. This way when I ran a Local Sim (Damped) to drape the Shalwar, the waist panels slowly came down and when they came to the right spot on the waist, I stopped the simulation. I unchecked the soft check box, then ran the Local Sim (Damped) with Use Sewing Springs off to finish the drape. In this case, the cloth puffed out a lot initially and I had to increase the density in under cloth properties to get it to rest closer to the body, without flaring out like a balloon.

There you have it. A quick look at creating panel cloth with 3DS Max’s Cloth Modifier. There’s a lot more to cloth than this. Definately check out the help file in max and read up on the Cloth Modifier and Garment Maker modifiers to get lots of in depth info on the parameters. This has been more of a practical look at how I have applied some of that for these clothes. If any of you have experience or suggestions you’d like to share, I too would love to learn.

Draped Render of the Shalwar Kameez.

Creating Panel Cloth in 3DS Max Part 1/2

by Adnan Hussain

In this lesson I’ll go over the process of creating panel cloth. We’ll make a shalwar kameez, which is a traditional garment worn in Pakistan among other places. It presents some unique challenges above and beyond a tight fitted t-shirt, jeans or a simple dress. Remember, cloth isn’t easy. Know that it will take time and require lots of clean up when running shots. It will add a significant amount of technical difficulty to a project, but if you spend the time to figure it out, it can really add a lot of depth to your work. This is in regards to cloth in general and not just 3DS Max as I’ve found the same to be true of Maya Cloth etc.

Cloth can be sculpted, as in you can build a model using the usual tools for modelling and apply a cloth modifier to make it into cloth. This is sometimes called object cloth. Another method is to create flat panels, much like a real tailor would do by cutting pieces of cloth. This second method  (panel cloth) is what I will discuss here.

1. First gather some reference materials. Look at photos and if possible clothes that match or are at least similar to what you are trying to create.

2. In the top view create spline shapes (line tool, or any other shapes) in a flat plane in the shape of the cloth panels you wish to create. This needs to be done very cleanly or it will give you errors later. Spline vertices should be properly connected to each other and shapes should not overlap one another. They should all be in a flat plane (as in if you look at it from the front view you just see a straight line.)

Below you can see the layout for the Kameez (shirt) and to the right is a seperate layout for the Shalwar (loose fitting pants).

All splines for the Kameez were attached to one another. Then with all vertices  selected, I hit the Break button to make each segment into an individual spline as required by the Cloth modifier.

Tip: Arrange these cloth panels (shapes) to fall within a square. This will later be the UV Layout for your Garment (cloth model).

Edit/Clone to create a Reference of the Panel object. By creating a reference instead of an Instance or Copy, we can use the Reference to create cloth and still maintain a connection to the original splines which can be adjusted for fitting etc and have changes reflected in the Reference object. I went back and forth a lot to get it right, so this was a huge help.


3. Apply the Garment Maker modifer to the reference copy.

Later when you make changes to the original splines, come back here and hit Mesh It! to update this model.

Panel Cloth in 3DS Max Part 2