On 10/10/2014 at 14:34, xxxxxxxx wrote:
While polling the slider's value with a class member variable should work fine.
I just remembered another way I delt with this kind of thing a long time ago in one of my C++ plugins.
This will grab the gizmo's data from the tag while the LMB is being held down.
The "break" will stop it from running when the LMB is not being pressed.
def Message(self, op, type, data) :
doc = op.GetDocument()
msg = c4d.BaseContainer()
while c4d.gui.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, msg) :
if msg[c4d.BFM_INPUT_VALUE] == 0: break
if msg[c4d.BFM_INPUT_VALUE] == 1:
#This value can be sent to a class member variable for usage in the other overriden plugin methods
print op[c4d.MY_SLIDER]
break
Probably overkill for your needs. But I thought I'd mention it.
-ScottA