diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index a05c4487e4..157a20b2bf 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -45,6 +45,8 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons * Add keyword argument support to make() methods such as Shader.make() * Fix compilation errors with Bullet 2.84 +* Fix exception when trying to pickle NodePathCollection objects +* Fix error when trying to raise vectors to a power ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 46073abee3..d4eea3fdff 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -2344,7 +2344,7 @@ write_module_class(ostream &out, Object *obj) { string expected_params; - out << " if (arg2 != (PyObject *)NULL) {\n"; + out << " if (arg2 != (PyObject *)NULL && arg2 != Py_None) {\n"; out << " PyObject *args = PyTuple_Pack(2, arg, arg2);\n"; write_function_forset(out, two_param_remaps, 2, 2, expected_params, 4, true, true, AT_varargs, RF_pyobject | RF_err_null | RF_decref_args, true); diff --git a/panda/src/pgraph/nodePathCollection_ext.cxx b/panda/src/pgraph/nodePathCollection_ext.cxx index 28b5ed5255..c6f17b7aa4 100644 --- a/panda/src/pgraph/nodePathCollection_ext.cxx +++ b/panda/src/pgraph/nodePathCollection_ext.cxx @@ -76,16 +76,19 @@ __reduce__(PyObject *self) const { // object whose constructor we should call (e.g. this), and the arguments // necessary to reconstruct this object. - PyObject *this_class = PyObject_Type(self); + PyObject *this_class = (PyObject *)self->ob_type; if (this_class == NULL) { return NULL; } + PyObject *self_iter = PyObject_GetIter(self); + if (self_iter == NULL) { + return NULL; + } + // Since a NodePathCollection is itself an iterator, we can simply pass it // as the fourth tuple component. - PyObject *result = Py_BuildValue("(O()OO)", this_class, Py_None, self); - Py_DECREF(this_class); - return result; + return Py_BuildValue("(O()ON)", this_class, Py_None, self_iter); } /** diff --git a/pandatool/src/maxprogs/maxEggImport.cxx b/pandatool/src/maxprogs/maxEggImport.cxx index 52a9cd369f..8565a612b4 100644 --- a/pandatool/src/maxprogs/maxEggImport.cxx +++ b/pandatool/src/maxprogs/maxEggImport.cxx @@ -178,7 +178,8 @@ static INT_PTR CALLBACK ImportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM return TRUE; } -int MaxEggImporter::DoImport(const TCHAR *name,ImpInterface *ii,Interface *i, BOOL suppressPrompts) { +int MaxEggImporter:: +DoImport(const TCHAR *name, ImpInterface *ii, Interface *i, BOOL suppressPrompts) { // Prompt the user with our dialogbox. if (!DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_IMPORT_DLG), i->GetMAXHWnd(), ImportDlgProc, (LPARAM)this)) { @@ -187,13 +188,23 @@ int MaxEggImporter::DoImport(const TCHAR *name,ImpInterface *ii,Interface *i, BO std::ostringstream log; Notify::ptr()->set_ostream_ptr(&log, false); + +#ifdef _UNICODE + char sname[2048]; + sname[2047] = 0; + wcstombs(sname, name, 2047); + bool ok = MaxLoadEggFile(sname, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false); +#else bool ok = MaxLoadEggFile(name, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false); +#endif + 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); + MessageBoxA(NULL, txt.c_str(), "Panda3D Importer", MB_OK); + } else if (!ok) { + MessageBoxA(NULL, "Import Failed, unknown reason\n", "Panda3D Importer", MB_OK); } + Notify::ptr()->set_ostream_ptr(NULL, false); return 1; }