Page 1 of 1
MeshMagick for Ogre-Next
Posted: Wed Jun 05, 2024 7:56 pm
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
Re: MeshMagick for Ogre-Next
Posted: Wed Jun 05, 2024 8:52 pm
by dark_sylinc
AFAIK, there is not.
However MeshTool supports converting to v1.x format back and forth.
Re: MeshMagick for Ogre-Next
Posted: Wed Jun 05, 2024 9:10 pm
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.
Re: MeshMagick for Ogre-Next
Posted: Mon Jun 10, 2024 5:06 pm
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.
Re: MeshMagick for Ogre-Next
Posted: Mon Jun 10, 2024 8:20 pm
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...