Browse Source

Merge remote-tracking branch 'origin/release/1.9.x'

rdb 9 years ago
parent
commit
29411f5e14

+ 2 - 0
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
 * Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons
 * Add keyword argument support to make() methods such as Shader.make()
 * Add keyword argument support to make() methods such as Shader.make()
 * Fix compilation errors with Bullet 2.84
 * 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  ------------------------
 ------------------------  RELEASE 1.9.2  ------------------------
 
 

+ 1 - 1
dtool/src/interrogate/interfaceMakerPythonNative.cxx

@@ -2344,7 +2344,7 @@ write_module_class(ostream &out, Object *obj) {
 
 
           string expected_params;
           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";
           out << "    PyObject *args = PyTuple_Pack(2, arg, arg2);\n";
           write_function_forset(out, two_param_remaps, 2, 2, expected_params, 4,
           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);
                                 true, true, AT_varargs, RF_pyobject | RF_err_null | RF_decref_args, true);

+ 7 - 4
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
   // object whose constructor we should call (e.g.  this), and the arguments
   // necessary to reconstruct this object.
   // necessary to reconstruct this object.
 
 
-  PyObject *this_class = PyObject_Type(self);
+  PyObject *this_class = (PyObject *)self->ob_type;
   if (this_class == NULL) {
   if (this_class == NULL) {
     return 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
   // Since a NodePathCollection is itself an iterator, we can simply pass it
   // as the fourth tuple component.
   // 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);
 }
 }
 
 
 /**
 /**

+ 15 - 4
pandatool/src/maxprogs/maxEggImport.cxx

@@ -178,7 +178,8 @@ static INT_PTR CALLBACK ImportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
   return TRUE;
   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.
   // Prompt the user with our dialogbox.
   if (!DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_IMPORT_DLG),
   if (!DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_IMPORT_DLG),
                       i->GetMAXHWnd(), ImportDlgProc, (LPARAM)this)) {
                       i->GetMAXHWnd(), ImportDlgProc, (LPARAM)this)) {
@@ -187,13 +188,23 @@ int MaxEggImporter::DoImport(const TCHAR *name,ImpInterface *ii,Interface *i, BO
 
 
   std::ostringstream log;
   std::ostringstream log;
   Notify::ptr()->set_ostream_ptr(&log, false);
   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);
   bool ok = MaxLoadEggFile(name, _merge ? true:false, _importmodel ? true:false, _importanim ? true:false);
+#endif
+
   string txt = log.str();
   string txt = log.str();
   if (txt != "") {
   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);
   Notify::ptr()->set_ostream_ptr(NULL, false);
   return 1;
   return 1;
 }
 }