move Placement.isNull to Placement.isIdentity

add isNull for backward compatibility
This commit is contained in:
wmayer
2017-12-13 19:13:18 +01:00
parent 7991e1ae7e
commit 3fb789cf7c
3 changed files with 18 additions and 6 deletions

View File

@@ -247,8 +247,20 @@ void PlacementPy::setRotation(Py::Object arg)
throw Py::TypeError("either Rotation or tuple of four floats expected");
}
PyObject *PlacementPy::getCustomAttributes(const char* /*attr*/) const
PyObject *PlacementPy::getCustomAttributes(const char* attr) const
{
// for backward compatibility
if (strcmp(attr, "isNull") == 0) {
PyObject *w, *res;
#if PY_MAJOR_VERSION >= 3
w = PyUnicode_InternFromString("isIdentity");
#else
w = PyString_InternFromString("isIdentity");
#endif
res = PyObject_GenericGetAttr(const_cast<PlacementPy *>(this), w);
Py_XDECREF(w);
return res;
}
return 0;
}