Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 6,252 Lines • ▼ Show 20 Lines | static void do_tiled( | ||||
| /* These are integer locations, for real location: multiply with step and add orgLoc. | /* These are integer locations, for real location: multiply with step and add orgLoc. | ||||
| * So 0,0,0 is at orgLoc. */ | * So 0,0,0 is at orgLoc. */ | ||||
| int start[3]; | int start[3]; | ||||
| int end[3]; | int end[3]; | ||||
| int cur[3]; | int cur[3]; | ||||
| /* Position of the "prototype" stroke for tiling. */ | /* Position of the "prototype" stroke for tiling. */ | ||||
| float orgLoc[3]; | float orgLoc[3]; | ||||
| float original_initial_location[3]; | |||||
| copy_v3_v3(orgLoc, cache->location); | copy_v3_v3(orgLoc, cache->location); | ||||
| copy_v3_v3(original_initial_location, cache->initial_location); | |||||
| for (int dim = 0; dim < 3; dim++) { | for (int dim = 0; dim < 3; dim++) { | ||||
| if ((sd->paint.symmetry_flags & (PAINT_TILE_X << dim)) && step[dim] > 0) { | if ((sd->paint.symmetry_flags & (PAINT_TILE_X << dim)) && step[dim] > 0) { | ||||
| start[dim] = (bbMin[dim] - orgLoc[dim] - radius) / step[dim]; | start[dim] = (bbMin[dim] - orgLoc[dim] - radius) / step[dim]; | ||||
| end[dim] = (bbMax[dim] - orgLoc[dim] + radius) / step[dim]; | end[dim] = (bbMax[dim] - orgLoc[dim] + radius) / step[dim]; | ||||
| } | } | ||||
| else { | else { | ||||
| start[dim] = end[dim] = 0; | start[dim] = end[dim] = 0; | ||||
| Show All 14 Lines | for (cur[1] = start[1]; cur[1] <= end[1]; cur[1]++) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ++cache->tile_pass; | ++cache->tile_pass; | ||||
| for (int dim = 0; dim < 3; dim++) { | for (int dim = 0; dim < 3; dim++) { | ||||
| cache->location[dim] = cur[dim] * step[dim] + orgLoc[dim]; | cache->location[dim] = cur[dim] * step[dim] + orgLoc[dim]; | ||||
| cache->plane_offset[dim] = cur[dim] * step[dim]; | cache->plane_offset[dim] = cur[dim] * step[dim]; | ||||
| cache->initial_location[dim] = cur[dim] * step[dim] + original_initial_location[dim]; | |||||
| } | } | ||||
| action(sd, ob, brush, ups); | action(sd, ob, brush, ups); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void do_radial_symmetry(Sculpt *sd, | static void do_radial_symmetry(Sculpt *sd, | ||||
| ▲ Show 20 Lines • Show All 3,299 Lines • Show Last 20 Lines | |||||