I’m working on a plugin which there may be exceptions and there is a need to notify the user. As I understand from this information, gui message windows cannot be shown because of threading issues. But you can use Messages. As shown here and here. So the question is: how do I make this correct when using the GetContour or GVO method with ObjectData plugin? There is a proper way to "trigger Messages method" inside the GVO? I now is it possible to use c4d.MSG_DESCRIPTION_POSTSETPARAMETER but in this case exceptions may occurs in different scenarios that not depends from plugin GUI.
def GetContour(self, node, doc, lod, bt): # Checks if there is an active object if node is None: raise RuntimeError("node is None, should never happens, that means there is no generator.") try: spline = self.GenerateSpline(node, doc) except Exception as e: # Disable generator flag node[c4d.ID_BASEOBJECT_GENERATOR_FLAG] = False # Wrong way to show message ???? c4d.gui.MessageDialog(str(e)) # Return empty spline return c4d.BaseObject(c4d.Ospline) return spline