July 12, 2018
C4D Quicktip: Shift Tags
Jason Peacock had this request for a script to shift multiple tags up/down the tag hierarchy:
import c4d from c4d import gui def main(): doc.StartUndo() sel = doc.GetActiveTags() for tag in sel: obj = tag.GetMain() taglist = obj.GetTags() for i, t in enumerate(taglist): if t in sel: index = i+1 if index >= len(taglist): return #print """Tag: %s || Index: %s""" % (t.GetName(), i) doc.AddUndo(c4d.UNDOTYPE_CHANGE, obj) obj.InsertTag(t, taglist[index]) doc.EndUndo() c4d.EventAdd() if __name__=='__main__': main()
This was essentially my approach, it’s not bulletproof but it works if you want to send multiple tags from one index to the next.
For a quick way to shift tags from left to right. Make sure to select only one(!) line of vertical tags, not multiple tags on multiple objects. Then it should do the trick.
โ Lasse Lauch (@lasse_lauch) 12. Juli 2018