Files
test/source
Tom Martin fd433a0a5c Python API: Grease Pencil: Add function set_vertex_weights on GreasePencilDrawing
This adds a new function `set_vertex_weights` to the `GreasePencilDrawing`.

Given an existing vertex group, this function writes the given weights to the
provided point indices.

Example code  for GP Stroke:
```Py
import bpy

ob = bpy.context.active_object

# Add a vertex group
ob.vertex_groups.new(name="Group")

# Get the drawing
frame = ob.data.layers.active.current_frame()
drawing = frame.drawing

# Set the vertex weights of points at index 0, 5, 10, and 15
drawing.set_vertex_weights("Group", [0, 5, 10, 15], [0.1, 0.2, 0.5, 1.0], assign_mode='ADD')
```

Pull Request: https://projects.blender.org/blender/blender/pulls/127216
2025-05-27 12:10:37 +02:00
..