I have a command plugin with a slider to move the distance between planes.
If the user presses ALT and move the slider, I update the position of place realtime.
Input and ALT checking is done with below code.
Checking for ALT is oke, but when there is no parent and a message is given to the user, it looks like the GetInputState() is still running and the slider is moved.
How can I 'stop' the GetInputState() in case of an error?
I hope I make myself clear.
if (id == UI_SPACING):
self.Spacing = self.GetInt32(UI_SPACING)
msg=c4d.BaseContainer()
if c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.KEY_ALT, msg):
if msg[c4d.BFM_INPUT_VALUE]: # only dynamic update if Alt is pressed
parent = doc.GetActiveObject()
if (not(parent)):
gui.MessageDialog('Please select a cloner!')
return True
else:
self.DoHorizontalSpacing(parent, self.Spacing)
return True
`