Unicode path support for mesh_export

--HG--
branch : feature-material-editor
hg/feature/material-editor
kaetemi 9 years ago
parent ad549070e1
commit e72f40fd17

@ -24,6 +24,24 @@
#include <nel/3d/register_3d.h> #include <nel/3d/register_3d.h>
#include <nel/3d/scene.h> #include <nel/3d/scene.h>
#ifdef NL_OS_WINDOWS
#define main nlMain
int nlMain(int argc, char *argv[]);
static std::vector<std::string> nlArgs;
static std::vector<const char *> nlCArgs;
int wmain(int argc, wchar_t *argv[])
{
nlArgs.resize(argc);
nlCArgs.resize(argc);
for (int i = 0; i < argc; ++i)
{
nlArgs[i] = wideToUtf8(argv[i]);
nlCArgs[i] = nlArgs[i].c_str();
}
nlMain(argc, const_cast<char **>(&nlCArgs[0]));
}
#endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
NLMISC::CApplicationContext app; NLMISC::CApplicationContext app;

@ -312,12 +312,19 @@ int loadSceneMeta(CMeshUtilsContext &context)
int importSceneAssimp(CMeshUtilsContext &context) int importSceneAssimp(CMeshUtilsContext &context)
{ {
std::vector<char> memFile;
{
NLMISC::CIFile ifile(context.Settings.SourceFilePath);
memFile.resize(ifile.getFileSize());
ifile.serialBuffer((uint8 *)&memFile[0], memFile.size());
}
std::string fileExt = NLMISC::CFile::getExtension(context.Settings.SourceFilePath);
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(context.Settings.SourceFilePath, 0 const aiScene *scene = importer.ReadFileFromMemory(&memFile[0], memFile.size(), 0
| aiProcess_Triangulate | aiProcess_Triangulate
| aiProcess_ValidateDataStructure | aiProcess_ValidateDataStructure
| aiProcess_GenNormals // Or GenSmoothNormals? TODO: Validate smoothness between material boundaries! | aiProcess_GenNormals // Or GenSmoothNormals? TODO: Validate smoothness between material boundaries!
); // aiProcess_SplitLargeMeshes | aiProcess_LimitBoneWeights , fileExt.c_str()); // aiProcess_SplitLargeMeshes | aiProcess_LimitBoneWeights
if (!scene) if (!scene)
{ {
const char *errs = importer.GetErrorString(); const char *errs = importer.GetErrorString();

Loading…
Cancel
Save