Attribute Manager not updating with Tag Selection
Motion4D last edited by Motion4D
I am selecting tags on an object with python and once the selection is set the attribute manager doesn't update with the tag's attributes. It will if you only have any tag selected before the selection but if an object is selected or nothing is selected the attribute manager won't display anything when the tag is selected:/
Any idea how to get the tag's properties to show up without manually selecting it?
Here is simplified code to illustrate the issue. If you just make a cube primitive and select it this code will select the phong tag. But again the properties of the phong tag dont show up.
import c4d from c4d import gui def main(): obj = doc.GetActiveObject() tags = obj.GetTags() doc.SetSelection(tags) c4d.EventAdd() # Execute main() if __name__=='__main__': main()
zipit last edited by
you can do this:
import c4d def main(): # op is perdefined as the currently selected node if not isinstance(op, c4d.BaseObject): return # get the tags of op tags = op.GetTags() if not tags: return # start a new selection with the first tag doc.SetActiveTag(tags, c4d.SELECTION_NEW) # add the other tags to the selection for tag in tags[1:]: doc.SetActiveTag(tag, c4d.SELECTION_ADD) # Update Cinema c4d.EventAdd() # Execute main() if __name__=='__main__': main()
Motion4D last edited by
doc.SetActiveTag() was the key.
doc.SetSelection() was not switching it over to tag mode.
C4DS last edited by
you can also make use of
to let the Attribute Manager (= ActiveObjectManager) show to content of the 'object'. Where 'object' can be anything from mesh object to tag, material, shader, ...