Hello community,
how can I halt the execution of a Script Manger script, execute "mouse commands", and then resume the script? I have attached an example at the end oy my posting.
Cheers
WDP
[edited by @ferdinand]
def main():
"""
"""
# doc is a predefined module attribute ("variable") in a Script Manager
# context pointing to the active document and equivalent to
# c4d.documents.GetActiveDocument().
# Get the selected objects in the active document.
selected = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
# The fixed global position all objects should be set to.
pos = c4d.Vector(0, 0, 0)
# Iterate over all selected objects and set the global position of each.
for obj in selected:
# Get the global matrix of the object, set its offset and write it back.
mg = obj.GetMg()
mg.off = pos
obj.SetMg(mg)
obj[c4d.ID_BASEOBJECT_USECOLOR] = c4d.ID_BASEOBJECT_USECOLOR_ALWAYS
obj[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(0.5, 0.8, 0.3)
obj[c4d.ID_BASEOBJECT_USECOLOR] = 1
c4d.CallCommand(12102) # Axis
c4d.CallCommand(440000121) # Active snapping
# How can I halt the script at this point and evaluate "mouse commands"
# at this point.
gui.MessageDialog('Hide Object[s]')
c4d.CallCommand(600000020) # hide objects
if __name__ == '__main__':
main()