Page 3 of 12

Posted: Thu Aug 02, 2007 10:14 pm
by sinbad
At some point I think this is worth packaging up as a released tool for download, it's very handy.

Posted: Tue Aug 07, 2007 4:26 pm
by haffax
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.

Posted: Mon Aug 20, 2007 7:14 pm
by haffax
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.

Posted: Mon Aug 20, 2007 10:38 pm
by mangoo
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

Posted: Mon Aug 20, 2007 11:19 pm
by haffax
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?

Posted: Mon Aug 20, 2007 11:34 pm
by mangoo
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

Posted: Mon Aug 20, 2007 11:39 pm
by haffax
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

Posted: Tue Aug 21, 2007 12:19 am
by mangoo
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 ;-) )

Posted: Tue Aug 21, 2007 2:21 am
by Chris H
Thank you for creating this tool haffax. I had a model that was off center and rotating it looked really bad. Not anymore!

Posted: Tue Aug 21, 2007 9:58 am
by haffax
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?

Posted: Tue Aug 21, 2007 1:30 pm
by mangoo
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?

Posted: Tue Aug 21, 2007 2:03 pm
by haffax
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.

Posted: Fri Aug 24, 2007 2:20 pm
by mangoo
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?

Posted: Fri Aug 24, 2007 5:49 pm
by haffax
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

Posted: Fri Aug 24, 2007 10:07 pm
by mangoo
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.

Posted: Fri Aug 24, 2007 10:19 pm
by haffax
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.

Posted: Fri Aug 24, 2007 11:05 pm
by walaber
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!

Posted: Sat Aug 25, 2007 12:28 pm
by mangoo
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.

Posted: Sat Aug 25, 2007 2:07 pm
by haffax
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.

Posted: Sat Aug 25, 2007 7:05 pm
by mangoo
cool, thx a lot

Posted: Sun Aug 26, 2007 4:45 am
by hike1
I click on it and a black window flashes momentarily. (win 2000)
Win xp same thing, but it tells me to 'reinstall'

Posted: Sun Aug 26, 2007 10:50 am
by haffax
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?

Posted: Sun Aug 26, 2007 4:11 pm
by hike1
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

Posted: Sun Aug 26, 2007 5:17 pm
by haffax
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.

Posted: Mon Aug 27, 2007 9:52 pm
by haffax
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.