MCPcopy Create free account
hub / github.com/MaximeHerpin/modular_tree / smooth_distribute_gp_layer

Function smooth_distribute_gp_layer

grease_pencil.py:38–53  ·  view source on GitHub ↗
(gp_layer, dist, smooth_iterations)

Source from the content-addressed store, hash-verified

36
37
38def smooth_distribute_gp_layer(gp_layer, dist, smooth_iterations):
39 strokes = [[i.co for i in j.points] for j in gp_layer.strokes]
40 for i, stroke in enumerate(strokes):
41 new_locations = smooth_stroke(smooth_iterations, .3, distribute_evenly_along_curve(stroke, dist))
42 points = gp_layer.strokes[i].points
43 for k in range(len(new_locations), len(stroke)):
44 points.pop()
45
46 for k in range(len(stroke), len(new_locations)):
47 points.add()
48 # for k in range(len(points)):
49 # points.pop()
50 # print(len(points))
51 # points.add(len(new_locations))
52 for j, point in enumerate(gp_layer.strokes[i].points):
53 point.co = new_locations[j]
54
55
56def find_splits(strokes):

Callers 1

executeMethod · 0.85

Calls 2

smooth_strokeFunction · 0.85

Tested by

no test coverage detected