Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_vertex.c
| Show First 20 Lines • Show All 1,506 Lines • ▼ Show 20 Lines | static void vwpaint_update_cache_variants(bContext *C, VPaint *vp, Object *ob, PointerRNA *ptr) | ||||
| * It's more an events design issue, which doesn't split coordinate/pressure/angle | * It's more an events design issue, which doesn't split coordinate/pressure/angle | ||||
| * changing events. We should avoid this after events system re-design */ | * changing events. We should avoid this after events system re-design */ | ||||
| if (paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT) || cache->first_time) { | if (paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT) || cache->first_time) { | ||||
| cache->pressure = RNA_float_get(ptr, "pressure"); | cache->pressure = RNA_float_get(ptr, "pressure"); | ||||
| } | } | ||||
| /* Truly temporary data that isn't stored in properties */ | /* Truly temporary data that isn't stored in properties */ | ||||
| if (cache->first_time) { | if (cache->first_time) { | ||||
| if (!BKE_brush_use_locked_size(scene, brush)) { | |||||
| cache->initial_radius = paint_calc_object_space_radius( | cache->initial_radius = paint_calc_object_space_radius( | ||||
| cache->vc, cache->true_location, BKE_brush_size_get(scene, brush)); | cache->vc, cache->true_location, BKE_brush_size_get(scene, brush)); | ||||
| BKE_brush_unprojected_radius_set(scene, brush, cache->initial_radius); | BKE_brush_unprojected_radius_set(scene, brush, cache->initial_radius); | ||||
| } | } | ||||
| else { | |||||
| cache->initial_radius = BKE_brush_unprojected_radius_get(scene, brush); | |||||
| } | |||||
| } | |||||
| if (BKE_brush_use_size_pressure(brush) && | if (BKE_brush_use_size_pressure(brush) && | ||||
| paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT)) { | paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT)) { | ||||
| cache->radius = cache->initial_radius * cache->pressure; | cache->radius = cache->initial_radius * cache->pressure; | ||||
| } | } | ||||
| else { | else { | ||||
| cache->radius = cache->initial_radius; | cache->radius = cache->initial_radius; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,908 Lines • Show Last 20 Lines | |||||