Official MeshMagick thread - now licensed under MIT

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Post by sinbad » Thu Aug 02, 2007 10:14 pm

At some point I think this is worth packaging up as a released tool for download, it's very handy.
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Tue Aug 07, 2007 4:26 pm

sinbad wrote:At some point I think this is worth packaging up as a released tool for download, it's very handy.
I'd like that. :)

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.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Mon Aug 20, 2007 7:14 pm

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.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

mangoo
Gnoblar
Posts: 21
Joined: Mon Apr 24, 2006 5:05 pm
Contact:

Post by mangoo » Mon Aug 20, 2007 10:38 pm

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
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Mon Aug 20, 2007 11:19 pm

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?
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

mangoo
Gnoblar
Posts: 21
Joined: Mon Apr 24, 2006 5:05 pm
Contact:

Post by mangoo » Mon Aug 20, 2007 11:34 pm

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.

Image
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Mon Aug 20, 2007 11:39 pm

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
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

mangoo
Gnoblar
Posts: 21
Joined: Mon Apr 24, 2006 5:05 pm
Contact:

Post by mangoo » Tue Aug 21, 2007 12:19 am

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 ;-) )
0 x

User avatar
Chris H
Halfling
Posts: 50
Joined: Sun Aug 12, 2007 5:50 am

Post by Chris H » Tue Aug 21, 2007 2:21 am

Thank you for creating this tool haffax. I had a model that was off center and rotating it looked really bad. Not anymore!
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Tue Aug 21, 2007 9:58 am

mangoo wrote:meshmagick.exe transform -rotate=90/0/1/0 robot.skeleton
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.

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?
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

mangoo
Gnoblar
Posts: 21
Joined: Mon Apr 24, 2006 5:05 pm
Contact:

Post by mangoo » Tue Aug 21, 2007 1:30 pm

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?
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Tue Aug 21, 2007 2:03 pm

Ah sorry, I am dense. Now I understand what you mean. Correct, this is not done yet. I have to think about how to go at this.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

mangoo
Gnoblar
Posts: 21
Joined: Mon Apr 24, 2006 5:05 pm
Contact:

Post by mangoo » Fri Aug 24, 2007 2:20 pm

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?
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Fri Aug 24, 2007 5:49 pm

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.
Thanks, I will have a look at it.
mangoo wrote: By the way, is the "renaming bones" part planned to be implemented soon or will it take long time?
It is already in for a while. Call this for the rename tool help.

Code: Select all

meshmagick -help=rename
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

mangoo
Gnoblar
Posts: 21
Joined: Mon Apr 24, 2006 5:05 pm
Contact:

Post by mangoo » Fri Aug 24, 2007 10:07 pm

the help command tells me that it is in, but when i call it:


Meshmagick.exe rename -bone=Joint3/torso ninja.mesh

Processing mesh...
warning: Renaming bones in meshes not implementes.
Mesh saved as ninja.mesh.
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Fri Aug 24, 2007 10:19 pm

Ah misleading message, you have to call it for the skeleton file, not for the mesh file.
Hm... maybe we should implement it so, that this is automatically applied to the skeleton if found.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber » Fri Aug 24, 2007 11:05 pm

just wanted to note that this tool saved my life, allowing me to salvage a model I was having a lot of time getting into the right orientation!

this tool is a life saver!
0 x
Go Go Gadget OGRE!!
Image

mangoo
Gnoblar
Posts: 21
Joined: Mon Apr 24, 2006 5:05 pm
Contact:

Post by mangoo » Sat Aug 25, 2007 12:28 pm

also for skeleton the same message, and it didnt change it

Meshmagick.exe rename -bone=Joint3/torso ninja.skeleton
Loading skeleton ninja.skeleton...
Processing skeleton...
warning: Renaming bones in skeletons not implemented.
Skeleton saved as ninja.skeleton.
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Sat Aug 25, 2007 2:07 pm

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.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

mangoo
Gnoblar
Posts: 21
Joined: Mon Apr 24, 2006 5:05 pm
Contact:

Post by mangoo » Sat Aug 25, 2007 7:05 pm

cool, thx a lot
0 x

hike1
Greenskin
Posts: 118
Joined: Sun Mar 30, 2003 3:46 am
Contact:

Post by hike1 » Sun Aug 26, 2007 4:45 am

I click on it and a black window flashes momentarily. (win 2000)
Win xp same thing, but it tells me to 'reinstall'
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Sun Aug 26, 2007 10:50 am

hike1, MeshMagick is a non-interactive command line tool. You have to open it from a command line. Type

Code: Select all

MeshMagick -help
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?
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

hike1
Greenskin
Posts: 118
Joined: Sun Mar 30, 2003 3:46 am
Contact:

Post by hike1 » Sun Aug 26, 2007 4:11 pm

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
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Sun Aug 26, 2007 5:17 pm

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. :oops:

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.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Mon Aug 27, 2007 9:52 pm

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.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

Post Reply