Page MenuHome

Fix T101766: Curves sculptmode: orbit around selection / view selected
Changes PlannedPublic

Authored by Philipp Oeser (lichtwerk) on Dec 16 2022, 2:35 PM.

Details

Summary

Usually in paintmodes one can orbit around the last stroke and also
View > Frame Selected would take the last stroke into account.
This was not the case yet for curves sculptmode.

In order for this to work, there are things (mainly stroke positions) to
update in UnifiedPaintSettings while the stroke happens and this is
what this patch does. There are also two more occasions where
OB_MODE_SCULPT_CURVES has to be taken into account next to
OB_MODE_ALL_PAINT.

NOTE: I can imagine there is a more performant way to do this (and not getting sample_curves_3d_brush _again_ -- since it might have been used in the operation already) basically putting this up here to discuss how/ where this would be most appropriate to do instead
NOTE: there a re more places to check still before we can incorporate OB_MODE_SCULPT_CURVES into OB_MODE_ALL_PAINT all together, so this patch still has these separate.

Diff Detail

Repository
rB Blender
Branch
T101766_b (branched from master)
Build Status
Buildable 25059
Build 25059: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Dec 16 2022, 2:35 PM
Philipp Oeser (lichtwerk) created this revision.

Don't forget to set the pivot on entering the mode, just call paint_init_pivot().

Don't forget to set the pivot on entering the mode, just call paint_init_pivot().

Isnt about the same already done in BKE_paint_init? I mean in ED_object_texture_paint_mode_enter_ex it seems redundant to call paint_init_pivot but in curves_sculptmode_enter I could use it, thx for the heads up

Don't forget to set the pivot on entering the mode, just call paint_init_pivot().

Isnt about the same already done in BKE_paint_init? I mean in ED_object_texture_paint_mode_enter_ex it seems redundant to call paint_init_pivot but in curves_sculptmode_enter I could use it, thx for the heads up

Actually, no: paint_init_pivot seems to expect a mesh, cant work on a curves object...

Hans Goudey (HooglyBoogly) added inline comments.
source/blender/editors/sculpt_paint/curves_sculpt_ops.cc
196–211

Since sample_curves_3d_brush is already called in some sculpt brushes, it would probably be best not to duplicate it here. The operation is multi-threaded but not trivial for performance. Maybe on_stroke_extended should be able to return a position?

source/blender/editors/sculpt_paint/curves_sculpt_ops.cc
196–211

Thx for the feedback, that could work, will check on this (I was having the same worry -- see the initial note in the patch description)

Philipp Oeser (lichtwerk) planned changes to this revision.Jan 10 2023, 9:18 AM

Will check on on_stroke_extended to be able to return a position.

Looks good to me. I fixed paint_init_pivot to work with curves in master and added it to curves_sculptmode_enter, no need to worry about that for this patch anymore.