+ support of Python feature classes without an execute() method
+ if execute() method of Python feature is missing or if it returns false call the execute() method of the C++ feature + fix SketchObjectPython
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <App/FeaturePythonPyImp.h>
|
||||
#include <Base/Writer.h>
|
||||
#include <Base/Reader.h>
|
||||
#include <Base/Tools.h>
|
||||
@@ -4016,6 +4017,13 @@ PROPERTY_SOURCE_TEMPLATE(Sketcher::SketchObjectPython, Sketcher::SketchObject)
|
||||
template<> const char* Sketcher::SketchObjectPython::getViewProviderName(void) const {
|
||||
return "SketcherGui::ViewProviderPython";
|
||||
}
|
||||
template<> PyObject* Sketcher::SketchObjectPython::getPyObject(void) {
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new FeaturePythonPyT<SketchObjectPy>(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
/// @endcond
|
||||
|
||||
// explicit template instantiation
|
||||
|
||||
Reference in New Issue
Block a user