A tutorial on creating a light weight animation ready model from a high res render model which is perfect for animation. A free maxscript to automate the process is also included. Great for prototyping and testing out designs as well.
Read MoreXaml Error and Reset Ribbon
By Adnan HussainSoftware: 3DS Max 2011OS: Windows VistaDuring 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 HussainIn 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 HussainIn 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
Creating UVs in ZBrush UV Master
by Adnan HussainUVs are what tells your software how to wrap atexture on a 3D model. I'll go over a method to simply UV map amodel in a single piece as well as how to create a UV layout with multiple partscreated off a single model. In my case I used 3DS Max, but it should applyregardless of your animation software.You will need:a) A model to apply UVs.b) UV Master installed for ZBrush. If you don't see UV Master under the Zplugins menus in ZBrush, download and follow the installation instructions here:http://www.pixologic.com/zbrush/features/UV-Master/Multiple Piece UV Layout1. First prep your model. I created Mat IDs on a low res model and apply a multi sub object material to the model to retain groups in ZBrush. I kept the inside of the mouth seperate by assigning a unique Mat ID to it as well.2.Import into ZBrush as a Tool. (Check: Preferences Import/Export/ Import Mat as Groups to create groups) Groups will be displayed with different colors.3. In ZBrush create UVS from the Zplugin Menu with Zplugin/UV Master.Click on "Work on Clone" to create a copy of your model to work on.Settings as seen below:Refer to documentation for indepth info, but Symmetry keeps the UVS more symmetrical, polygroups, uses your polygroups if your model has them to cut it up. Enable Control Painting uses the Control Map you paint to help determine where to create seams.4. Click Protect then Paint Protected areas. Then click Attract to paint Attracted areas. Use Erase if you make any mistakes. After painting, save Ctrl Maps using SaveCtrlMap button.ctrl+shift+click on group to isolate a single group.ctrl+shift+click viewport bg to unhide groups.Red areas are Protected (discourage seam creation), Blue areas Attract (encourage seam creation).Unclick Protect/Attract/Erase and you can see the seams:Click Unwrap, then click Check Seams and adjust and redo as needed.Click Flatten to check the UV layout, then Unflatten to get back.If you chose to work on a copy of your model, you will need to copy the UVs from the copy to the original model in ZBrush.Click Copy UVs in UV Master. Load your Tool (original model) and thenclick Paste UVs.Export Obj file at lowest subdivision level.Import Obj into 3DS Max.File/Import/ObjChoose the Obj file exported from ZBrush.Using defaults + check two highlited options below.Apply UV Unwrap modifier to the incoming model.Use Cylindrical Mapping in UVW Unwrap on the mouth bag (inside of mouth), then scale and place it in the UV Editor on an empty spot in the UV Layout.Select all edges in edge mode in UV Unwrap Mode and weld edges with options set to weld threshold 0.001.Select Elements and pack as needed. Adjust Mat IDs. This approach has the advantage that you can resize pieces as needed for areas that require higher detail.Apply a tester map like this one:and check the UVs for stretching, flipping or other problems.Single Piece UV LayoutCreating a single piece involves a similar, but shorter process than creating multiple pieces. Import your model and use the following settings in UV Layout:I recommend quickly creating or loading a control painting to specify regions you don't want seams to appear. The main difference is how your UV Layout will look. Below is an example (Note, the shape in the upper right corner is the "mouth bag" UVed in 3DS Max after the fact).The rest of the steps for importing into 3DS Max are the same.Hope this was helpful!
Manually Creating Mip Maps
You can avoid the manual steps below by using this script I wrote: Download maxscript mg_mr_tools_v02.zipManual ProcessTo create Mip Maps, Mental Ray comes with a command line executable called imf_copy.exe. This can be found in:C:\Program Files\Autodesk\3ds Max 2011\mentalimages\imf_copy.exe(path may vary depending where 3DS Max is installed)Older versions of 3DS Max did not come with this file, but I have heard you can get it from a demo version of XSI or Maya.Once you have located the file, you can run it manually from the command prompt/shell. To launch the command prompt/shell, go to Start/Accessories/Command Prompt. This will launch a new window with the Command Prompt. For those not familiar with DOS, I've written the commands below.To open the folder with your file type in cd <your path>:cd "C:\Program Files\Autodesk\3ds Max 2011\mentalimages\"<press enter>Next, type in:dir <press enter>This will give you a list of files in the folder, and you should see imf_copy.exe.Now that you have confirmed that you have the file, you can run it. From the mental images folder, you can run the command as follows:imf_copy -vrp <path><source filename> <path><target filename>You can type imf_copy and hit enter to see a list of all the possible parameters.
Mip Maps in 3DS Max with Mental Ray
by Adnan HussainDownload maxscriptmg_mr_tools_v02.zipMip Maps are pre processed texture maps for use in rendering. They take more hard drive space, but can help reduce processing by storing multiple,preprocessed resolutions of the same texture in one file. This allows a renderer that supports them to quickly load the file and not waste time on preprocessing/filtering. In addition, renderers such as Mental Ray can load portions of these maps as needed and unload them at render time. In contrast,3DS Max's scanline renderer loads all maps into memory at once. Loading maps as needed can add to render times, but loading all maps at once on a scene with many large texture maps will choke or crash your software making it impossible to render the scene.Mental Ray supports Mip Maps through a ".map" file format that can be converted to from various bitmap files (uncompressed TIF, TGA files, etc) using a utility it ships with called imf_copy.exe.Unfortunately 3DS Max does not directly support the use of ".map" files in Mental Ray, so below I will describe a work around to use them in 3DS Max 2011.1. Some Mental Ray Setup changes:First you'll need to edit a Mental Ray file called base_mix.mi in order to access the map type needed to use ".map" files. Go to:C:\Program Files\Autodesk\3ds Max 2011\mentalimages\shaders_standard\mentalray\include\(path may vary depending where 3DS Max is installed)Copy the file base_mix.mi and create a backup as seen below:Next we'll open up base_max.mi and find the line:gui_mib_texture_lookup2Then add a hash or # symbol in front of the word "hidden" below it. This will load the Texture Lookup 2 Map into 3DS Max when you reload the program. We'll need this to load our ".map" files into.Note: If you later reinstall 3DS Max or need to render on other machines, be sure and copy this modified file tothe appropriate folder on each machine.2. Create Mip MapsNow that the tools we need are accessible in 3DS Max and we have reloaded it, we can create our Mip Maps. For this purpose, you can use a script I created. Download maxscriptmg_mr_tools_v02.zip">mg_mr_tools_v02.zipLocate imf_copy.exe. We need to locate the executable file that comes with Mental Ray to convert maps into the .map (mip map) format used by the renderer.In 3DS Max 2011, this can be found in:C:\Program Files\Autodesk\3ds Max 2011\mentalimages\imf_copy.exe(path may vary depending where 3DS Max is installed)In older versions it was not available, but I have heard that the XSI and Maya demos come with it. You may be able to get a hold of it by downloading one of those demos.Now that we have confirmed that we have the imf_copy.exe file and we know the path where it lives, let's run the script.Download maxscriptmg_mr_tools_v02.zip">mg_mr_tools_v02.zipJust unzip the file and Run it in 3DS Max.Create Mip MapsMap Src Path: Path where bitmaps to be converted live and where the new .map files will be created. Don't type the filename, just a path.imf_copy Path: Path where the imf_copy.exe exists. Don't type the filename, just a pathFilter: You can leave it as "*", or choose from a number of file extensions in the pulldown to limit what you convert.Sub Folders Checkbox: When checked, files in subfolders will also be converted.flags: Add optional flags to be used with imf_copy.exe. Leave the default "-vrp" if you are unsure.Del Src: Deletes Source files (jpg, tga etc)Ovw Trg: Overwrites the target file (if map files exists, overwrites them).Create: With your settings filled in, click Create to start creating .map files for any bitmap files that don't already have them.Bitmap to Map ChangerChange: This button goes through all BitmapTexture maps in the scene and replaces them with Mental Ray Texture Lookup 2 maps containing the corresponding .map file if it exists.Reverse: Changes map files back to bitmaps.Make Scene MatlibMake Scene Matlib: This creates a temp material library in the Material/Map Browser containing all scene materials, which you can save manually. Useful for keeping a set of materials with BitmapTexture and one with .map files.Mat ChangerI use this to take a set of materials made for one character and apply it to another. This is more name dependent so it may not work for everyone. Material libraries need <src_char>_map or <src_char>_bmp names. Swaps the src string for trg string in each filename.Src Char: Source StringTrg Char: Target StringMtl_Type: Map or Bmp (Looks for matlibs named <src_char>_<Mtl_Type>)Mat Path: Folder containing your matlibs.Render SetupIn your Mental Ray render settings, under Processing set the Memory Options to the following.This will allow you to take advantage of Mental Rays Object and Texture loading efficiencies. That's all, now you can render scenes with more textures and geometry than you could before.In Case you want to know how this works for your own customizations, here are some manual instructions to do what the script does to create .map files. You don't need to do any of this if you use the script.Manually Creating Mip MapsAdditional Scripts and Information byothers:Mip Maps on WikipediaNeil Blevins Mip Maps WishlistDavid Baker's Mental Ray .Map Converter MaxscriptMentalScriptologist's Swap BitmapToMap Maxscript