Hello,
I have an Integer control that I want to use for presets in my ObjectData plugin. I'm currently storing a variable _preset
in my __init__
override and then checking for a different value when I detect a MSG_DESCRIPTION_USERINTERACTION_END
message in my Message
override. It works, but it is currently checking this value with every control change since the UserInteraction Messages do not pass IDs (data
is None) and there is no Command method as in a GeDialog. I have a lot of controls, so for efficiency, how can I only check this when the control ID is the Preset Integer in my ObjectData plugin? Thank you!
def __init__(self, *args):
super(Demo, self).__init__(*args)
self._preset = 1
def Message(self, node, type, data):
if type == c4d.MSG_DESCRIPTION_USERINTERACTION_END:
if self._preset != node[c4d.DEMO_PRESETS]:
self._preset = node[c4d.DEMO_PRESETS]
self.ApplyPreset()