Page MenuHome

[Blender2.8] Port explode modifier to new Mesh data format
ClosedPublic

Authored by Sebastian Parborg (zeddb) on Sep 22 2018, 2:20 AM.

Details

Summary

This is my initial port of the explode modifier (T55089).

I had to copy in and modify one of the CDDM functions as it seems like it was only the explode modifier that used this kind of thing (calc_edges_tessface).

I have verified that it works by creating a "quick explode" scene with the default cube and running it with both the new and the old code.

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Sep 24 2018, 5:58 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/modifiers/intern/MOD_explode.c
61

Can you rename this to BKE_mesh_calc_edges_tessface() and move it to mesh_validate.c?

712–714

Rather than this hack, you can change BKE_mesh_new_nomain_from_template_ex:

- const bool do_tessface = ((me_src->totface != 0) && (me_src->totpoly == 0)); /* only do tessface if we have no polys */
+ /* Only do tessface if we are creating tessfaces or copying from mesh with only tessfaces. */
+ const bool do_tessface = (tessface_len ||
+                           (me_src->totface != 0) && (me_src->totpoly == 0));
1081

The new code for that is:

explode->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
This revision now requires changes to proceed.Sep 24 2018, 5:58 PM

I've updated the diff with your suggestions.

This revision is now accepted and ready to land.Sep 25 2018, 2:01 PM
This revision was automatically updated to reflect the committed changes.