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
StormChild
Gnoblar
Posts: 9
Joined: Tue Mar 09, 2010 5:50 pm
Location: Dresden, Germany

Re: Official MeshMagick thread - now licensed under MIT

Post by StormChild »

spacegaier wrote:You can always just scale the SceneNode you attached the mesh to (more exactly the Entity using that mesh). MeshMagick is usually used to manipulate mesh data offline (at application creation time) and not e.g. while running a game, so basically for scenarios where you want to serialize/save the mesh afterwards.
Thank you for clearing that. I wanted to scale meshes coming from OgreMax (via Maya) according to their correct values since the "beastie" collision detection library seems to only take the mesh data into account and not the scale inherited from the scenenode. Ok, guess I have to try something else. :)
JDX_John
Gnome
Posts: 397
Joined: Sat Nov 08, 2008 1:59 pm
x 2

Re: Official MeshMagick thread - now licensed under MIT

Post by JDX_John »

haffax wrote:Hi PolyVox, in the old days Sinbad used to build meshmagick for Windows and provide the download. Unlike OgreXMLConverter, Meshmagick is not an official Ogre tool, so it was a bit of an extra service from his side. I'm afraid you have to build it yourself.
JDX_John wrote:By the way, it would be awesome if MeshMagick was included in Ogre tools in the same way as OgreXMLConverter, it's such a useful tool.
spacegaier wrote:
JDX_John wrote:By the way, it would be awesome if MeshMagick was included in Ogre tools in the same way as OgreXMLConverter, it's such a useful tool.
It is and was (I just uploaded anew version for Ogre 1.7.2).
You and haffax seem to be contradicting here... anyway I have the full 1.7.3 source and I don't see MeshMagick anywhere - OgreXMLConverter and MeshUpgrader are in /tools but MeshMagick isn't.
JDX_John
Gnome
Posts: 397
Joined: Sat Nov 08, 2008 1:59 pm
x 2

Re: Official MeshMagick thread - now licensed under MIT

Post by JDX_John »

Aha, I found a bundled OgreMeshMagick 1.7.2 download, not in the sources but on the Tools page. Awesome!
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: Official MeshMagick thread - now licensed under MIT

Post by spacegaier »

OgreMeshMagick is part of the Ogre Addons source not of the OgreMain source.
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
van4dium
Halfling
Posts: 40
Joined: Fri Jul 30, 2010 2:40 am
x 1

Re: Official MeshMagick thread - now licensed under MIT

Post by van4dium »

Assertion when running on Ogre 1.7.3+Linux.

Code: Select all

meshmagick: OgreSingleton.h:80: Ogre::Singleton<T>::Singleton() [with T = Ogre::LodStrategyManager]: Assertion `!ms_Singleton' failed.
Solved by changing line 86 of MmOgreEnvironment.cpp from :

Code: Select all

mLodStrategyMgr = new LodStrategyManager();
to :

Code: Select all

mLodStrategyMgr = LodStrategyManager::getSingletonPtr();
Harry Codder
Gnoblar
Posts: 2
Joined: Thu May 05, 2011 2:15 pm

Re: Official MeshMagick thread - now licensed under MIT

Post by Harry Codder »

Hi,

I fixed two things for my use of meshmagick so I thougth I would share them with you.
I believe I got the last source code from SVN so bear with me if this was already fixed elsewhere. :-P

First thing is for pose animations in meshes. Vertex were not reindexed so I made a small loop to do it.
It's probably not the best way to do it and it may not work in some case but it did the job for me.

Added

Code: Select all

// Pose
				if(mesh->getPoseCount())
				{
					print("    fixing poses...");
					
					for(size_t j = 0; j < mesh->getPoseCount(); j++)
					{
						Pose *pose = mesh->getPose(j);
						
						if(pose->getTarget() == i+1)
						{
							const Pose::VertexOffsetMap map = pose->getVertexOffsets();
							Pose::VertexOffsetIterator it = pose->getVertexOffsetIterator();

							for(Pose::VertexOffsetMap::const_iterator it = map.begin(); it != map.end(); it++)
							{
								size_t index = (*it).first;
								Vector3 xyz = (*it).second;
					
								_ASSERTE(index < mIndexRemap.size());
								{
									IndexInfo indexInfo = mIndexRemap[index];
									
									pose->removeVertex(index);
									pose->addVertex(indexInfo.targetIndex, xyz);
								}
							}
						}
					}
				}
in MmOptimiseTool.cpp at line 263. This is in the "Dedicated geometry" loop after the submesh dedicated vertex data optmisation.

The second fixes a bug with the tangent comparison.
The conditions in the OptimiseTool::UniqueVertexLess::less method were inverted.

Changed

Code: Select all

bool OptimiseTool::UniqueVertexLess::equals(
		const Vector4& a, const Vector4& b, Real tolerance) const
	{
		// no built-in position equals
		for (int i = 0; i < 4; ++i)
		{
			if (Math::RealEqual(a[i], b[i], tolerance))
				return true;
		}
		return false;
	}
to

Code: Select all

bool OptimiseTool::UniqueVertexLess::equals(
		const Vector4& a, const Vector4& b, Real tolerance) const
	{
		// no built-in position equals
		for (int i = 0; i < 4; ++i)
		{
			if (!Math::RealEqual(a[i], b[i], tolerance))
				return false;
		}
		return true;
	}
in MmOptimiseTool.cpp from line 813 to 823.

Hope this can help somebody. :-)
IcetheCold
Gnoblar
Posts: 17
Joined: Sun Aug 14, 2011 2:53 pm

Re: Official MeshMagick thread - now licensed under MIT

Post by IcetheCold »

So confused>< lol I'm trying to install it on linux(linuxmint11) and the build went fine, but when I go root(with either "sudo" or "su -" and make install, I get this error, which...I'm assuming I must have screwed something up...

Code: Select all

THE-VAGABLEND meshmagick # make install
Making install in include
make[1]: Entering directory `/home/ice/Downloads/meshmagick/meshmagick/include'
make[2]: Entering directory `/home/ice/Downloads/meshmagick/meshmagick/include'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include/meshmagick" || /bin/mkdir -p "/usr/local/include/meshmagick"
 /usr/bin/install -c -m 644 MeshMagick.h MeshMagickPrerequisites.h MmEditableBone.h MmEditableMesh.h MmEditableSkeleton.h MmInfoToolFactory.h MmInfoTool.h MmMeshMergeToolFactory.h MmMeshMergeTool.h MmMeshUtils.h MmOgreEnvironment.h MmOptimiseTool.h MmOptimiseToolFactory.h MmOptionsParser.h MmRenameToolFactory.h MmRenameTool.h MmStatefulMeshSerializer.h MmStatefulSkeletonSerializer.h MmToolFactory.h MmTool.h MmToolManager.h MmToolUtils.h MmTransformToolFactory.h MmTransformTool.h MmStatefulMeshSerializer.h MmStatefulSkeletonSerializer.h '/usr/local/include/meshmagick'
/usr/bin/install: will not overwrite just-created `/usr/local/include/meshmagick/MmStatefulMeshSerializer.h' with `MmStatefulMeshSerializer.h'
/usr/bin/install: will not overwrite just-created `/usr/local/include/meshmagick/MmStatefulSkeletonSerializer.h' with `MmStatefulSkeletonSerializer.h'
make[2]: *** [install-pkgincludeHEADERS] Error 1
make[2]: Leaving directory `/home/ice/Downloads/meshmagick/meshmagick/include'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/ice/Downloads/meshmagick/meshmagick/include'
make: *** [install-recursive] Error 1
does anyone have this built on linux? I mean I saw like 3 posts that even mentioned linux...

Thanks :)
-ice
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: Official MeshMagick thread - now licensed under MIT

Post by spacegaier »

@Harry Coder: Can you please put that on one of our trackers (either bug or patch)? In both cases either link here or add the source directly. Thanks!
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
User avatar
Waruck
Goblin
Posts: 210
Joined: Mon Dec 12, 2011 12:52 pm
Location: Germany
x 34

Re: Official MeshMagick thread - now licensed under MIT

Post by Waruck »

I tried to built this with Ogre 1.8. However I run into a problem:

Code: Select all

MmOptimiseTool.h(153): error C2039: 'LODFaceList': Is no member of 'Ogre::ProgressiveMesh'
I checked OgreProgressiveMesh.h and indeed the typedef LODFaceList is gone in 1.8 (or I can't find it).
Any fix fot this?
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: Official MeshMagick thread - now licensed under MIT

Post by Kojack »

ogresubmesh.h has the public members:

Code: Select all

		typedef vector<IndexData*>::type LODFaceList;
		LODFaceList mLodFaceList;
while ogreprogressivemesh.h has the protected member:

Code: Select all

		vector<IndexData*>::type mLodFaceList;
Checking the history... looks like the LODFaceList define was removed from ogreprogressivemesh.h in march last year.
I'll try giving it a build when I get a chance, I'm sure I've built meshmagick since then without problems.

I also need to look at it for a possible skeleton bug, I used it to rotate, recentre and scale a mesh, the animations were broken afterwards.
User avatar
Waruck
Goblin
Posts: 210
Joined: Mon Dec 12, 2011 12:52 pm
Location: Germany
x 34

Re: Official MeshMagick thread - now licensed under MIT

Post by Waruck »

next error: MmStatefulSkeletonSerializer.cpp Line 80:

Code: Select all

exportSkeleton(mSkeleton.getPointer(),name, endianMode);
The compiler is expecting a SkeletonVersion as 3rd parameter. I just copyed the standard value SKELETON_VERSION_LATEST and everything compiled. Hope it also works.. ^^
Shadowrom
Gnoblar
Posts: 2
Joined: Wed Apr 04, 2012 7:50 pm

Re: Official MeshMagick thread - now licensed under MIT

Post by Shadowrom »

Hi there,

i'm new to Ogre. But from my point of view there is some easy fix to this:

in MmOptimiseTool.h do the following:
- Insert after the includes:

Code: Select all

#include <OgreProgressiveMesh.h>
- Replace:

Code: Select all

void fixLOD(Ogre::ProgressiveMesh::LODFaceList lodFaces);
with:

Code: Select all

void fixLOD(Ogre::vector<Ogre::IndexData*>::type lodFaces);
in MmOptimiseTool.cpp edit the following code:

Code: Select all

//---------------------------------------------------------------------
	void OptimiseTool::fixLOD(ProgressiveMesh::LODFaceList lodFaces)
	{
		for (ProgressiveMesh::LODFaceList::iterator l = lodFaces.begin();
			l != lodFaces.end(); ++l)
		{
			IndexData* idata = *l;
			print("    fixing LOD...");
			remapIndexes(idata);
		}

	}
to:

Code: Select all

void OptimiseTool::fixLOD(Ogre::vector<Ogre::IndexData*>::type lodFaces)
	{
		for (Ogre::vector<Ogre::IndexData*>::type::iterator l = lodFaces.begin();
			l != lodFaces.end(); ++l)
		{
			IndexData* idata = *l;
			print("    fixing LOD...");
			remapIndexes(idata);
		}

	}
in MeshMagick.cpp edit line 32:

Code: Select all

template<> meshmagick::MeshMagick* Ogre::Singleton<meshmagick::MeshMagick>::ms_Singleton = NULL;
change to:

Code: Select all

template<> meshmagick::MeshMagick* Ogre::Singleton<meshmagick::MeshMagick>::msSingleton = NULL;
in MmOgreEnvironment.cpp edit line 35:

Code: Select all

template<> meshmagick::OgreEnvironment* Singleton<meshmagick::OgreEnvironment>::ms_Singleton = NULL;
change to:

Code: Select all

template<> meshmagick::OgreEnvironment* Singleton<meshmagick::OgreEnvironment>::msSingleton = NULL;
In MmStatefulSkeletonSerializer.cpp edit line 80:

Code: Select all

exportSkeleton(mSkeleton.getPointer(), name, endianMode);
change to:

Code: Select all

exportSkeleton(mSkeleton.getPointer(), name,Ogre::SKELETON_VERSION_LATEST, endianMode);
This should be it. MeshMagick compiles on my system now.

[EDIT] I just integrated these changes to MeshMagick into ogitor 0.5 and compilation went well.[/EDIT]
FlorianGeorge
Halfling
Posts: 86
Joined: Tue Sep 01, 2009 7:15 pm
Location: Cologne, Germany
x 4

Re: Official MeshMagick thread - now licensed under MIT

Post by FlorianGeorge »

spacegaier wrote:OgreMeshMagick is part of the Ogre Addons source not of the OgreMain source.
The last commit for MeshMagick was April 15, 2010.

Considering people are actively posting patches and even start double-posting fixes
My Poses re-map fix May 10 2011: http://www.ogre3d.org/forums/viewtopic. ... 42#p427642
Harry Codders Poses re-map fix Jan 09 2012: http://www.ogre3d.org/forums/viewtopic. ... 50#p448068
, maybe it could indeed be moved into the main repository so we can submit our patches with a higher chance of them getting accepted to the Main Patch Tracking System?
simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm
x 3

Re: Official MeshMagick thread - now licensed under MIT

Post by simedj »

I want to build MeshMagick for Ogre 1.8. I've checked out the source but CMake fails as it cannot find Ogre. From FindOgre.cmake:
# - Try to find OGRE
# If you have multiple versions of Ogre installed, use the CMake or
# the environment variable OGRE_HOME to point to the path where the
# desired Ogre version can be found.
I set an OGRE_HOME variable (it shows up in new cmd window) but still CMake fails
CMake Error at cmake/FindPkgMacros.cmake:112 (message):
Required library OGRE not found!
Where exactly is this variable supposed to be pointing? I even tried putting MeshMagick inside the Ogre source dir in the hope it might manage the tremendously difficult job of noticing Ogre was JUST THERE, but of course CMake is rarely that helpful!

edit: I changed my OGRE_HOME not to point to my Ogre1.8 dir, but my Ogre1.8 build dir. Now CMake is finding and setting a bunch of Ogre vars, but still telling me it can't find Ogre.
Does MeshMagick CMake only work against an Ogre SDK, not a regular Ogre directory?
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.
User avatar
saejox
Goblin
Posts: 260
Joined: Tue Oct 25, 2011 1:07 am
x 36

Re: Official MeshMagick thread - now licensed under MIT

Post by saejox »

I packed my 1.9 tools.
Includes upgrader, xmlconverter, meshmagick
here https://docs.google.com/file/d/0B3MVwL3 ... NRblU/edit

someone might need it.
Nimet - Advanced Ogre3D Mesh/dotScene Viewer
asPEEK - Remote Angelscript debugger with html interface
ogreHTML - HTML5 user interfaces in Ogre
simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm
x 3

Re: Official MeshMagick thread - now licensed under MIT

Post by simedj »

Neat, thanks. Are 1.9 meshes compatible with 1.8... and since 1.8 doesn't seem compatible with MeshMagick trunk what were your tweaks (assuming 1.9 didn't fix the problem)?
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.
User avatar
saejox
Goblin
Posts: 260
Joined: Tue Oct 25, 2011 1:07 am
x 36

Re: Official MeshMagick thread - now licensed under MIT

Post by saejox »

simedj wrote:Neat, thanks. Are 1.9 meshes compatible with 1.8... and since 1.8 doesn't seem compatible with MeshMagick trunk what were your tweaks (assuming 1.9 didn't fix the problem)?
I'm using meshmagick to rotate and scale. Works great with 1.9.
There are only some compile errors to be fixed. Very easy stuff.
I just noticed, Shadowrom's post. That's pretty spot on.
Nimet - Advanced Ogre3D Mesh/dotScene Viewer
asPEEK - Remote Angelscript debugger with html interface
ogreHTML - HTML5 user interfaces in Ogre
glennr
Greenskin
Posts: 126
Joined: Thu Jun 05, 2008 3:26 am
Location: Thames, New Zealand
x 9

Re: Official MeshMagick thread - now licensed under MIT

Post by glennr »

simedj wrote:I want to build MeshMagick for Ogre 1.8. I've checked out the source but CMake fails as it cannot find Ogre. From FindOgre.cmake:
# - Try to find OGRE
# If you have multiple versions of Ogre installed, use the CMake or
# the environment variable OGRE_HOME to point to the path where the
# desired Ogre version can be found.
I set an OGRE_HOME variable (it shows up in new cmd window) but still CMake fails
CMake Error at cmake/FindPkgMacros.cmake:112 (message):
Required library OGRE not found!
Where exactly is this variable supposed to be pointing? I even tried putting MeshMagick inside the Ogre source dir in the hope it might manage the tremendously difficult job of noticing Ogre was JUST THERE, but of course CMake is rarely that helpful!

edit: I changed my OGRE_HOME not to point to my Ogre1.8 dir, but my Ogre1.8 build dir. Now CMake is finding and setting a bunch of Ogre vars, but still telling me it can't find Ogre.
Does MeshMagick CMake only work against an Ogre SDK, not a regular Ogre directory?
If you want to find out what it's doing you need to look at the cmake/FindOGRE.cmake script.

I have it building (r2986 + fixes) on Windows (VS 2010). I'm using Ogre 1.8.1 that was built from source and I had to define OGRE_SOURCE and OGRE_BUILD in CMakeLists.txt. BTW maintainers, this should be mentioned in the instructional comment at the beginning of FindOGRE.cmake.

Code: Select all

set(OGRE_SOURCE "/path/to/ogre-1.8")
set(OGRE_BUILD  "/path/to/ogre-1.8-build")
find_package(OGRE REQUIRED)
Also some changes were required to get it to build with 1.8. I think they are mentioned in this thread somewhere. Someone with write permission really should fix that.
shenjoku
Gremlin
Posts: 193
Joined: Sat Aug 06, 2011 11:02 pm
x 6

Re: Official MeshMagick thread - now licensed under MIT

Post by shenjoku »

Is there a version of this that is built with the latest Ogre (1.9 stable)? I checked out the source but it doesn't build since it looks like the source hasn't been updated to work with 1.9 since it's using a lot of types and things that have been replaced or renamed.

EDIT: Never mind. It was actually fairly easy to modify the code to get it to build with 1.9. Hopefully it still works. I guess I'll find out. I'd be happy to submit a patch somewhere to get this committed, I'm unsure of where to do that though.
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: Official MeshMagick thread - now licensed under MIT

Post by spacegaier »

shenjoku wrote:I'd be happy to submit a patch somewhere to get this committed, I'm unsure of where to do that though.
See http://www.ogre3d.org/developers/submit-patch -> basically a Hg pull-request is the easiest for us to merge it in and therefore the preferred option.
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
shenjoku
Gremlin
Posts: 193
Joined: Sat Aug 06, 2011 11:02 pm
x 6

Re: Official MeshMagick thread - now licensed under MIT

Post by shenjoku »

How would you do that for MeshMagick though? It's not part of the main Ogre repository.
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: Official MeshMagick thread - now licensed under MIT

Post by spacegaier »

shenjoku wrote:How would you do that for MeshMagick though? It's not part of the main Ogre repository.
Sorry, my bad. I was thinking of the official Ogre tools from the main repo. In the case of MeshMagick an regular SVN patch should help. And then create a JIRA ticket for it and attach the patch (you could in theory also add it to the addons SVN tracker, but it will most likely be buried there, hence go for JIRA)..
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Official MeshMagick thread - now licensed under MIT

Post by masterfalcon »

Who manages that repo though? Do we?
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: Official MeshMagick thread - now licensed under MIT

Post by spacegaier »

masterfalcon wrote:Who manages that repo though? Do we?
As far as I know, it's a mixture. Some of us team members have global access and other community members / maintainers have access to certain sub areas for the projects they (used to) maintain. Not sure if there is an active MeshMagick maintainer. I think Haffax used to have that position, but he is gone, so back to us as the team I guess to apply the patch.
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
shenjoku
Gremlin
Posts: 193
Joined: Sat Aug 06, 2011 11:02 pm
x 6

Re: Official MeshMagick thread - now licensed under MIT

Post by shenjoku »

Well I added the issue with the patch file attached to it. So hopefully that will do the trick.
Post Reply