Page MenuHome

Modifiers: Solidify add option to assign shell geometry to selected vertex group
ClosedPublic

Authored by Cody Winchester (CodyWinch) on Feb 21 2020, 4:50 AM.

Details

Summary

This patch gives the solidify modifier the ability to assign the newly created shell geometry to a selected vertex group. This expands the procedural control over the modifier stack by letting users apply modifiers to the shell geometry without affecting the original geometry.

This will be especially helpful for NPR users that use solidify to create backface culling lines on their characters giving them the ability to add displace noise and other effects.

Diff Detail

Repository
rB Blender

Event Timeline

Cleaned up the naming of the properties so they are more consistent and made the tooltip clearer on what it does.

Bastien Montagne (mont29) requested changes to this revision.Mar 24 2020, 4:37 PM

Generally looks fine, but shouldn't we offer the option for rim and back separately then (like we do with material index offsets)?

Also, quid of the 'complex' option? Any reason not to implement that for that algorithm as well, since it already also supports rim & back material offsets?

source/blender/makesdna/DNA_modifier_types.h
1160

should be shell_defgrp_name

source/blender/modifiers/intern/MOD_solidify_extrude.c
243

likewise, shell_defgrp_index

1103–1105

Can't you simply do for (int i = numVerts; i < result->totvert; i++) ?

1104

This check should be outside of the loop!

This revision now requires changes to proceed.Mar 24 2020, 4:37 PM

Generally looks fine, but shouldn't we offer the option for rim and back separately then (like we do with material index offsets)?

Also, quid of the 'complex' option? Any reason not to implement that for that algorithm as well, since it already also supports rim & back material offsets?

I can add in a rim output group as well.

I attempted to add it to the complex option, but ran into incorrect results. It looked to me like the geometry wasn't preserving the original indeces, but that may have just been my inexperience with that option. So I thought it would be best to submit it separately. I will look into it again.

Updated to reflect notes.

  • Added rim vertex group functionality.
  • Added the options for the complex version.
  • Added checks for the existence of CD_MDEFORMVERT in the result mesh and if not there add it in. This prevented the vertex group assignment on models that don't have an existing vertex group with weights added.
Cody Winchester (CodyWinch) marked 4 inline comments as done.Mar 25 2020, 2:32 AM
Bastien Montagne (mont29) requested changes to this revision.Mar 26 2020, 11:57 AM

LGTM in general, besides changes suggested in comments (thanks to super recent vgroup API revamp I guess)

source/blender/modifiers/intern/MOD_solidify_extrude.c
893–903

No need for the has_mdef extra step here, you can just call CustomData_duplicate_referenced_layer directly, and create it if dvert is NULL...

source/blender/modifiers/intern/MOD_solidify_nonmanifold.c
135–148 ↗(On Diff #23079)

Looks like those defvert functions got renamed/re-arranged recently. Think this can be replaced now by something like:

BKE_defvert_ensure_index(dv, defgrp_index)->weight = 1.0f;                                                                                                                                                                        )

(and no need for util function then)? Same above in basic version of the solidify code of course.

If you still want to embed the check on defgrp_index then make the util function inlined.

1742–1753 ↗(On Diff #23079)

No need for the has_mdef extra step here, you can just call CustomData_duplicate_referenced_layer directly, and create it if dvert is NULL...

This revision now requires changes to proceed.Mar 26 2020, 11:57 AM
Cody Winchester (CodyWinch) marked 3 inline comments as done.

Updated to reflect the new notes and match master.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 27 2020, 11:16 AM
This revision was automatically updated to reflect the committed changes.