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
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 Jul 22, 2008 9:20 pm

@Beauty, yes this is a good idea. Will come eventually.

@prolow, I have to admit that I haven't yet looked at the meshmerge tool, it is a contribution by blakharaz. So I don't know what happens in detail there. Pose animations are very likely not handled by meshmerge, since it was not needed for the original purpose it has been written.
I notify blakharaz about it.

But what is the line supposed to do? It merges a singe input mesh into a new output mesh? What for?
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
prolow
Halfling
Posts: 72
Joined: Tue May 08, 2007 10:47 pm
Location: Cedar Falls, Iowa USA
Contact:

Post by prolow » Wed Jul 23, 2008 6:03 pm

well i assumed if given a single mesh with multple submeshes with the same material it would merge the submeshes into a single submesh.
You may ask "why don't you merge the meshes before you export?"
I'm working on a "Sim's like" character creator. the characters are made of parts i.e. arms, legs, head, shirt, sweater, shorts, pants, shoes, etc. each of which have poses to allow for shape variation, i.e. fat, skinny, etc,
if left seperate the parts are a batch a piece and when all are skinned to a full skeleton become rather inefficiant at runtime.
To get he most efficiant in-game character i had previouslly combined the parts in a process that semi-automated the recreation of the poses on the combined mesh, once per every combination of shirt type * pants type * shoe type * gender, which was long enough to not never want to do it that way again, but it gave me a single mesh/submesh per variation and runs one batch per character insead of six.
Now there are more clothing types(= more combination) and i think if the submeshes can be combined in post without losing their pose or skinning data i can get the cobination exported much quicker.
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 » Wed Jul 23, 2008 6:23 pm

prolow wrote:well i assumed if given a single mesh with multple submeshes with the same material it would merge the submeshes into a single submesh.
No this is not what meshmerge does. It merges multiple input meshes into a single output mesh. It is really simple yet and doesn't do any optimizations and it doesn't merge submeshes.

So it doesn't do what you expect it to do, but nevertheless poses shouldn't be stripped. Blakharaz is looking at it, but no ETA on it so far.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
Page
Gnoblar
Posts: 23
Joined: Wed Jul 16, 2008 12:13 am

Post by Page » Thu Jul 24, 2008 12:42 am

Mac link is busted. :( Anyone have a working build?

-Page
0 x

User avatar
luis
Greenskin
Posts: 119
Joined: Tue Mar 02, 2004 3:33 pm
Location: Spain / Argentina
x 4
Contact:

Post by luis » Thu Jul 24, 2008 9:21 am

Is it possible to add a new feature for converting meshes with shared vertices to not use shared vertices ?

It would be useful for people (like me) using PagedGeometry lib since it cant load meshes with shared vertices...

thanks!
Luis.
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 » Thu Jul 24, 2008 10:43 am

Page wrote:Mac link is busted. :( Anyone have a working build?
meshmagick should build on mac just fine. I don't have a mac, but Sinbad and blakharaz do and afaik they keep the xcode files uptodate.
Just give the svn version a try.
luis wrote:Is it possible to add a new feature for converting meshes with shared vertices to not use shared vertices ?

It would be useful for people (like me) using PagedGeometry lib since it cant load meshes with shared vertices...
This will be part of the reorganise tool I have on my backburner for quite some time. I don't know when I come back to work on it further.
You can implement the functionality yourself, extending MeshMagick is simple.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
luis
Greenskin
Posts: 119
Joined: Tue Mar 02, 2004 3:33 pm
Location: Spain / Argentina
x 4
Contact:

Post by luis » Thu Jul 24, 2008 2:53 pm

thanks haffax, I think i'll wait if you're going to implement it... i have no time :(
0 x

User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
Contact:

Post by Beauty » Thu Jul 24, 2008 4:30 pm

prolow wrote:MeshMagick -no-follow-skeleton info M_ShortsTShirtb.mesh
I'm not shure, but maybe the first parameter must be the name of the tool and after this the options.
Possibly this works: MeshMagick info -no-follow-skeleton M_ShortsTShirtb.mesh

The meshmagick program I don't have here.
And in the wiki I forgot to post the common command line syntax :oops:
0 x
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.

User avatar
prolow
Halfling
Posts: 72
Joined: Tue May 08, 2007 10:47 pm
Location: Cedar Falls, Iowa USA
Contact:

Post by prolow » Thu Jul 24, 2008 4:39 pm

beauty,
"-no-follow-skeleton" is a global option not a tool option
MeshMagick [global_options] toolname [tool_options] infile(s) -- [outfile(s)]
0 x

User avatar
prolow
Halfling
Posts: 72
Joined: Tue May 08, 2007 10:47 pm
Location: Cedar Falls, Iowa USA
Contact:

Post by prolow » Thu Jul 24, 2008 9:07 pm

after looking at the xml conversion of two mesh files, one being a mesh made of two submeshes, and the other combined and poses recreated before export, and comparing the two, it looks like the submesh face index, and poseoffset data need only rearranging, and the face count would need updating. All of which could potentially be done in text editor batch cmd, search/replace reg ex, albeit a complicated one.

seperate submeshs

Code: Select all

    <submeshes>
        <submesh material="lambert1" usesharedvertices="true" use32bitindexes="true" operationtype="triangle_list">
            <faces count="1">
                <face v1="0" v2="2" v3="1" />
            </faces>
            <boneassignments />
        </submesh>
        <submesh material="lambert1" usesharedvertices="true" use32bitindexes="true" operationtype="triangle_list">
            <faces count="1">
                <face v1="3" v2="5" v3="4" />
            </faces>
            <boneassignments />
        </submesh>
    </submeshes>
    <skeletonlink name="SubmeshMergeTest.skeleton" />
    <boneassignments>
        <vertexboneassignment vertexindex="0" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="1" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="2" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="3" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="4" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="5" boneindex="0" weight="1" />
    </boneassignments>
    <poses>
        <pose target="mesh" name="down">
            <poseoffset index="2" x="0.0107226" y="-2" z="0" />
        </pose>
        <pose target="mesh" name="up">
            <poseoffset index="2" x="0.0107226" y="2" z="0" />
        </pose>
        <pose target="mesh" name="down">
            <poseoffset index="5" x="0.0107226" y="-2" z="0" />
        </pose>
        <pose target="mesh" name="up">
            <poseoffset index="5" x="0.0107226" y="2" z="0" />
        </pose>
    </poses>
combined submesh

Code: Select all

    <submeshes>
        <submesh material="lambert1" usesharedvertices="true" use32bitindexes="true" operationtype="triangle_list">
            <faces count="2">
                <face v1="0" v2="2" v3="1" />
                <face v1="3" v2="5" v3="4" />
            </faces>
            <boneassignments />
        </submesh>
    </submeshes>
    <skeletonlink name="SubmeshMergeTest.skeleton" />
    <boneassignments>
        <vertexboneassignment vertexindex="0" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="1" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="2" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="3" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="4" boneindex="0" weight="1" />
        <vertexboneassignment vertexindex="5" boneindex="0" weight="1" />
    </boneassignments>
    <poses>
        <pose target="mesh" name="down">
            <poseoffset index="2" x="0.0107226" y="-2" z="0" />
            <poseoffset index="5" x="0.0107226" y="-2" z="0" />
        </pose>
        <pose target="mesh" name="up">
            <poseoffset index="2" x="0.0107226" y="2" z="0" />
            <poseoffset index="5" x="0.0107226" y="2" z="0" />
        </pose>
    </poses>
0 x

User avatar
Page
Gnoblar
Posts: 23
Joined: Wed Jul 16, 2008 12:13 am

Post by Page » Fri Jul 25, 2008 12:32 am

haffax wrote:
Page wrote:Mac link is busted. :( Anyone have a working build?
meshmagick should build on mac just fine. I don't have a mac, but Sinbad and blakharaz do and afaik they keep the xcode files uptodate.
Just give the svn version a try.
Cheers. Found and built. :)

-Page
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 » Wed Jul 30, 2008 11:13 pm

Beauty wrote: It would be nice if there would be a sum of all included vertices and triangles in the end.
This is implemented now. There are also two new other informations printed: whether mesh has an edge list and how many LOD levels are stored.

I also implemented a new feature from which I hope that it makes the info tool much more useful.
You can now have tabular output with the options you want printed.
An example:

Code: Select all

> meshmagick info -list=name/total_vertex_count men_alrike.mesh

men_alrike.mesh 1468
This is useful in conjunction with find, as you can now have a readable report about mulitple meshes at once.

Code: Select all

> find . -iname *.mesh -exec meshmagick info -list=name/total_vertex_count {} ;

.\men_alrike.mesh       1468
.\nat_baum_shadix_03.mesh       3037
.\nat_nadelbaum_02.mesh 2230
.\ninja.mesh    842
.\Ruchin_i.mesh 33111
.\Ruchin_j.mesh 11284
.\Ruchin_o.mesh 20888
In conjunction with perl you even can only list meshes with a certain trait.
This lists all meshes that don't have an edge list:

Code: Select all

> find . -iname *.mesh -exec meshmagick info -list=name/edge_list {} ; | perl -nae 'print "$F[0]\n" unless $F[1] == "yes"'

.\men_alrike.mesh
.\nat_baum_shadix_03.mesh
.\nat_nadelbaum_02.mesh
.\ninja.mesh
.\Ruchin_i.mesh
.\Ruchin_j.mesh
.\Ruchin_o.mesh
It is quite late now and I haven't yet put together a list of list-fields, I have made every option available that is also printed in the report. For now you have to look it up in the source.
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 » Thu Jul 31, 2008 8:55 pm

Another few changes to the info tool.
I added a few more fields for the -list option, fixed bugs, added new -delim option to set delimiter to use in order to separate fields in tabular output.
Changes are now reflected in the tool help, info tool help now prints all available options and list fields.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
hagish
Kobold
Posts: 30
Joined: Wed Jul 25, 2007 2:34 am
Contact:

Post by hagish » Thu Aug 14, 2008 12:30 pm

i dont know if someone else needs this feature but i added an option to flip normals by reordering indices (for culling issues).

patch against rev 2490 @ https://ogreaddons.svn.sourceforge.net/ ... meshmagick

Code: Select all

Index: include/InfoTool.h
===================================================================
--- include/InfoTool.h	(revision 2490)
+++ include/InfoTool.h	(working copy)
@@ -100,8 +100,8 @@
 		SkeletonInfo skeleton;
 
 		MeshInfo() : name(), version(), endian(),
-			storedBoundingBox(Ogre::AxisAlignedBox::BOX_NULL),
-			actualBoundingBox(Ogre::AxisAlignedBox::BOX_NULL),
+			storedBoundingBox(Ogre::AxisAlignedBox()),
+			actualBoundingBox(Ogre::AxisAlignedBox()),
 			hasEdgeList(false), numLodLevels(0),
 			hasSharedVertices(false), sharedVertices(), submeshes(),
 			morphAnimations(), poseNames(),
Index: include/TransformTool.h
===================================================================
--- include/TransformTool.h	(revision 2490)
+++ include/TransformTool.h	(working copy)
@@ -42,6 +42,7 @@
         Ogre::Matrix4 mTransform;
         Ogre::AxisAlignedBox mBoundingBox;
         bool mNormaliseNormals;
+        bool mFlipNormals;
         bool mUpdateBoundingBox;
         OptionList mOptions;
 
@@ -54,6 +55,7 @@
 
         void setOptions(const OptionList& options);
 
+        void processIndexData(Ogre::IndexData* indexData);
         void processVertexData(Ogre::VertexData* vertexData);
         void processPositionElement(Ogre::VertexData* vertexData,
             const Ogre::VertexElement* vertexElem);
Index: src/TransformToolFactory.cpp
===================================================================
--- src/TransformToolFactory.cpp	(revision 2490)
+++ src/TransformToolFactory.cpp	(working copy)
@@ -56,6 +56,7 @@
         optionDefs.insert(OptionDefinition("resize", OT_STRING, false, true));
 
         optionDefs.insert(OptionDefinition("no-normalise-normals"));
+        optionDefs.insert(OptionDefinition("flip-normals"));
         optionDefs.insert(OptionDefinition("no-update-boundingbox"));
         return optionDefs;
     }
@@ -88,6 +89,7 @@
             << std::endl;
         out << "other options:" << std::endl;
         out << "   -no-normalise-normals: prevents normalisation of normals" << std::endl;
+        out << "   -flip-normals: flip normals by reordering triangle indices" << std::endl;
         out << "   -no-update-boundingbox: keeps bounding box as defined in the file"
             << std::endl
             << std::endl;
Index: src/TransformTool.cpp
===================================================================
--- src/TransformTool.cpp	(revision 2490)
+++ src/TransformTool.cpp	(working copy)
@@ -35,6 +35,7 @@
     TransformTool::TransformTool()
         : mTransform(Matrix4::IDENTITY),
           mNormaliseNormals(false),
+          mFlipNormals(false),
           mUpdateBoundingBox(true),
           mOptions()
     {
@@ -230,6 +231,7 @@
             if (submesh->vertexData != NULL)
             {
                 processVertexData(submesh->vertexData);
+                processIndexData(submesh->indexData);
             }
         }
 
@@ -269,6 +271,61 @@
         }
     }
 
+    void TransformTool::processIndexData(IndexData* indexData){
+		// flip normals
+		if(mFlipNormals){
+			print("flipping index order for normal flipping", V_HIGH);
+    		if(indexData->indexCount % 3 == 0){
+				Ogre::HardwareIndexBufferSharedPtr buffer = indexData->indexBuffer;
+
+				unsigned char* data =
+					static_cast<unsigned char*>(buffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
+
+				if(buffer->getType() == Ogre::HardwareIndexBuffer::IT_16BIT){
+					// 16 bit
+					print("using 16bit indices", V_HIGH);
+					uint16 tmp;
+					
+					for (size_t i = 0; i < indexData->indexCount; i+=3)
+					{
+						uint16* i0 = (uint16*)(data+0 * buffer->getIndexSize());
+						uint16* i1 = (uint16*)(data+1 * buffer->getIndexSize());
+						uint16* i2 = (uint16*)(data+2 * buffer->getIndexSize());
+						
+						// flip
+						tmp = *i0;
+						*i0 = *i2;
+						*i2 = tmp;
+						
+						data += 3 * buffer->getIndexSize();
+					}
+				} else {
+					// 32 bit
+					print("using 32bit indices", V_HIGH);
+					uint32 tmp;
+					
+					for (size_t i = 0; i < indexData->indexCount; i+=3)
+					{
+						uint32* i0 = (uint32*)(data+0 * buffer->getIndexSize());
+						uint32* i1 = (uint32*)(data+1 * buffer->getIndexSize());
+						uint32* i2 = (uint32*)(data+2 * buffer->getIndexSize());
+						
+						// flip
+						tmp = *i0;
+						*i0 = *i2;
+						*i2 = tmp;
+						
+						data += 3 * buffer->getIndexSize();
+					}				
+				}
+				
+				buffer->unlock();
+			} else {
+				printf("index number is not a multiple of 3. no normal flipping possible!", V_NORMAL);
+			}
+		}
+	}
+	
     void TransformTool::processVertexData(VertexData* vertexData)
     {
         const VertexElement* position =
@@ -308,6 +365,9 @@
 
         unsigned char* data =
             static_cast<unsigned char*>(buffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
+		
+		unsigned char* data_start = data;
+			
         for (size_t i = 0; i < vertexData->vertexCount; ++i)
         {
             Real* ptr;
@@ -322,6 +382,7 @@
 
             data += buffer->getVertexSize();
         }
+		
         buffer->unlock();
     }
 
@@ -388,6 +449,11 @@
     {
         mOptions = options;
 
+        mFlipNormals = OptionsUtil::isOptionSet(options, "flip-normals");
+        if (mFlipNormals)
+        {
+            print("Flip normals by reordering triangle indices", V_HIGH);
+        }
         mNormaliseNormals = !OptionsUtil::isOptionSet(options, "no-normalise-normals");
         if (!mNormaliseNormals)
         {
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 15, 2008 9:56 am

Thank you hagish. Looks very useful to me,I will apply it.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

glennr
Greenskin
Posts: 118
Joined: Thu Jun 05, 2008 3:26 am
Location: Thames, New Zealand
x 6

Patch for adding vertex animation to MeshMergeTool

Post by glennr » Fri Sep 26, 2008 3:12 am

I recently had to merge some models which had vertex animations. This patch adds this feature.

The models to be merged need to have the same number of animation frames.

The patch is against rev 2497.

Code: Select all

Index: MeshMergeTool.cpp
===================================================================
--- MeshMergeTool.cpp	(revision 2497)
+++ MeshMergeTool.cpp	(working copy)
@@ -25,6 +25,7 @@
 #include <OgreSubMesh.h>
 #include <OgreAxisAlignedBox.h>
 #include <OgreSkeletonManager.h>
+#include <OgreAnimation.h>
 
 #include "OgreEnvironment.h"
 
@@ -149,7 +150,7 @@
         AxisAlignedBox totalBounds = AxisAlignedBox();
         for (std::vector< Ogre::MeshPtr >::iterator it = m_Meshes.begin();
              it != m_Meshes.end(); ++it)
-        {   
+        {
             print("Baking: adding submeshes for " + (*it)->getName(), V_HIGH);
 
             // insert all submeshes
@@ -161,10 +162,14 @@
                 // create submesh with correct name                
                 SubMesh* newsub;
                 if (name.length() == 0)
+				{
                     newsub = mp->createSubMesh();
-                else 
-                /// @todo check if a submesh with this name has been created before
-                    newsub = mp->createSubMesh(name);   
+				}
+                else
+				{
+					/// @todo check if a submesh with this name has been created before
+                    newsub = mp->createSubMesh(name);
+				}
 
                 newsub->useSharedVertices = sub->useSharedVertices;
 
@@ -190,8 +195,64 @@
 
                 newsub->setMaterialName(sub->getMaterialName());
 
+				// Add vertex animations for this submesh
+				Animation *anim = 0;
+				for(unsigned short i=0; i<(*it)->getNumAnimations(); i++)
+				{
+					anim = (*it)->getAnimation(i);
+
+					// get or create the animation for the new mesh
+					Animation *newanim;
+					if(mp->hasAnimation(anim->getName()))
+					{
+						newanim = mp->getAnimation(anim->getName());
+					}
+					else
+					{
+						newanim = mp->createAnimation(anim->getName(), anim->getLength());
+					}
+
+					print("Baking: adding vertex animation " + anim->getName() + " for " + (*it)->getName(), V_HIGH);
+
+					Animation::VertexTrackIterator vti=anim->getVertexTrackIterator();
+					while (vti.hasMoreElements())
+					{
+						VertexAnimationTrack *vt = vti.getNext();
+
+						// handle=0 targets the main mesh, handle i (where i>0) targets submesh i-1. 
+						// In this case there are only submeshes so index 0 will not be used.
+						unsigned short handle = mp->getNumSubMeshes();
+						VertexAnimationTrack* newvt = newanim->createVertexTrack(
+							handle,
+							vt->getAssociatedVertexData()->clone(),
+							vt->getAnimationType());
+
+						for(int keyFrameIndex=0; keyFrameIndex<vt->getNumKeyFrames(); keyFrameIndex++)
+						{
+							switch(vt->getAnimationType())
+							{
+							case VAT_MORPH:
+								{
+									// copy the keyframe vertex buffer
+									VertexMorphKeyFrame *kf = vt->getVertexMorphKeyFrame(keyFrameIndex);
+									VertexMorphKeyFrame *newkf = newvt->createVertexMorphKeyFrame(kf->getTime());
+									// This creates a ref to the buffer in the original model
+									// so don't delete it until the export is completed.
+									newkf->setVertexBuffer(kf->getVertexBuffer());
+								}
+								break;
+							case VAT_POSE:
+								{
+									/// @todo implement pose amination merge
+								}
+								break;
+							}
+						} // keyframe
+					} // track
+				} // animation
+
                 print("Baking: adding submesh '" + name + "'  with material " + sub->getMaterialName(), V_HIGH);
-            } 
+            } // submesh 
 
             // sharedvertices
             if ((*it)->sharedVertexData)
@@ -217,7 +278,8 @@
 
             // add bounds
             totalBounds.merge((*it)->getBounds());
-        }           
+        }
+
         mp->_setBounds(totalBounds);
 
         /// @todo merge submeshes with same material
@@ -279,3 +341,8 @@
                     VertexDeclaration* decl = newsub->vertexData->vertexDeclaration;
                     VertexBufferBinding* bind = newsub->vertexData->vertexBufferBinding;*/
 }
+
+
+			// Need to know how the submesh indices in the added mesh got mapped to the
+			// submeshes in the new mesh. Probably can use the mesh names.
+

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 Sep 30, 2008 9:04 am

Thank you very much glennr,

I will review the patch soon and apply it. I am currently relocating and don't have much time, so it may take a week or two.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
Contact:

Post by KungFooMasta » Sat Nov 22, 2008 9:38 pm

So I finally integrated MeshMagick into my project, and it was pretty easy to merge into my Visual MeshViewer. :D

My one suggestion is regarding this function:

Code: Select all

void TransformTool::processMeshFile(Ogre::String inFile, Ogre::String outFile)
{
    ...
    processSkeletonFile(mesh->getSkeletonName(), mesh->getSkeletonName(), false);
}
For example I serialize my beetle.mesh with a scale of .15 in x/y/z. MeshMagick does not do the same for beetle.skeleton because it does not consider the path. I pass in ..\data\media\models\Beetle.mesh but when looking for the skeleton (as shown in code above) is checks for Beetle.skeleton, and not ..\data\media\models\Beetle.skeleton.

The code above is just for the transform tool, I'm not very familiar with the code in depth. I'm sure there could be some updates to make sure the path to the model is preserved.

Here is my integration with MeshMagick :D :

Image

On a side note: I haven't seen any modifications to the repository for meshmagick since July (if I remember right), is this correct?
0 x
Creator of QuickGUI!

User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
Contact:

Post by KungFooMasta » Sat Nov 22, 2008 10:07 pm

In my case I can make the assumption that the .skeleton and .mesh file are in the same location, and have the same name. So for me, the fix was simply:

Code: Select all

        if (mFollowSkeletonLink && mesh->hasSkeleton())
        {
			inFile.replace(inFile.find(".mesh"),5,".skeleton");
			outFile.replace(outFile.find(".mesh"),5,".skeleton");

            // In this case keep file name and also keep already determined transform
            processSkeletonFile(inFile, outFile, false);
        }
0 x
Creator of QuickGUI!

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 Nov 23, 2008 12:06 am

Hi KungFooMasta, your editor looks very nice. I've just fixed the bug regarding the absolute file path. Fixed yet only in transform tool, but will work it into other tools as well. My solution should be generic enough. Tested yet only in Linux, so I'm waiting for tests in Windows.

Regarding your comment to the last update date, I absolutely feel committed to meshmagick and I will continue to fix bug and enhance it. In fact I have many local changes that are just not yet ready to be committed. I am now settled in my new place and am ready to continue my work on meshmagick, if only in a gentle pace. It is far from being abandoned. Next up are three pending patches committed by users.

Btw, nice blog you have there, I've added it to my feed reader. :)
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

compvis
Gremlin
Posts: 165
Joined: Wed Sep 10, 2008 6:14 am

Post by compvis » Fri Dec 05, 2008 7:26 am

haffax: how to use this tool, i downloaded your tool "MeshMagick.exe". When i opened it, only one DOS screen appearred and closed immediatly.

I don't know how to use this tool, could you help me ?

thanks
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Post by jacmoe » Fri Dec 05, 2008 7:59 am

It's part of the Ogre Command-line Tools download:
http://www.ogre3d.org/index.php?option= ... Itemid=133
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

compvis
Gremlin
Posts: 165
Joined: Wed Sep 10, 2008 6:14 am

Post by compvis » Fri Dec 05, 2008 10:04 am

Jacmoe: I mean, step by step to use Meshmagick tool, of couse, i have downloaded this tool with OgreXMLConveter, OgreMeshUpgrade, OgreMaterialUpgrade.

Could you assist me in doing ?

thanks
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 Dec 05, 2008 10:29 am

compviz, usage instructions are here: http://www.ogre3d.org/wiki/index.php/MeshMagick

But you need to learn how to use the command line first. (The "DOS screen")
There should be plenty tutorials in the net, like http://physiology.med.unc.edu/wwwMHMF/h ... fault.html or http://www.pcworld.com/article/121786/w ... ntrol.html
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

compvis
Gremlin
Posts: 165
Joined: Wed Sep 10, 2008 6:14 am

Post by compvis » Fri Dec 05, 2008 11:02 am

thank haffax,

but when i enterred: meshmagick info body.mesh then i got an error like

'meshmagick' is not recognized as an internal or external command, operable program or batch file.

in http://www.ogre3d.org/wiki/index.php/MeshMagick says:

Remark: It's recommendable to add the path of the Ogre command-line tools into the path environment variable (on Windows systems). So you can use meshmagick in every directory.

How can i add Ogre command-like tool into the path enviroment variable ?

Sorry for my trouble !

Thanks,



[/url]
0 x

Post Reply