I'm adding a script, added as a valuable shortcut in my everyday workflow here :
It basically allows you to select any object, and assigned to the letter H, Hide or Reveal your selected object. Like in Maya. Very Useful.
Not sure it is the best way to do it, that's why I'm posting it here.
import c4d
from c4d import gui
def main():
allobj = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
obj = object()
for obj in allobj:
editor = obj[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR]
render = obj[c4d.ID_BASEOBJECT_VISIBILITY_RENDER]
if editor == 1 or render == 1:
newstate = 2
else:
newstate = 1
obj[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR] = newstate
obj[c4d.ID_BASEOBJECT_VISIBILITY_RENDER] = newstate
if __name__=='__main__':
main()
c4d.EventAdd()