Skip to content

Instantly share code, notes, and snippets.

View mp5gosu's full-sized avatar
🤓
Blender as usual...

Robert mp5gosu

🤓
Blender as usual...
View GitHub Profile
@mp5gosu
mp5gosu / get_dup_texture_tags.py
Last active February 10, 2021 00:25
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:
@mp5gosu
mp5gosu / HierarchyIterator.py
Created February 2, 2021 17:34
Cinema 4D Hierarchy Iterator helper for iterating over all object
def GetNextObject(op, op_stop=None):
"""
Hierarchy iteration helper from https://developers.maxon.net/?p=596
:param op_stop: The object to stop at. Returns None when this object is found.
:type op_stop: c4d.BaseObject
:param op: the object to get the next node from
:return: The next object
"""
if op is None:
return None