Hi!
So my goal is to create a simple command to toggle the solo function, instead of one command to solo, and one command to solo_off.
How can I go to create a python script in order to toggle these two commands :
431000059, # Viewport Solo Single
431000058) # Viewport Solo Off
So far, my attempt has been not working :
import c4d
from c4d import gui
def main():
#obj = doc.GetActiveObject()
#print(obj)
values = (431000059, # Viewport Solo Single
431000058) # Viewport Solo Off
done = False
for num,x in enumerate(values):
if x == doc.GetAction():
new_v = values[(num+1)%len(values)]
doc.SetAction(new_v)
done = True
break
if not done:
doc.setAction(values[0])
c4d.EventAdd()
if __name__=='__main__':
main()
c4d.EventAdd()
So you can tell that I don't really know what I'm doing.
How can I tell python to look at the current obj selected? Then how can I tell it to execute the solo function?
Where can I find what environment the solo command lives in, as it doesn't seems to be with the doc.GetAction().
Any help to connect the dots would be very much appreciated.
Thanks!