On 02/06/2014 at 02:36, xxxxxxxx wrote:
I created 4 buttons and want when the 1 button is pressed the other 3 will be 0 or False.
I use this piece of code:
import c4d
from c4d import gui
def main() :
obj = doc.SearchObject("Null")
if obj[c4d.ID_USERDATA,1] == 1:
obj[c4d.ID_USERDATA,1] = 1
obj[c4d.ID_USERDATA,2] = 0
obj[c4d.ID_USERDATA,3] = 0
obj[c4d.ID_USERDATA,4] = 0
if obj[c4d.ID_USERDATA,2] == 1:
obj[c4d.ID_USERDATA,1] = 0
obj[c4d.ID_USERDATA,2] = 1
obj[c4d.ID_USERDATA,3] = 0
obj[c4d.ID_USERDATA,4] = 0
if obj[c4d.ID_USERDATA,3] == 1:
obj[c4d.ID_USERDATA,1] = 0
obj[c4d.ID_USERDATA,2] = 0
obj[c4d.ID_USERDATA,3] = 1
obj[c4d.ID_USERDATA,4] = 0
if obj[c4d.ID_USERDATA,4] == 1:
obj[c4d.ID_USERDATA,1] = 0
obj[c4d.ID_USERDATA,2] = 0
obj[c4d.ID_USERDATA,3] = 0
obj[c4d.ID_USERDATA,4] = 1
c4d.EventAdd()
if I press from the last one (4 to 1) its working but does not want to go back. It sticks to the one I pressed last.
I tried putting it in a loop but still the same. _<_img src="http://www.c4dcafe.com/ipb/public/style_emoticons/default/ufogoldorak5.png" border="0" alt=":confused:" title=":confused:" /_>_
Could there maybe someone who can help. THANKS &n;_<_img src="http://www.c4dcafe.com/ipb/public/style_emoticons/default/signthankspin.gif" border="0" alt=":signthankspin:" title=":signthankspin:" /_>_" />