Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_vertex.c
| Context not available. | |||||
| return false; | return false; | ||||
| } | } | ||||
| static void paint_last_stroke_update(Scene *scene, ARegion *ar, const float mval[2]) | static void paint_last_stroke_update(Scene *scene, const float location[3]) | ||||
| { | { | ||||
| const int mval_i[2] = {mval[0], mval[1]}; | UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; | ||||
| float world[3]; | ups->average_stroke_counter++; | ||||
| add_v3_v3(ups->average_stroke_accum, location); | |||||
| if (ED_view3d_autodist_simple(ar, mval_i, world, 0, NULL)) { | ups->last_stroke_valid = true; | ||||
| UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; | |||||
| ups->average_stroke_counter++; | |||||
| add_v3_v3(ups->average_stroke_accum, world); | |||||
| ups->last_stroke_valid = true; | |||||
| } | |||||
| } | } | ||||
| /* polling - retrieve whether cursor should be set or operator should be done */ | /* polling - retrieve whether cursor should be set or operator should be done */ | ||||
| Context not available. | |||||
| /* calculate pivot for rotation around seletion if needed */ | /* calculate pivot for rotation around seletion if needed */ | ||||
| /* also needed for "View Selected" on last stroke */ | /* also needed for "View Selected" on last stroke */ | ||||
| paint_last_stroke_update(scene, vc->ar, ss->cache->mouse); | paint_last_stroke_update(scene, ss->cache->location); | ||||
| BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL); | BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL); | ||||
| Context not available. | |||||
| /* calculate pivot for rotation around seletion if needed */ | /* calculate pivot for rotation around seletion if needed */ | ||||
| /* also needed for "View Selected" on last stroke */ | /* also needed for "View Selected" on last stroke */ | ||||
| paint_last_stroke_update(scene, vc->ar, ss->cache->mouse); | paint_last_stroke_update(scene, ss->cache->location); | ||||
| ED_region_tag_redraw(vc->ar); | ED_region_tag_redraw(vc->ar); | ||||
| Context not available. | |||||