Select objects by editor / renderer visibility?


#1

I’ve got a complex model hierarchy containing a scattered selection of objects with disabled editor and/or renderer visibility - red dots. Is there any way to automagically select those objects?


#2

Well, you could script it like that:

import c4d
from c4d import gui

def doToObject(obj):
    if c4d.MODE_OFF == obj.GetRenderMode() :
        doc.SetSelection(obj, c4d.SELECTION_ADD)
    if c4d.MODE_OFF == obj.GetEditorMode() :
        doc.SetSelection(obj, c4d.SELECTION_ADD)
    return

def traverseTree(obj):
    if obj==None: return
    while obj != None:
        doToObject(obj)
        traverseTree(obj.GetDown())
        obj=obj.GetNext()
    
def main():
    root = doc.GetFirstObject()
    if root==None: return
    doc.SetActiveObject(None)
    traverseTree(root)
    c4d.EventAdd()   

if __name__=='__main__':
    main()

#3

Cairyn - that’s really helpful, and generous, of you. Thank you! It does the job for me : )