offer modal operator for multi edit #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Γεια σου Αντώνη ;)
Hello Antoni
Nice addon by the way
Your addon can be improved by completely removing the multiEdit Enter and multiEdit Exit buttons. Instead the addon could detect automagically if you are in edit mode and if you selected more than one object and call either MultiEnter enter or MultiEnter exit accordingly.
So I created this pull request to your Github repo that contains code that creates a modal operator. The advantage of the modal operator is that it runs always and there is no need to click buttons. The modal operator then checks every 1 second (this can be configured for less or more time) to see if the user selected multiple objects and entered edit mode for one of them, then it calls MultiEdit Enter operator , if it detects that all objects are on non edit mode and the multi edit mode has previously being entered then it calls the MultiEdit Exit operator.
The code is placed on the bottom of the python module.
The modal operator can be called with the spacebar menu and its named "Simple View Operator" , you can name it whatever you want , you can also make it run as soon as the addon is enabled.
I have tested the code and it seems it works fine, there is a small delay because I have set it to check only once a second but you can easily drop it down to 100 milliseconds. I also had some crashes with Blender but 2.78c seems to work better than 2.79a.
Also I have not commented the code because I think it is obvious what it does but if you feel that you struggle to understand it, drop me a comment and will clean up the code and add comments.
You are free to do with the code as you please.