diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2011-05-28 15:30:21 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2011-05-28 15:30:21 +0400 |
commit | 7154b424e9cd5f4b382874fc5c3cf17b18f81777 (patch) | |
tree | 0eb0863bf36dd19b8b3e5951cff29b760dbf23b9 /source/blender/blenkernel/intern/brush.c | |
parent | 8246f9431725693ac75acdd8b6149db7f4d84d5c (diff) |
Fix: The radial control would fail, in sculpt mode, to set size if object-space sizing was enabled.
This was caused because a small part of sculpt's radial control code did not make it into the new version. The old code would set a new object-space size by scaling it proportional to how much the new screen-space size was changed.
The solution I implement here is to do the same scaling inside the RNA callbacks. This way, users of those properties do not have to worry about inconsistency.
I added a comment warning that brush_set_size, brush_set_unified_size, brush_unprojected_radius, and brush_set_unprojected_radius do not guarantee consistency because it is not always possible to precisely know what the new unprojected radius is in all contexts where you might set the size.
I would implement the consistency check at the lower level (in those listed functions) but at this time I think it needs to be looked at to make sure that won't cause problems. In addition, I am not sure that scaling by the ratio of change is strictly correct in all cases.
In any case, this at least fixes the immediate problem.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 98c540f53b7..25b60fef6dd 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -1251,6 +1251,19 @@ static short unified_settings(Brush *brush) return 0; } +// XXX: be careful about setting size and unprojected radius +// because they depend on one another +// these functions do not set the other corresponding value +// this can lead to odd behavior if size and unprojected +// radius become inconsistent. +// the biggest problem is that it isn't possible to change +// unprojected radius because a view context is not +// available. my ussual solution to this is to use the +// ratio of change of the size to change the unprojected +// radius. Not completely convinced that is correct. +// In anycase, a better solution is needed to prevent +// inconsistency. + static void set_unified_size(Brush *brush, int value) { Scene *sce; |