Author Topic: .m2 to .obj then .g3d help!  (Read 10788 times)

Arsene842

  • Guest
.m2 to .obj then .g3d help!
« on: 6 January 2013, 12:08:09 »
Hello guys, I began a warcraft mod but, I use Wow Model Viewer, he exports the .m2 and .wmo (files 3D of Warcraft) in .obj.
But, my skills in Blender are not very good and, when I export the .obj files to .g3d, this break down.
    -The model lie ( I don't know how to change the axes x/y/z  ( :thumbdown: for me))
    -It is white (I don't know how to put the textures ( :thumbdown: yet for me))
    -G3d viewer says " Exception caught loading 3d file: C:\Users\ordi\Desktop\untitled.g3d bad allocation "
And others crashes arrive but I think that comes from my bad using of Blender

This file bugs, and so I hope that someone explains me how he makes
http://rapidshare.com/files/3743488771/Baradin.rar

Thank you.
I hope that you understand my english.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: .m2 to .obj then .g3d help!
« Reply #1 on: 6 January 2013, 22:42:12 »
Welcome to Glest.

First things first, you should note that the obj format has no animations. If you're importing a static model, fine, but if you want to import an animated model, you'll need to import it in a different format. If you're able to get the models in the MDL format, you could import them with this. If you can get it into the MDX format, you could convert that to MDL with this and then import that with the previously mentioned MDL importer.

Now, the axes is an easy one. Just select the model (you can select everything with the "a" key) and rotate it in the direction needed (the easiest way to do this would be to use the "r" key followed by either the "x", "y", or "z" key to bind the rotation to an axis and then enter the number of degrees to rotate (such as 90)). Blender also has a rotation tool near the bottom of the 3D window.

As for how to link the texture for the G3D viewer, the instructions for linking the texture to the animation are on this page.

The G3D viewer crashing is likely because of the texture not being linked properly.
« Last Edit: 18 June 2016, 18:30:16 by filux »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

atze

  • Technician
  • ****
  • Posts: 119
    • View Profile
Re: .m2 to .obj then .g3d help!
« Reply #2 on: 7 January 2013, 10:56:51 »
Very nice model. The alpha channel of the helmet-texture could be reduced a little. This picture is to show you, that it is possible to make out the object file a g3d file. You to explain, sorry for my English is not enough. Possibly / hopefully someone else can.

this signature is not available in your country

Arsene842

  • Guest
Re: .m2 to .obj then .g3d help!
« Reply #3 on: 7 January 2013, 16:00:05 »
    For the exportation, my software can only to .obj, .fbx, .lwo, .m3, .mesh.xml, .x3d and to xhtml but I can export the animations in .avi so I think Blender can use them.
    I'm going to train myself in Blender with your instructions

Arsene842

  • Guest
Re: .m2 to .obj then .g3d help!
« Reply #4 on: 7 January 2013, 18:06:43 »
I succeed to change the axes :D .
But, despite various texture tests, the soldier have the shoulders, sword, helmet and the shield visible in white, the body is invisible in grid mod, but I can see him in Wireframe mod.

Please someone can explain me? (I don't understand how to do in the Wiki)
Thank you

atze

  • Technician
  • ****
  • Posts: 119
    • View Profile
Re: .m2 to .obj then .g3d help!
« Reply #5 on: 7 January 2013, 19:03:26 »
I succeed to change the axes :D .
...

Just as a hint: The new export script, you need the axes no longer manually turn before export. Makes the new export script with a check. Thx Yggdrasil.
this signature is not available in your country

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: .m2 to .obj then .g3d help!
« Reply #6 on: 7 January 2013, 23:00:13 »
I succeed to change the axes :D .
But, despite various texture tests, the soldier have the shoulders, sword, helmet and the shield visible in white, the body is invisible in grid mod, but I can see him in Wireframe mod.
There's probably two or more objects. In which case, you'd have to select each object and link the texture.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Arsene842

  • Guest
Re: .m2 to .obj then .g3d help!
« Reply #7 on: 8 January 2013, 19:27:30 »
I think that the problem comes from the exporter g3d ( I use the g3d support version for 2.63 and more, my blender is in the 2.65 )
I think that I have got the right way for linking the textures
Code: [Select]
[img]http://imageshack.us/a/img5/6623/baradinsoldierblender.png[/img]But after exportation, with the megaglest g3d viewer, I can see :
Code: [Select]
[img]http://imageshack.us/a/img541/2226/soldierg3dviewergridmod.png[/img]
So, can you help me?
Thanks
« Last Edit: 27 September 2016, 20:01:18 by filux »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: .m2 to .obj then .g3d help!
« Reply #8 on: 8 January 2013, 20:24:43 »
Alrighty, I downloaded your model and took a closer look. First of all, you have textures in other folders. For the G3d to properly work, you'll need all those textures in the same folder, so move them all together. Your folder should look something like this:



Now, exporting the OBJ model into Blender had a lot of individual objects, so I joined all the objects using the same texture by selecting them and pressing ctrl + J. That makes the body one mesh, and simplifies linking the textures.

Anyway, now I can select each object (since we joined similar stuff together, there should be five objects: the body, the weapon, the helmet, the shield, and the shoulder pads. We can select each one and go to the texture tab, clicking the "new" button to assign a new texture:



From there, set the type to be "image or movie" and open the corresponding texture file.





That's it; the texture is linked for that object (in this case, that was the body). Now do the same for the remaining four objects.

Once all that's done, we can export to G3D. There's no need to have rotated your model if you ticked the "rotate to Glest orientation" checkbox.



In my case, I also toggled on the team colour, as I'm presuming the helmet is supposed to be team colour, not transparency. This is done via the G3D properties panel.



And tada! The finished model.



I strongly recommend doing these steps yourself, so as to get the feel of what needs to be done. However, I'll provide the finished blend file here.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Arsene842

  • Guest
Re: .m2 to .obj then .g3d help!
« Reply #9 on: 9 January 2013, 19:30:31 »
That's good, the body's bug came from the mtl file following the .obj, but, with your instructions I succeed to export the file in .g3d  ;)
Thank you.
Can Blender create an animation with a .avi ? ( wow model viewer can export the animations in that )
Otherwise, the .fbx, .lwo, .m3, .mesh.xml, .x3d and .xhtml can support an animation?
I'm also going to improve my textures ( the alpha was not planned )

Thanks

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: .m2 to .obj then .g3d help!
« Reply #10 on: 9 January 2013, 23:45:42 »
Can Blender create an animation with a .avi ? ( wow model viewer can export the animations in that )
AVI is a video format, not a model format, so no.

I'm afraid I'm not sure about the other formats. Google may be of assistance.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Arsene842

  • Guest
Re: .m2 to .obj then .g3d help!
« Reply #11 on: 10 January 2013, 17:36:48 »
Thank's for your fantastic help but I have to stop my mod because I use the Wow's models so there are some copyrights.
I'm very greatfuling for your help.

Friendly

 

anything