Skip to content

Instantly share code, notes, and snippets.

@mp5gosu
Last active February 10, 2021 00:25
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 mp5gosu/71356ca206851399662f319b1ee8bb6b to your computer and use it in GitHub Desktop.
Save mp5gosu/71356ca206851399662f319b1ee8bb6b to your computer and use it in GitHub Desktop.
Find duplicate texture tags on object
def get_dup_texture_tags(op):
"""
Searches an object for duplicate texture tags (Only the name is allowed to be different)
:param c4d.BaseObject op: The Object to search
:return: A list of tuples of two identical texture tags
"""
tag = op.GetFirstTag()
dupes = []
tags_to_check = [ttag for ttag in op.GetTags() if ttag.CheckType(c4d.Ttexture)]
while tag:
if tag.CheckType(c4d.Ttexture):
for tag_check in tags_to_check:
if tag_check.GetDataInstance() == tag.GetDataInstance() and not tag_check == tag:
dupes.append((tag, tag_check))
tag = tag.GetNext()
return dupes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment