Last active
January 5, 2017 12:27
-
-
Save MikeUdin/cfb487bb26b499529ccaf6d4e13571fd to your computer and use it in GitHub Desktop.
Select instaces with same reference object
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 | |
# Check out tutoral here | |
# http://mikeudin.net/2017/01/05/cinema-4d-python-recursive-hierarchy-iteration/ | |
def recur_iter(obj,ref): | |
while obj: | |
if obj[c4d.INSTANCEOBJECT_LINK] == ref: | |
obj.SetBit(c4d.BIT_ACTIVE) | |
recur_iter(obj.GetDown(),ref) | |
obj = obj.GetNext() | |
def main(): | |
ref = op[c4d.INSTANCEOBJECT_LINK] | |
recur_iter(doc.GetFirstObject(),ref) | |
c4d.EventAdd() | |
if __name__=='__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment