They are all related, and applying one of the changes separately
will break one aspect or another. Those are separate commits,
but are to be applied all at the same time.
Modifiers: Use object passed to evaluation
This was wrong and violating design to force modifiers to query
evaluated objects and IDs. It is up to the caller to make sure
the object is properly evaluatable.
Effectively, reverting changes from de491abf9962 (and possibly
other related changes).
Modifiers: Proper fix for the Apply Modifier
It is up to the operator to pass valid object to the modifiers
evaluation.
Fixes T62916: Applying boolean modifier does not set materials properly
Tweak behavior of object.to_mesh()
- Passing original object with apply_modifiers=false will give a non-modified non-deformed mesh. The result mesh will point to datablocks from the original "domain". For example, materials will be original.
- Passing original object with apply_modifiers=true will give a mesh which has all modifiers applied. The result mesh will point to datablocks from the original "domain". For example, materials will be original.
- Passing evaluated object will ignore apply_modifiers argument, and the result always contains all modifiers applied. The result mesh will point to an evaluated datablocks. For example, materials will be an evaluated IDs from the dependency graph.