Once in a while, I want to accomplish a pretty simple task, and I don't have the tools to do it. I didn't want to download a 3DS Max trial since it's huge...and a trial. But Blender has a M3 importer, but no exporter. There have been a few times I wanted to move a couple polygons in a model, and then there have been a few times I found animations labeled "None" in a model so there was no way to access them. And since I'm a programmer, I solved my problem the hard way. I wrote a quite simple M3 model editor, which can reposition vertices and rename animation sequences. At first, I had just made a program to scale the height of every model in a directory, because that's the only way to change the height of cliff faces.
And I didn't really want to stop so soon, since I spent 3 hours researching the M3 format. :P
I will probably implement the ability to remove vertices and possibly implement the ability to add them, depending on how difficult it ends up being. I'd like to support at least partial modifying of animations, but that's not looking very likely. I realize that effort would be better spent on a Blender exporter, but I haven't used Python before, and I'm not in a position where I'm comfortable starting that type of project right now since I'm entering the Air Force in March.
Oh, I can see at least 3 uses for this right now ;o
One of them helps me in the .m3a file research, let's see how this turns out, Can you remove verticies at all, though?
Also, what is this coded in? If it's C/C + + would be awesome if you could inbox me the source if you don't mind, I usually end up needing a thing or two that I can add myself, though I lack the knowledge on programming to actually make a program like this.
EDIT: I get errors when loading my .m3 files. And incorrect verticies numbers as well, one of the models I tried to open was a plane and ended up showing up just 3 vertex.
Not with the current version of my model editor, but you can pop open 010 Hex Editor and load up NiNtoxicated's M3 template like I did... struct MODL mdata -> struct Ref mVert -> struct HeadRef HRef -> ulong indData is the number of vertices. Just reduce that number and it should cut off the last vertices. I don't know what kind of effect it has on texturing or continuity of the model, but I speculate that it doesn't affect texturing.
Well, I tried cutting off 400 vertices and I ended up with just a sphere. :P
The program is C#, and I only tested it with about 6 models.
Understandable not to want start anything too huge with that coming up so soon. Kudos on what you have thrown together so far regardless. Do let us know if you decide to do vertex addition/deletion or the blender exporter though, probably get used by everyone on here with any interest in new models, lol.
Fixed a bug where the program loaded the wrong number of vertices. (As long as you didn't modify the vertices that shouldn't have been there in the previous version, it wouldn't have any effect on the model file.)
Fixed sorting by Z value.
I researched a bit more and figured out how faces are drawn, so if I don't get entirely bored with the project, I'll probably enable a polygonal draw mode and adding/removing vertices. (One cannot simply delete vertices without modifying the face data and possibly animation data.) I will also set up editing of material references, so you can put a different skin on a model while still using the original model with its original skin. I'd also like to deal with attach points (which requires implementing bones), but that's pushing it. :P
Can you use this version to do the model scaling you were talking about, if not when's it coming out? Would like to try resizing some terrain objects which can't be scaled otherwise, just like those cliffs.
You can't do that at this time, but that was actually something I was considering the last time I was working on it. I can have that done in no time, just for you. :P
The way my program is designed, it's not possible for information to be lost. I believe you need to update the terrain object's size in the data editor. It could be something else, though. :p
Edit: Well, I tried changing the size in the data editor and it just made the terrain object cease to exist. But I used the previewer to verify the material data hasn't changed despite the ugly stretched edges. It might have to do with the UV mapping needing updated, which my editor is also currently not capable of dealing with. Additionally, the terrain object's edges aren't screwed up everywhere; depending on where you place the object, its edges may look just fine.
I messed around with it some more as a simple doodad and it's got the same issue. If I make doodads out of the old rooftop and the new rooftop and hide terrain cells manually then slot the doodads in, they look exactly the same. Guess it could be the UV.
I don't pretend to know a lot about this, but from looking at the picture, the larger doodad seems slightly more elevated than the other one. It has more pronounced edges too. I am curious if the Z is slightly off causing the ugly line-ness going on there. -0.05 Z could make it look beautiful, lol.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I posted this program in http://www.sc2mapster.com/forums/development/artist-tavern/31243-fast-way-to-rename-animations-in-m3/ already, but I guess it should have its own topic.
Once in a while, I want to accomplish a pretty simple task, and I don't have the tools to do it. I didn't want to download a 3DS Max trial since it's huge...and a trial. But Blender has a M3 importer, but no exporter. There have been a few times I wanted to move a couple polygons in a model, and then there have been a few times I found animations labeled "None" in a model so there was no way to access them. And since I'm a programmer, I solved my problem the hard way. I wrote a quite simple M3 model editor, which can reposition vertices and rename animation sequences. At first, I had just made a program to scale the height of every model in a directory, because that's the only way to change the height of cliff faces.
And I didn't really want to stop so soon, since I spent 3 hours researching the M3 format. :P
I will probably implement the ability to remove vertices and possibly implement the ability to add them, depending on how difficult it ends up being. I'd like to support at least partial modifying of animations, but that's not looking very likely. I realize that effort would be better spent on a Blender exporter, but I haven't used Python before, and I'm not in a position where I'm comfortable starting that type of project right now since I'm entering the Air Force in March.
I hope someone gets some use out of it.
Edit: I've created an Assets page for this.
Oh, I can see at least 3 uses for this right now ;o
One of them helps me in the .m3a file research, let's see how this turns out, Can you remove verticies at all, though?
Also, what is this coded in? If it's C/C + + would be awesome if you could inbox me the source if you don't mind, I usually end up needing a thing or two that I can add myself, though I lack the knowledge on programming to actually make a program like this.
EDIT: I get errors when loading my .m3 files. And incorrect verticies numbers as well, one of the models I tried to open was a plane and ended up showing up just 3 vertex.
Not with the current version of my model editor, but you can pop open 010 Hex Editor and load up NiNtoxicated's M3 template like I did... struct MODL mdata -> struct Ref mVert -> struct HeadRef HRef -> ulong indData is the number of vertices. Just reduce that number and it should cut off the last vertices. I don't know what kind of effect it has on texturing or continuity of the model, but I speculate that it doesn't affect texturing.
Well, I tried cutting off 400 vertices and I ended up with just a sphere. :P
The program is C#, and I only tested it with about 6 models.
Cool. Model loads, nice job :)
@DeProgrammer: Go
Understandable not to want start anything too huge with that coming up so soon. Kudos on what you have thrown together so far regardless. Do let us know if you decide to do vertex addition/deletion or the blender exporter though, probably get used by everyone on here with any interest in new models, lol.
Fixed a bug where the program loaded the wrong number of vertices. (As long as you didn't modify the vertices that shouldn't have been there in the previous version, it wouldn't have any effect on the model file.)
Fixed sorting by Z value.
I researched a bit more and figured out how faces are drawn, so if I don't get entirely bored with the project, I'll probably enable a polygonal draw mode and adding/removing vertices. (One cannot simply delete vertices without modifying the face data and possibly animation data.) I will also set up editing of material references, so you can put a different skin on a model while still using the original model with its original skin. I'd also like to deal with attach points (which requires implementing bones), but that's pushing it. :P
That's really great what you are doing there, nice work!
@DeProgrammer: Go
I already successfully used this program to make a unit animation usable/detectable by model events, keep up the good work.
Can you use this version to do the model scaling you were talking about, if not when's it coming out? Would like to try resizing some terrain objects which can't be scaled otherwise, just like those cliffs.
@zorbotron: Go
You can't do that at this time, but that was actually something I was considering the last time I was working on it. I can have that done in no time, just for you. :P
Edit: Done, uploaded. Enjoy. :3
@DeProgrammer: Go
Hey thanks, I tested it and the scaling works fine, there's some kinks with a texture though.
That texture is normally supposed to copy the terrain texture from the surrounding area, but something got lost along the way.
The model file used is "Assets\TerrainObjects\TerrainObjectRooftopBroken\TerrainObjectRooftopBroken.m3" if you want to take a look at its materials.
The way my program is designed, it's not possible for information to be lost. I believe you need to update the terrain object's size in the data editor. It could be something else, though. :p
Edit: Well, I tried changing the size in the data editor and it just made the terrain object cease to exist. But I used the previewer to verify the material data hasn't changed despite the ugly stretched edges. It might have to do with the UV mapping needing updated, which my editor is also currently not capable of dealing with. Additionally, the terrain object's edges aren't screwed up everywhere; depending on where you place the object, its edges may look just fine.
@DeProgrammer: Go
I messed around with it some more as a simple doodad and it's got the same issue. If I make doodads out of the old rooftop and the new rooftop and hide terrain cells manually then slot the doodads in, they look exactly the same. Guess it could be the UV.
@zorbotron: Go
I don't pretend to know a lot about this, but from looking at the picture, the larger doodad seems slightly more elevated than the other one. It has more pronounced edges too. I am curious if the Z is slightly off causing the ugly line-ness going on there. -0.05 Z could make it look beautiful, lol.