Skip to content

Instantly share code, notes, and snippets.

@keerah
Last active May 23, 2022 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keerah/5470fbb3f6a45ab8fbfa3718e15c23b1 to your computer and use it in GitHub Desktop.
Save keerah/5470fbb3f6a45ab8fbfa3718e15c23b1 to your computer and use it in GitHub Desktop.
c4d select parent
import c4d
#Welcome to the world of Python
def main():
doc.StartUndo()
s = doc.GetSelection()
for x in s:
try:
p = x.GetUp()
doc.AddUndo(c4d.UNDOTYPE_BITS, x)
x.DelBit(c4d.BIT_ACTIVE)
doc.AddUndo(c4d.UNDOTYPE_BITS, p)
p.SetBit(c4d.BIT_ACTIVE)
except:
pass
c4d.EventAdd()
doc.EndUndo()
if __name__=='__main__':
main()
@art13eck
Copy link

hello, could you make the selection stop at the last parent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment