Last active
September 25, 2016 08:54
-
-
Save MikeUdin/9b803541157b614dc879436c11470aee to your computer and use it in GitHub Desktop.
Place Selected Objects To Connect
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 | |
# Author: Mike Udin, http://mikeudin.net | |
# 2016 | |
def main(): | |
objs = doc.GetActiveObjects(1) | |
if not objs: return | |
doc.StartUndo() | |
con_obj = c4d.BaseObject(c4d.Oconnector) | |
con_obj.InsertBefore(objs[0]) | |
doc.AddUndo(c4d.UNDOTYPE_NEW,con_obj) | |
for obj in objs: | |
doc.AddUndo(c4d.UNDOTYPE_CHANGE,obj) | |
obj.InsertUnder(con_obj) | |
doc.EndUndo() | |
c4d.EventAdd() | |
if __name__=='__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment