I am trying to make a custom item that works in the same way as a polygon object, but with more options. These options would be simple things, like showing certain parameters in the UI that depend on other parameters and the points and polygons of the object itself, but the problem is creating the object.
I found out that the OBJECT_POLYGONOBJECT tag in RegisterObjectData makes C4D create a PolygonObject, instead of a BaseObject, so one could apply all the PolygonObject methods (like GetAllPolygons or GetAllPoints) to the custom object without getting an error, but with no result. I started with ResizeObject, but the size wouldn't change. SetPoint returns index out of range since the size is 0, and GetAllPoints/Polygons always returns an empty list. Tried to use these methods in ObjectData.Init (using node as the object) and ObjectData.GetVirtualObjects (using op), but the object just refuses to change size without returning any error. Also tried creating a polygon object in GetVirtualObjects, manually giving it points and polygons, and it displays if OBJECT_GENERATOR is set, but when entering point/edge/polygon mode it disappears from the view and can't be edited.
I couldn't find any Python examples for this, and the only thing I found for C++ (which I don't know too much about), was the Lattice Plane Modifier plugin (using OBJECT_POINTOBJECT, not polygon), where it seems to ResizeObject and access the points with GetPointW and replace them with no problem. Also browsed the SDK documentation for ObjectData and NodeData and didn't see anything useful, except maybe ObjectData.Draw, but I don't know how it should be used.
My goal is to make multiple object types that can be edited by the user with the same tools as a polygon object, andthen giving them different icons and displaying different parameters in the UI depending on the object type. Is there a way to do this?