Page MenuHome

Various fixes for modifiers apply and object.to_mesh
ClosedPublic

Authored by Sergey Sharybin (sergey) on Mar 28 2019, 10:47 AM.

Details

Summary

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.

Diff Detail

Repository
rB Blender

Event Timeline

Harbormaster completed remote builds in B3246: Diff 14452.
Sergey Sharybin (sergey) retitled this revision from === Modifiers: Use object passed to evaluation === to Various fixes for modifiers apply and object.to_mesh.Mar 28 2019, 10:49 AM
Sergey Sharybin (sergey) edited the summary of this revision. (Show Details)

I couldn't spot any issues, looks good.

This revision is now accepted and ready to land.Mar 28 2019, 6:48 PM
Sebastian Parborg (zeddb) added inline comments.
source/blender/blenkernel/intern/mesh_convert.c
842

Just a little grammar nitpick

foes -> goes

So:

The convention goes as following:

This revision was automatically updated to reflect the committed changes.