compile 3d max2014 plugin ,error

1、pandatool/src/maxegg/maxEggLoader.cxx(282)

#ifdef _UNICODE
TCHAR* wname [1024];
wname[1023] = 0;
mbstowcs(wname, _egg_joint->get_name().c_str(), 1023);
_node->SetName(wname);
#else

TCHAR* wname [1024]; —> TCHAR wname [1024];

2、pandatool/src/maxegg/maxEggLoader.cxx line 455
result->_node->SetName(TSTR(name.c_str())); -->

#ifdef _UNICODE
TCHAR wname [1024];
wname[1023] = 0;
mbstowcs(wname, name.c_str(), 1023);
result->_node->SetName(wname);
#else
result->_node->SetName((char*) name.c_str());
#endif

3、 pandatool\src\maxegg\maxToEggConverter.cxx line 568

string name = max_node->GetName();

void MaxToEggConverter::
make_polyset(INode *max_node, Mesh *mesh,

string node_name = max_node->GetName();

Thanks. Are these the only errors that occur? Does it compile with these changes? I remember that there was a lot of trouble compiling with the unicode version of 3ds max, and I eventually gave up.

pandatool/src/maxprogs/maxEggImport.cxx

@@ -185,16 +185,45 @@ int MaxEggImporter::DoImport(const TCHAR *name,ImpInterface *ii,Interface *i, BO
return 1;
}

std::ostringstream log;
Notify::ptr()->set_ostream_ptr(&log, false);

  • bool ok = MaxLoadEggFile(name, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false);
  • bool ok=false;
  • #ifdef _UNICODE
  •   char sname[1024];
    
  •   sname[1023]=0;
    
  •   wcstombs( sname, name, 1023 );
    
  •   ok = MaxLoadEggFile(sname, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false);
    
  • #else
  •   ok = MaxLoadEggFile(name, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false);
    
  • #endif
  • //bool ok = MaxLoadEggFile(name, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false);
    string txt = log.str();
  • if (txt != “”) {
  • MessageBox(NULL, txt.c_str(), “Panda3D Importer”, MB_OK);
  • } else {
  • if (!ok) MessageBox(NULL, “Import Failed, unknown reason\n”, “Panda3D Importer”, MB_OK);
  • if (txt != “”)
  • {
  • #ifdef _UNICODE
    
  •   	TCHAR wname [1024];
    
  •   	wname[1023] = 0;
    
  •   	mbstowcs(wname, txt.c_str(), 1023);
    
  •   	MessageBox(NULL, wname, L"Panda3D Importer", MB_OK);
    
  • #else
    
  •   	MessageBox(NULL, txt.c_str(), "Panda3D Importer", MB_OK);
    
  • #endif
    
  • }
  • else
  • {
  • if (!ok)
  • {
  •   #ifdef _UNICODE
    
  •   	MessageBox(NULL, L"Import Failed, unknown reason\n", L"Panda3D Importer", MB_OK);
    
  •   #else
    
  •   	MessageBox(NULL, "Import Failed, unknown reason\n", "Panda3D Importer", MB_OK);
    
  • #endif
    
  • }
    }
    Notify::ptr()->set_ostream_ptr(NULL, false);
    return 1;
    }

with these changes, I compile 3D Max 2014 import and export plugin ok,X64

Thanks very much! I’ve committed a slight modification of your changes. Please let me know if it now works without needing further changes to the stock Panda source.