Page MenuHome

Use DNA defaults system for modifiers
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Aug 28 2020, 9:41 PM.

Details

Summary

Benefits
As noted in T80164, there are quite a few area of Blender where the "Reset to Default Value" operator
in button context menus doesn't work. Modifiers are one of them, because the DNA defaults system was never set up for them.

Also, this should make versioning for modifiers easier. Whenever a new field is added it should be
automatically initialized to the default value.

Issues
I have to make some changes in the following modifiers to work around an error with -Wsign-conversion in the macros.

  • Solidify Modifier
  • Corrective Smooth Modifier
  • Screw Modifier

Next Steps
Here are the next steps for future commits:

  • Data Transfer Modifier -- Disabled for now, defines for defaults scattered around too many different files (not in DNA
  • Cloth Modifier
  • Fluid Modifier
  • Softbody Modifier

For the last three, I just prefer to handle the special cases by themselves.

Diff Detail

Repository
rB Blender
Branch
dna-defaults-modifiers (branched from master)
Build Status
Buildable 9871
Build 9871: arc lint + arc unit

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Aug 28 2020, 9:41 PM
Hans Goudey (HooglyBoogly) created this revision.
  • Merge master for recent boolean modifier changes
  • Work around strict GCC flags in some modifiers
  • Disable changes in data transfer modifier for now
  • Fix errors for more modifiers

This should be ready to go now. I'd like to get this into 2.91 so I don't have to keep updating the defaults here.

GCC found about duplicates (inline), otherwise seems fine.

source/blender/makesdna/DNA_modifier_defaults.h
86–87

duplicate.

680–681

duplicate.

This revision is now accepted and ready to land.Thu, Oct 1, 11:39 AM
This revision was automatically updated to reflect the committed changes.