Page MenuHome

Sculpt: Brush default settings
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Mon, Sep 16, 4:13 PM.

Details

Summary

Settings for existing brushes are applied correctly, but this is not working with the new tools because they are not in the default blendfile.

Diff Detail

Repository
rB Blender

Event Timeline

Personally we should wrap BLI_findstring(&bmain->brushes, "Pose", offsetof(ID, name) + 2) into a macro/function so the code will be more clear, but that is not related to this patch.

This revision is now accepted and ready to land.Tue, Sep 17, 10:00 AM

My reading of the description is that this patch is not working for new tools, and some further work is needed?

In brush_generic_tool_set, a brush will automatically be created when the tool is first activated. Probably some function can be added that initializes sculpt brushes to the right defaults, that is used in both places?

  • Add default cursor colors
  • Create the brushes if they don't exist

Now the defaults for the new tools work fine when loading factory settings.

source/blender/blenloader/intern/versioning_defaults.c
478

Is it possible to only add brushes here, and then initialize all the other defaults by doing this, and extending BKE_brush_sculpt_reset as needed?

for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) {
  if (brush->sculpt_tool) {
    BKE_brush_sculpt_reset(brush);
  }
}
  • Move default settings to brush reset
This revision was automatically updated to reflect the committed changes.