- Edited
jonSS thanks
( you knew how to do it after all )
Why would you think otherwise? Your question (most of them in fact) was really unclear because you tend to jump to conclusions and operate under strange (often wrong) presuppositions. So I had to decipher through your noise what's really bothering you. Please work on clarity of your communication. Also try to take one problem at a time. You cram all this half-broken stuff into your project and then get confused when multiple things at the same time won't work as you think they should. It's a mess that requires extra effort to untangle. Be aware of this when asking questions. Always try to fully isolate an issue, best into a fresh unencumbered project. It facilitates clarity and understanding. Help us help you
add_undo_method()
and add_do_method()
as well as add_undo_property()
and add_do_property()
don't actually do anything noticeable when called. They just register callbacks or values respectively. So the order in which you call them makes no difference. The only important thing is that they get called between create_action()
and commit_action()
which form a begin/end block for the rest of the calls that define action's behavior.
Only when you finally call commit_action()
, the action gets inserted into scene's undo queue. At this point the method(s) registered via add_do_method()
will be called and the value(s) specified by add_do_property()
will be assigned. From that moment on, do/undo values and do/undo methods you supplied to the action will be set and/or called whenever it's your action's turn to be undone or redone.