Last active
May 23, 2022 06:03
-
-
Save keerah/5470fbb3f6a45ab8fbfa3718e15c23b1 to your computer and use it in GitHub Desktop.
c4d select parent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello, could you make the selection stop at the last parent?