I am python wrapping a vtk class using the new way of doing it (not vtk_wrap_python3) as follows -
vtk_module_wrap_python(
MODULES VTK::ModuleName
SOABI “{Python{VTK_PYTHON_VERSION}_SOABI}”
…
)
The class derives from vtkObject. It builds fine, but we end up with an undefined symbol for: PyvtkObject_ClassNew
This is because we are unable to find the vtkObject superclass in the hierarchy and attempt to new the object as follows in vtkWrapPythonClass.c
vtkWrapPython_GenerateObjectNew(
…
if (!supermodule) /* superclass is in the same module */
{
fprintf(fp, " pytype->tp_base = (PyTypeObject )Py%s_ClassNew();\n\n", superclassname);
}
else / superclass is in a different module */
{
fprintf(
fp, " pytype->tp_base = vtkPythonUtil::FindClassTypeObject("%s");\n\n", superclassname);
}
…
How do I tell the hierarchy that this should be treated as a supermodule ?
If I manually replace the PyvtkObject_ClassNew in the wrapped cxx with vtkPythonUtil::FindClassTypeObject, all is good.
What’s the way to fix this ? May we inject to some comment devilry in the superclass (like long ago) ?
Thanks
Karthik