Hello! My script relies on selection order and works fine. however, when I undo and run the script again immediately, the selection order is changed (somewhat reversed), and it toggles the reversal consistently. Why is it doing this? And is there a way to make sure the selection order stays constant when re-invoking the script?
You can see a clearer explanation of my problem:
in this brief screen recording
from c4d import gui
selected = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_SELECTIONORDER)
#print order of object names to console
names = 
for obj in selected:
for idx, ob in enumerate(selected):
ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_X] = 0
ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_Y] = 0
ob[c4d.ID_BASEOBJECT_GLOBAL_POSITION,c4d.VECTOR_Z] = 0 + (idx * 1000)
I've open a bug report for this.
@m_magalhaes Excellent thank you! Will you post the results here? Or is there a another link I should follow?
well, first it needs to be fixed, then release on a cinema4D's update (hotfix, service pack, release)
@m_magalhaes ah ok thanks for the clarification. So, at this point, you can confirm that this is a bug and not a mistake in implementation on my part?
yes exact, it's a bug not an error from your implementation.