Fix 'Apply Selected Modifier' operator issues due to improper sequencing, document apply\_modifier a little bit and make it a little less error-prone #1
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.
This PR started as the result of some oddities from using
apply_modifierinside an automated export script, which may or may not be poking a 'public API' of the module, but the operator is not currently structured in a way convenient for use by scripts and invoking this code was the best option I had for my project's purposes short of essentially rewriting what ultimately amounts to this code anyway.The operator was not functioning, at least on Blender 5, due to what seems to be an incorrect handling of the operator lifecycle (things that needed to happen in
invokewere instead inexecute); I've tried to fix this as well as I reasonably can, and attempted to better account for the 32-modifier limit.