Official MeshMagick thread - now licensed under MIT
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
I'd like that.sinbad wrote:At some point I think this is worth packaging up as a released tool for download, it's very handy.
But I need a bit time before the release. Because there are a few things that should be done before it becomes a semi-official tool like this.
There is still an unresolved bug regarding animations transform. It works for most, but a user provided a mesh and skeleton which have problems.
The option -keep-file-version should be eliminated. It more often fails than it works and I see no sensible way to fix that.
Also messages given by the program have to become more consistent in style. Maybe they could be templated for the tools to use, I have to think about whether its worth it. Else manually looking all over will fix that too.
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
MeshMagick is now available as part of the Ogre command line tools as of the new Ogre version 1.4.4. I am very happy about being able to provide something useful.
You can download a binary version from here: http://www.ogre3d.org/index.php?option= ... Itemid=133
Changes since last binary version:
* New tool optimise. This tool resolves unnecessary vertex duplication in meshes and redundant keyframes / tracks in skeletons. This tool is made by Sinbad.
* New tool rename. This tool allows to rename various elements (bones, materials, etc.) in meshes/skeletons. This tool is made by Blakharaz.
* New informations given by the info tool. It now diplsays the number of referenced bones per submesh and the number of weights per submesh. It also displays the layout of the vertex buffers.
* Fixed various bugs in all tools. Most important transform bugs regarding animations. Now all tested animations work with all tested transforms. There are no known bugs left in the transform tool.
Please report bugs and feature requests here. I am very interested in ideas for improvement (please provide an practical example for when this is useful.)
Also when you report bugs, it would be nice if you could provide a mesh/skeleton and a command line to reproduce the problem. You can also PM or Mail models if you need them to be unpublished.
You can download a binary version from here: http://www.ogre3d.org/index.php?option= ... Itemid=133
Changes since last binary version:
* New tool optimise. This tool resolves unnecessary vertex duplication in meshes and redundant keyframes / tracks in skeletons. This tool is made by Sinbad.
* New tool rename. This tool allows to rename various elements (bones, materials, etc.) in meshes/skeletons. This tool is made by Blakharaz.
* New informations given by the info tool. It now diplsays the number of referenced bones per submesh and the number of weights per submesh. It also displays the layout of the vertex buffers.
* Fixed various bugs in all tools. Most important transform bugs regarding animations. Now all tested animations work with all tested transforms. There are no known bugs left in the transform tool.
Please report bugs and feature requests here. I am very interested in ideas for improvement (please provide an practical example for when this is useful.)
Also when you report bugs, it would be nice if you could provide a mesh/skeleton and a command line to reproduce the problem. You can also PM or Mail models if you need them to be unpublished.
-
- Gnoblar
- Posts: 21
- Joined: Mon Apr 24, 2006 5:05 pm
- Contact:
hi, nice work.
what about a parameter that changes the axes.
like the x axis becomes -z. i know atm you can do this for a whole mesh by rotating, but what about the bones? would be damn useful to be able to change this without affecting the animation.
or is it already included?
as an example.
i now have the robot.mesh, looking towards -Z.
now i wanted to attach the camera on the bone of the head.
but its x axis is looking to -Z. so when i attach the camera, the camera looks in the wrong direction. i now would like to: x,y,z => -z,y,x
regards
mangoo
what about a parameter that changes the axes.
like the x axis becomes -z. i know atm you can do this for a whole mesh by rotating, but what about the bones? would be damn useful to be able to change this without affecting the animation.
or is it already included?
as an example.
i now have the robot.mesh, looking towards -Z.
now i wanted to attach the camera on the bone of the head.
but its x axis is looking to -Z. so when i attach the camera, the camera looks in the wrong direction. i now would like to: x,y,z => -z,y,x
regards
mangoo
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
mangoo, Bones are rotated according to the chosen transform (root bones are, because all others are relative to it) So that animations still work properly after transforming the mesh. All transforms you can do won't affect animations. If they do, please file a bug report.
Adding an easier way to describe this kind of transforms is a possible addition, but it is very low priority, because it doesn't add something that can't be done right now with MeshMagick. You always can transform this into rotation/scaling.
I don't understand your camera problem.
Changing reference coordinate system is done by rotating and scaling the mesh. x, y, z -> -z, y, x is just a rotation by 90°( or -90° not sure form the top of my head) around Y-Axis. I don't understand the part with the camera looking in the wrong direction.
Can you please explain this in more detail?
Adding an easier way to describe this kind of transforms is a possible addition, but it is very low priority, because it doesn't add something that can't be done right now with MeshMagick. You always can transform this into rotation/scaling.
I don't understand your camera problem.
Changing reference coordinate system is done by rotating and scaling the mesh. x, y, z -> -z, y, x is just a rotation by 90°( or -90° not sure form the top of my head) around Y-Axis. I don't understand the part with the camera looking in the wrong direction.
Can you please explain this in more detail?
-
- Gnoblar
- Posts: 21
- Joined: Mon Apr 24, 2006 5:05 pm
- Contact:
Sure,
The red arrow indicates the local x-axis of the bone.
The model itself is looking to -Z.
So the two axis are heading in the same direction, but for the bone its x, and for the robot -z. Now i would look to change the coordinate system of the bone, so that the x axis becomes -z like it is set for the mesh.
The red arrow indicates the local x-axis of the bone.
The model itself is looking to -Z.
So the two axis are heading in the same direction, but for the bone its x, and for the robot -z. Now i would look to change the coordinate system of the bone, so that the x axis becomes -z like it is set for the mesh.
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
This is done automatically when the skeleton is in the same directory as the mesh when you call meshmagick.
Else you can just call meshmagick with the same options as for the mesh for the skeleton. whether you feed it a mesh or skeleton doesn't matter for the transform tool.
If the skeleton file could not be found, you get a warning from the tool. If you don't want the skeleton to be transformed with the mesh, you can use the global option -no-follow-skeleton.
HTH
Else you can just call meshmagick with the same options as for the mesh for the skeleton. whether you feed it a mesh or skeleton doesn't matter for the transform tool.
If the skeleton file could not be found, you get a warning from the tool. If you don't want the skeleton to be transformed with the mesh, you can use the global option -no-follow-skeleton.
HTH
-
- Gnoblar
- Posts: 21
- Joined: Mon Apr 24, 2006 5:05 pm
- Contact:
ah great,
but it seems not to work here.
at least not if i apply it only to the skeleton file afterwards.
Here are the files that i described before.
http://www.feuerware.com/temp/robot.mesh
http://www.feuerware.com/temp/robot.skeleton
I called
meshmagick.exe transform -rotate=90/0/1/0 robot.skeleton
and now the animation isnt correct anymore (it is not the same as before, its running to the side, maybe this change is also useful, but not in my case )
but it seems not to work here.
at least not if i apply it only to the skeleton file afterwards.
Here are the files that i described before.
http://www.feuerware.com/temp/robot.mesh
http://www.feuerware.com/temp/robot.skeleton
I called
meshmagick.exe transform -rotate=90/0/1/0 robot.skeleton
and now the animation isnt correct anymore (it is not the same as before, its running to the side, maybe this change is also useful, but not in my case )
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
Don't call it for the robot.skeleton, but for the robot.mesh and make sure the robot.skeleton is in the same directory. I just checked it and it works fine.mangoo wrote:meshmagick.exe transform -rotate=90/0/1/0 robot.skeleton
It also works when you first change the mesh and then the skeleton, I checked this too. Just make sure you don't accidentally change the skeleton twice. Changing the mesh also transforms the skeleton if it is in the same directory and you are not using the -no-follow-skeleton-Option.
So maybe you rotated the mesh only once but your skeleton twice?
-
- Gnoblar
- Posts: 21
- Joined: Mon Apr 24, 2006 5:05 pm
- Contact:
hmmmm,
i uploaded now the robot.mesh and robot.skeleton from the newest sdk 1.4.4, links two posts before
i also redownloaded the commandline tools
when i call
MeshMagick.exe transform -rotate=90/0/1/0 robot.mesh
Loading mesh robot.mesh...
Processing mesh...
Mesh saved as robot.mesh.
Loading skeleton robot.skeleton...
Processing skeleton...
Skeleton saved as robot.skeleton.
it works fine, but still the x axis of the bones are looking towards -z
then i tried to call it for the skeleton a second time and, as you said, the animation was destroyed.
the next thing i tried. first apply it only to the mesh( so i removed the skeleton) then put the skeleton back and call it only for the skeleton, which gave the same result like if i apply it for both.
so i am a bit lost now, are you sure it works fine with your version?
could you maybe post an example of the .skeleton and mesh with correct axes( blue looking to the front in lexiview) so i can download it?
i uploaded now the robot.mesh and robot.skeleton from the newest sdk 1.4.4, links two posts before
i also redownloaded the commandline tools
when i call
MeshMagick.exe transform -rotate=90/0/1/0 robot.mesh
Loading mesh robot.mesh...
Processing mesh...
Mesh saved as robot.mesh.
Loading skeleton robot.skeleton...
Processing skeleton...
Skeleton saved as robot.skeleton.
it works fine, but still the x axis of the bones are looking towards -z
then i tried to call it for the skeleton a second time and, as you said, the animation was destroyed.
the next thing i tried. first apply it only to the mesh( so i removed the skeleton) then put the skeleton back and call it only for the skeleton, which gave the same result like if i apply it for both.
so i am a bit lost now, are you sure it works fine with your version?
could you maybe post an example of the .skeleton and mesh with correct axes( blue looking to the front in lexiview) so i can download it?
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
-
- Gnoblar
- Posts: 21
- Joined: Mon Apr 24, 2006 5:05 pm
- Contact:
hi,
in the last days i tried some things and i think there is a still a bug in the transform tool: if you rotate the robot.mesh looking to -Z (having the skeleton in the same dir) some animations dont work properly.
"Walk" and "Die" works fine, but have a look on "Shoot". Its moving to the side which differs from the animation before.
By the way, is the "renaming bones" part planned to be implemented soon or will it take long time?
in the last days i tried some things and i think there is a still a bug in the transform tool: if you rotate the robot.mesh looking to -Z (having the skeleton in the same dir) some animations dont work properly.
"Walk" and "Die" works fine, but have a look on "Shoot". Its moving to the side which differs from the animation before.
By the way, is the "renaming bones" part planned to be implemented soon or will it take long time?
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
Thanks, I will have a look at it.mangoo wrote:if you rotate the robot.mesh looking to -Z (having the skeleton in the same dir) some animations dont work properly.
"Walk" and "Die" works fine, but have a look on "Shoot". Its moving to the side which differs from the animation before.
It is already in for a while. Call this for the rename tool help.mangoo wrote: By the way, is the "renaming bones" part planned to be implemented soon or will it take long time?
Code: Select all
meshmagick -help=rename
-
- Gnoblar
- Posts: 21
- Joined: Mon Apr 24, 2006 5:05 pm
- Contact:
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
- walaber
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
- Contact:
-
- Gnoblar
- Posts: 21
- Joined: Mon Apr 24, 2006 5:05 pm
- Contact:
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
mangoo, I've implemented it now. Bone renaming is available in CVS now.
I am not the original author of the rename tool, so I didn't know bone renaming has not been implemented till now. Maybe Blakharaz didn't want to commit the atrocities to sensible OO programming, I had to do to get it to work.
Ogre API does not allow renaming of bones or animations so we had to trick a bit.
I am not the original author of the rename tool, so I didn't know bone renaming has not been implemented till now. Maybe Blakharaz didn't want to commit the atrocities to sensible OO programming, I had to do to get it to work.
Ogre API does not allow renaming of bones or animations so we had to trick a bit.
-
- Gnoblar
- Posts: 21
- Joined: Mon Apr 24, 2006 5:05 pm
- Contact:
-
- Greenskin
- Posts: 118
- Joined: Sun Mar 30, 2003 3:46 am
- Contact:
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
hike1, MeshMagick is a non-interactive command line tool. You have to open it from a command line. Type
to see help information about the tool.
With XP, the ogre command line tool installer should have installed the required C++ runtime libs. Did you maybe just copy the MeshMagick.exe from somewhere?
Code: Select all
MeshMagick -help
With XP, the ogre command line tool installer should have installed the required C++ runtime libs. Did you maybe just copy the MeshMagick.exe from somewhere?
-
- Greenskin
- Posts: 118
- Joined: Sun Mar 30, 2003 3:46 am
- Contact:
K, now I get it, you have to go /start/run.. and type
'cmd' to get a dosbox, then if your ogretools are
in say, E:/ogretools type
e: and press enter
and then type
/cd ogretools
E:\ogretools>meshmagick -help=transform
Scales, rotates or otherwise transforms a mesh
possible transformations:
-scale=x/y/z - scale the mesh by this scale vector
-rotate=angle/x/y/z - rotate the mesh <angle> degrees on the axis x/y/z
-translate=x/y/z - translate the mesh by this vector
-xalign=right|left|center : align the mesh on x axis
-yalign=top|bottom|center : align the mesh on y axis
-zalign=front|back|center : align the mesh on z axis
(All transform options are applied in their relative order.)
other options:
-no-normalise-normals: prevents normalisation of normals
-no-update-boundingbox: keeps bounding box as defined in the file
E:\ogretools>meshmagick transform -scale=.2/.2/.2 virgil_copy.mesh
Loading mesh virgil_copy.mesh...
Processing mesh...
Mesh saved as virgil_copy.mesh.
Loading skeleton virgil_copy-Armature.skeleton...
Processing skeleton...
Skeleton saved as virgil_copy-Armature.skeleton.
OR rotating:
> MeshMagick transform -rotate=90/0/1/0 robot.mesh
This rotates him on the Y, the line running through his back and stomach, he'll
tilt to the LEFT if you're looking at his back.
90/0/0/1 rotates him on the vertical z.
The Neoaxis engine has rotating in the map editor, but scaling doesn't work. Another problem is that
some of the meshes fall 1/2 way through the floor
at game start, these appear to have the pivot at the model top, while the ones that don't fall through have their pivot at the middle, I ran the
zalign command but it didn't seem to matter.
Also, the zombie that comes with neoaxis flips
180 in z once the game starts.
http://terrymorgan.net/pivot_point2.jpg
'cmd' to get a dosbox, then if your ogretools are
in say, E:/ogretools type
e: and press enter
and then type
/cd ogretools
E:\ogretools>meshmagick -help=transform
Scales, rotates or otherwise transforms a mesh
possible transformations:
-scale=x/y/z - scale the mesh by this scale vector
-rotate=angle/x/y/z - rotate the mesh <angle> degrees on the axis x/y/z
-translate=x/y/z - translate the mesh by this vector
-xalign=right|left|center : align the mesh on x axis
-yalign=top|bottom|center : align the mesh on y axis
-zalign=front|back|center : align the mesh on z axis
(All transform options are applied in their relative order.)
other options:
-no-normalise-normals: prevents normalisation of normals
-no-update-boundingbox: keeps bounding box as defined in the file
E:\ogretools>meshmagick transform -scale=.2/.2/.2 virgil_copy.mesh
Loading mesh virgil_copy.mesh...
Processing mesh...
Mesh saved as virgil_copy.mesh.
Loading skeleton virgil_copy-Armature.skeleton...
Processing skeleton...
Skeleton saved as virgil_copy-Armature.skeleton.
OR rotating:
> MeshMagick transform -rotate=90/0/1/0 robot.mesh
This rotates him on the Y, the line running through his back and stomach, he'll
tilt to the LEFT if you're looking at his back.
90/0/0/1 rotates him on the vertical z.
The Neoaxis engine has rotating in the map editor, but scaling doesn't work. Another problem is that
some of the meshes fall 1/2 way through the floor
at game start, these appear to have the pivot at the model top, while the ones that don't fall through have their pivot at the middle, I ran the
zalign command but it didn't seem to matter.
Also, the zombie that comes with neoaxis flips
180 in z once the game starts.
http://terrymorgan.net/pivot_point2.jpg
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
hike1, sorry if I don't get it. Is your post a problem report? I am not sure whether you are talking about problems in MeshMagick or NeoAxis mapeditor.
In case you encountered a MeshMagick problem can you please write what you try to do, what your expected result is and how the actual result deviates? For each problem separately. It is hard for me to understand your post.
In case you encountered a MeshMagick problem can you please write what you try to do, what your expected result is and how the actual result deviates? For each problem separately. It is hard for me to understand your post.
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
I just fixed the other bug reported by mangoo in animation transformation in the transform tool in CVS. Now the robot's shoot animation works, as do all other animations/meshes that I tested. This should resolve all known bugs.
mangoo, I decided to add another transform option that does main axes transformation in the form -axes=Y/-Z/X. This option will not work in conjuction with others(though another call can be done afterwards), but it will also transform the skeleton accordingly. I can't give you a date for this, I will do it when I find the time and I feel like doing it.
As always: Patches are welcome.
mangoo, I decided to add another transform option that does main axes transformation in the form -axes=Y/-Z/X. This option will not work in conjuction with others(though another call can be done afterwards), but it will also transform the skeleton accordingly. I can't give you a date for this, I will do it when I find the time and I feel like doing it.
As always: Patches are welcome.