Search the Community

Showing results for tags 'Mdx'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Important
    • Announcements
    • Getting Started
  • Modding
    • Modeling
    • Level Design
    • Interface
    • Serverside
    • Noggit
    • Miscellaneous
    • Retro-Porting
    • Useful Services
  • Projects
    • Recruitment
    • Paid Work
    • Showcase
    • Machinima
  • Community
    • General
    • Random
    • Gallery
    • Releases
    • The Graveyard

Categories

  • Tools
    • Uncategorized
    • Map Editing
    • Model Editing
    • DBC & DB2 Editing
    • Serverside
    • CASC & MPQ
  • Resources
    • Graphics
    • Uncategorized
    • Models
    • Maps
    • Client Patches
  • 010 Editor Scripts and Templates
  • Noggit Script Brushes

Categories

  • Projects
  • Machinima
  • Software Development

Categories

  • Beginner
    • Русский
    • Deutsch
  • Modeling
    • Česky
    • Français
  • Level Design
  • Interface
  • Serverside
  • Miscellaneous
    • Česky
    • Français
  • Retro-Porting
  • Machinima

Categories

  • Tutorials
  • Timelapse
  • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Discord


Twitter


Skype

Found 2 results

  1. Hey everyone, ive been learning a lot recently specifically with converting some MDX files made for Warcraft 3. To preface, im starting this guide with an already-converted .m2 file from a source .mdx, i used the Lazy Converter and assigned animation ids by hand. So you've managed to convert your model, but now all its animations are jittery and look like garbage! Well not a problem, this is something we can *somewhat* easily fix on our own, without the help of something like Blender or other Model Editors. To start, choose a specific animation you want to clean up first, in this tutorial ill be using my models "Attack Unarmed" animation, locate the animation ID using 010 and a matching .m2 template from the Animations block, refer to the animation by the ID referenced here: We can see here, my animation ID is 17, with that in mind we can move on to the Bones We need to pick out specific bones based on the animation itself, use Wow Model Viewer and find the animation you selected previously. In the below gifs, you'll see the offending animation in all its glory, ill be specifically targeting the leg bones for this tutorial Now in WMV go to View>Show Model Control, uncheck "render" and check the "bones" box until you can see a visualization of the bone structure: The given render of only the bone connections is useful in finding specific bones in the structure Picking out the right bone can be difficult, but usually you can use the parent structure to find the bone you want In my case, the legs are connected directly to the waist, and visibly we see 4-5 bones in each leg chain With the given image, we can see that bone #2 is the waist, we can see all the bones connected to bone #2 in the image as well, with smaller offshoots being bones 8-11 That being said, we have two chains of 5 bones each starting at bone 2, those ranges in my case are: Bone #3-#7 and Bone #12-#16 Now that we've narrowed down where we need to make changes, lets open up a bone and see whats inside. 9/10 times the corrupted data is within the Rotation data for the animation. Bones store each animation separately in its own block like this: Right here we've located the anim id #17 data for a specific bones rotation data. Not all data is corrupted, but some definitely is let dig a little deeper to see exactly what the problem is: As you can see by the giant red boxes, some of the data here does not follow a regular "pattern", specifically, look at the 4th value in each line, these are labeled as the "W" value. These values should always line up near each other, at least with the same polarity. In order to fix this, we simply need to target the corrupted lines (the ones in boxes) and swap their negative and positive values. Heres the end result here: Now my data is following a regular pattern, with emphasis on the W values being in-line Congratulations! If you've made it this far, you just repaired the animation data for a single animation on a single bone! Great job! Lets keep working through each leg bone, fixing each set of corrupted values so that the "pattern" is intact: This bit of data corruption follows a different pattern. You'll notice some 0 values and some that are .000061, these are essentially null values, we need to leave them alone, that being said, the W and Y values here are corrupted. Lets fix them like this: Looks much better now, keep working through the structure until you finish all the bones in the set. Now we should be good to go, lets save the .m2 and try it out in-game or in the model viewer. Excellent! Were on our way to a fully working model! This process takes absolute ages, and is a bit tedious for beginners. I strongly suggest enlisting some help, perhaps 2 could split animation data down the middle and merge corrected data together when finished Thats all for now, happy editing!
  2. IntroductionHello, BNet-Dev. Today I am going to show you guys how to make custom non-animated .m2 models out of .mdx (Warcraft III) models. It is believed that converting models using MDXtoM2 is quite a complicated process but actually it is not that hard. You may ask: "Why do we need to do it if we have OBJtoM2 and it works fine?" Well, the answer is simple. This converter provides you a lot more possibilities than OBJtoM2, such as multiple materials, textures, lights, animations and etc. At first, I will show you how to convert static .m2s but I am going to update this tutorial from time to time when I find out something new. Okay let's go. Tools and resourcesThe full conversion will require quite a big bunch of tools which you have to download. 1) MDXtoM2Converter_lazy - a tool that generates .m2 models out of .mdx files. 2) 3DS Max with MDX export plugin or Milkshape. Well, just something to convert your model to .mdx. If you already have your .mdx object, you don't need it. 3) MDLXConverter - a tool that converts .mdx files into .mdl files which are possible to edit manually via Notepad. 4) MDLVis - .mdx/.mdl editor. 5) War3ModelEditor- a tool that allows you to add some additional sections to .mdx, such as lights, bones etc. 6) BLPLab - for converting your textures to .blp (BLP2) file format which is undesrtandable for WoW. (Warcraft textures are BLP1 and cannot be read by WoW). 7) Collision adder - a tool that generates collision in your m2 file. 8) Resizer.py - a python script that allows you to resize the initial size of your model. 9) PyModelEditor (+Python 2.6 (see PyME thread for details)) to run Resizer.py 10) AddViewDistance for editing the render distance of the model. 11) Sweetscape 010 editor (+ M2 template) - a hex-editor which we are using for fixing bugs in the model. 12) Nullmodel.mdl - .mdl template to make your model understandable for MDLVis. Well, there are plenty of other utilities that can make your model better but they're not essential. The list is quite huge, but don't worry, it won't take that long to get your model into game. Tools which are not linked here are either included into one of the linked packages or can be found in the resource section of Modcraft. Chapter 1. Static models Step 1. Preparing your model1. I won't explain you how to make an .mdx model. There are plenty of tutorials on this theme over the internet. At first, your .mdx file does not contain all the information you need for converting it to .m2. In order to fix it you need to convert your .mdx file into .mdl using MDLXConverter. I will call the result model tree.mdl. 2. When it is done you need to open your model in MDLVis. To make MDLVis open your file you have to make the .mdl structure understandalbe for MDLVis. So, pick up Nullmodel.mdl and tree.mdl model and open them in Notepad++. Find a section called Model in your tree.mdl and add missing strings into this section from Nullmodel.mdl. * tree.mdl } Model "pine" { BlendTime 150, MinimumExtent { -261.362000, -252.451996, -88.562103 }, MaximumExtent { 273.287994, 307.015015, 1465.869995 }, BoundsRadius 796.038025, } * Nullmodel.mdl } Model "Sword_2H_Claymore_A_01" { NumGeosets 1, NumGeosetAnims 1, NumBones 1, BlendTime 150, }* Result Model "pine" { NumGeosets 1, NumGeosetAnims 1, NumBones 1, BlendTime 150, MinimumExtent { -261.362000, -252.451996, -88.562103 }, MaximumExtent { 273.287994, 307.015015, 1465.869995 }, BoundsRadius 796.038025, }3. Now go to the end of both files and replace everything starting from "Bone" till the end of the file using data from Nullmodel.mdl. Now you can open your model in MDLVis. 4. Find string Image and write in the path to your textures. This path will be used in your MPQ files. Step 2. Fixing the model in MDLVis1. For some reason MDXToM2 does not create a usual transparancy chunk in the model. In order to resolve this issue open your model in MDLVis, go to Modules>>Sequences>>Skeleton>>Switch back to Anims. Select both geosets (using check boxes) and mark them as visible. 2. Save your model as .mdx Step 3. Solving possible problems1. In most cases now you can just drag'n'drop your tree.mdx to the converter and it will turn it to m2. Try doing it. If there is a crash open your .mdx in War3ModelEditor, go to Windows>>Node editor>>Right click on the bone>>Add light. Add 4-5 lights and try converting the model with MDXtoM2_lazy. If it does not work, add more lights. Okay, you should get your .m2 model now. [subsection]Step 4. Fixing different converter issues[/subsection] 1. Open Resizer.py with a Notepad. (should be placed inside a PyModelEditor folder). Edit paths to your model, set the size to 0.02. We need to decrease the scale of your model in 50 times. Save the file. 2. Run it by double clicking. If it works you will see a black command promt window for a second. 3. Open your model in the 010 editor. Run a template on the file. 4. Go to "struct TheFloats floats" and divide each value there by 50. For doing this operation faster open "Hex operations" tab, "Divide". Use the following settings: Treat Data As: Float, Operand: 50, Decimal, and press Okay. Now make sure that BoundingBox size is equal to VertexBox size. If not, copy values from bounding box to vertex bpx. Go to "struct sAnimations _Animations" and make sure if the bounding box values are divided by 50 too. 5. Go to "struct RenderFlags _RenderFlags" and set the blendingmode of every geoset to RM_AlphaTesting (1) (for usual models) and set the Render Flag to the one you need. I used double sided on my leaves geoset to make it visible from both sides. You can find the flag explanation on the WoW Dev Wiki. 6. If you added lights with War3ModelEditor you have to go to "uint Lights", "ofsLights" and set the values to 0. Then go to "struct Lights", select the section and press Shift + Delete on the selected bytes. Step 5. Adding collision1. If you need your collision to be 100% of the size of the model, just drag'n'drop your .m2 on CollisionAdder.exe and you're done. If you need to make some parts of the model non-collideable, you need to create another .m2 model which contains only the geometry you need to keep the collision on. You can even add more geometry if you need to make some invisible collsion walls in your model or smth else. For example, for making tree collision for the second model you leave only bark without leaves. Generate the collision for this model and open both ones in the 010 editor. 1. Copy the values from "uint BoundingTriangles", "uint BoundingVertices" and "uint BoundingNormals" to your model. Go to the end of the file and add 5-6 empty strings containing only zeros. Pick up the offset of the last empty string and write it to "uint ofsBoundingTriangles". Copy the entire bounding triangles section to the empty space. Finish the string with zeros. Pick up the offset of the new string and do the same for the rest two sections. You're done. Don't forget to rescale the collision model before doing that using Resizer.py. Chapter 2. Animated modelsI won't explain you how to convert animated models because there already a good tutorial by Phucko1 which should explain you everything you need to know about getting animated models to work. Here it is: http://modcraft.superparanoid.de/viewtopic.php?f=20&t=5536 So, let's think you already have your model converted. However, I am pretty sure that after doing eveything written there most of your model animations will be glitchy. How? This video is the only example I found over the internet, but it looks exactly like this: http://www.youtube.com/watch?v=TUtNSHAPML4 (To the author of this: I just used your video to show how the bug looks like and demonstrate the solution to this problem. I hope you understand it.) Well, as you can see, some models glitch on some parts of animation. If you reduce the speed of changing frames, you will notice that it looks like the animations start going back at some point. So, it is correct in general, but goes in wrong backwards direction instead of looping. Yeah, that's the mistake of MDXtoM2 converter. I don't know what exactly it is caused by, but I know quite a simple solution for this problem. Step 1. Gethering dataGo to model viewer and open your model. Start playing animations in slow motion mode and make a list of the bugged ones. Now, comes the hardest part. By moving the frames switcher in your WMV you change animation frames. Though, not all of these frames are real. Actual KeyFrames are written to M2, and there are not so much of theme. All other hundreds of frames are just interpolation between them. So, you need to slowly move this switcher and stop it when the animation starts behaving weirdly (most likely goes back or loops where it is not supposed to). Pick up this numbers and add them to your list under your animation. Do it for every animation if necessary.Keep in mind that these frames value are always approximate, and later you will need to find the closest keyframe value. Though, it is not hard as it probably seems to you now. By opening your model in MDLvis (mdx/mdl source model, not m2), you can pickup the bone numbers of the bugged animation parts. Just look in WMV what parts of the body swing badly, find the corresponding bone numbers in MDLVis and add them to the list for each bugged animation. Step 2. Fixing bugsNow open your model in pymodeleditor. Show Node Tree>>Pick up the bone You will now see the Bone Editor. Here you have two buttons: Edit Translation and Edit Rotation. One of them, or both can contain bugged data. Fortunately, it is quite easy to track. When you open either of them, you get the animation KeyFrames cords. For fixing animations, you need to pick up the animation ID of the animation you need to fix in the dropdown menu marked as 4 in the screenshot. Now, speaking about the data itself. Let's now see what is wrong here. This the original block of data. 0:{ -32759 , -32317 , -32287 , -7 } 1:{ -32758 , -32317 , -32287 , -7 } 105:{ -31914 , 31173 , -31813 , -64 } 243:{ -29948 , 26571 , -31292 , -749 } 313:{ -29284 , 25977 , -31367 , -932 } 382:{ -28844 , 28110 , -31543 , -595 } 521:{ -29063 , -29421 , -32425 , -385 } 590:{ -29558 , -27700 , 32598 , -555 } 694:{ -30218 , -29822 , 32081 , -240 } 868:{ -31503 , 28143 , 31892 , -365 } 973:{ -32071 , 25472 , 32029 , -839 } 1077:{ -32320 , 26522 , 32240 , -609 } 1251:{ -32396 , 31488 , 32626 , -28 } 1424:{ -32577 , -32500 , -32588 , -3 } 1667:{ -32758 , -32317 , -32287 , -7 } 1668:{ -32759 , -32317 , -32287 , -7 } The number of the each string before ":" is a KeyFrame number. So, the error should be in some numbers close to our previous WMV records. If you look carefully, some values does not follow the common pattern in the middle of the structure. The errors can be only related to negative/positive value differences. You never need to change the numbers. In most cases you mostly need to remove some minuses in from of the first value. But I picked up the hardest example I could find for you here. :twisted: 521:{ -29063 , -29421 , -32425 , -385 } 590:{ -29558 , -27700 , 32598 , -555 } 694:{ -30218 , -29822 , 32081 , -240 }These 3 keyframes look weird for me. And they suprisingly almost exactly match my WMV aniamtion bug records. Let's see why. Keep a look at the second coloumn. These 3 values are negative while everything around them is positive. Here our animation is most likely to go backwards. Let's change them to positive. 0:{ -32759 , -32317 , -32287 , -7 } 1:{ -32758 , -32317 , -32287 , -7 } 105:{ -31914 , 31173 , -31813 , -64 } 243:{ -29948 , 26571 , -31292 , -749 } 313:{ -29284 , 25977 , -31367 , -932 } 382:{ -28844 , 28110 , -31543 , -595 } 521:{ -29063 , 29421 , -32425 , -385 } 590:{ -29558 , 27700 , 32598 , -555 } 694:{ -30218 , 29822 , 32081 , -240 } 868:{ -31503 , 28143 , 31892 , -365 } 973:{ -32071 , 25472 , 32029 , -839 } 1077:{ -32320 , 26522 , 32240 , -609 } 1251:{ -32396 , 31488 , 32626 , -28 } 1424:{ -32577 , -32500 , -32588 , -3 } 1667:{ -32758 , -32317 , -32287 , -7 } 1668:{ -32759 , -32317 , -32287 , -7 }And it works like that for Translations and Rotations. Just save your files more often to avoid erros and make backups. It takes approximately and hour for every model. But I am pretty sure if you do it often, you will get a faster skill. That's all for now. Big thanks to Vel, Malice and other people who helped me and to the authors of all these tools I used here. I will add some pictures soon enough to make this tutorial more understandable for newbies. If you don't undestand something (my English sucks) or have some problems/tips feel free to ask me. Check this thread from time to time for getting recent updates. Good luck with your first model ;).