Un-commenting Message function of python tag results in RuntimeError
-
Hi guys,
I don't know if this any news but I think I found a bug in
def message(id: int, data: object) -> bool:
of the python tag. Un-commenting this method results in the following error.Traceback (most recent call last): File "Python", line 20, in message RuntimeError: super(): __class__ cell not found
I observed this in S26 if that helps.
Cheers,
Sebastianfrom typing import Optional import c4d doc: c4d.documents.BaseDocument # The document evaluating this tag op: c4d.BaseTag # The Python scripting tag flags: int # c4d.EXECUTIONFLAGS priority: int # c4d.EXECUTIONPRIORITY tp: Optional[c4d.modules.thinkingparticles.TP_MasterSystem] # Particle system thread: Optional[c4d.threading.BaseThread] # The thread executing this tag def main() -> None: # Called when the tag is executed. It can be called multiple time per frame. Similar to TagData.Execute. # Write your code here pass def message(id: int, data: object) -> bool: # Called when the tag receives messages. Similar to TagData.Message. # Write your code here return super().Message(id, data) """ def draw(bd: c4d.BaseDraw) -> bool: # Called to display some visual element in the viewport. Similar to TagData.Draw. # Write your code here return True """
-
Hi the issue is that normally when you implement a tag you are within a class and more especially a TagData which inherit from a NodeData therefor you can call the method "super" without issue because there is indeed a class. But in this case there is no TagData instance, so for the moment there is no good way to propagate the message and you should return True.
And I know this is the default code, this will be looked at and fixed within a future version.
Cheers,
Maxime. -
Hi @m_adam,
alrighty, good to know that this will be looked into and eventually get fixed.
Yes, I remember I returned
True
in the past. In the python tag as well as in theTagData
equivalent. As returning super didn't work.Thanks for the information anyway.
Cheers,
Sebastian