MeshMagick for Ogre-Next Topic is solved

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Lax
Gnoll
Posts: 643
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 57

MeshMagick for Ogre-Next

Post by Lax »

Hi all,

has somebody a working version of MeshMagick for Ogre-Next?

I have the following situation:

I'm using for my NOWA-Engine Ogre-Next and inside a folder I want to use MeshMagick in order to manipulate Mesh Operation in my Design-Editor.
The MeshMagick is in its own folder with its own OgreMain.dll.

Here is the point: When I call the MeshMagick.exe e.g. via CreateProcess, or ShellExecute, or system(...) or whatever. The environment unfortunately always wants to link the Ogre-Next OgreMain.dll instead the one in the MeshMagick folder, which of course does not work.

Has anybody an Idea, how to force the MeshMagick.exe to link against its correct OgreMain.dll which sits in the same folder as MeshMagick?

If I call the MeshMagick via bat file via double click, the mesh operations do work...

Best Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5429
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1337

Re: MeshMagick for Ogre-Next

Post by dark_sylinc »

AFAIK, there is not.

However MeshTool supports converting to v1.x format back and forth.

Lax
Gnoll
Posts: 643
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 57

Re: MeshMagick for Ogre-Next

Post by Lax »

hm, thats too bad.

I need operations like -rotate 90/0/1/0 in order to rotate a mesh axis in model space.

dark_sylinc: Do you have an idea, how to call the MeshMagick.exe with suitabled OgreMain.dll, which sits in the same directory as the MeshMagick.exe?

I tried:

Code: Select all

// Setting the MeshMagick folder to path
std::string currentPath = getenv("PATH");
std::string newPath = applicationFolder + ";" + currentPath;
_putenv_s("PATH", newPath.c_str());

// Setting the dll directory to the folder of MeshMagick
if (!SetDllDirectory(applicationFolder.data()))
{
	std::cerr << "SetDllDirectory failed (" << GetLastError() << ")." << std::endl;
	return 1;
}

BOOL result = ::CreateProcess(
	meshMagickFilePathName.data(), // Path to executable
	tempParameters.data(),            // Command line
	NULL,            // Process handle not inheritable
	NULL,            // Thread handle not inheritable
	FALSE,           // Set handle inheritance to FALSE
	0,               // No creation flags
	NULL,            // Use parent's environment block
	applicationFolder.data(), // Set the working directory
	&startupInfo,             // Pointer to STARTUPINFO structure
	&processInformation);

But MeshMagick.exe is always called with the wrong OgreMain.dll. It uses the one from Ogre-Next from the NOWA-Engine debug folder.

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

User avatar
Zonder
Ogre Magi
Posts: 1172
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 76

Re: MeshMagick for Ogre-Next

Post by Zonder »

Why not just set the working directory to MeshMagicks directory. Then pass the full path on the input file instead?

If your just using transforms you could investigate pulling that part of the source code as well into your project from MeshMagick. Looks pretty self contained for the different tools.

There are 10 types of people in the world: Those who understand binary, and those who don't...
Lax
Gnoll
Posts: 643
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 57

Re: MeshMagick for Ogre-Next

Post by Lax »

Yes, maybe i will do that. Damn windows always wants to use the wring OgreMain.dll as soon as I shellexecute out from the engine.

If I start meshmagick via an own executable, it does work.

Damn windows...

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62