diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-02-07 15:02:11 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-02-07 15:02:11 +0300 |
commit | 71e63153ebf3668c6552afda5acfc746dcc49853 (patch) | |
tree | 3cb4b153fa518b4cb22e3132ead3edcb7c1f3dce /source/blender/bmesh | |
parent | 699b2d98553f2b0c4bb74dc263d3251600fadd25 (diff) |
GPencil: Fix wrong python API for Point weights
The old property never worked as expected because it was impossible expose the data as props.
Now, there are two methods to handle this: weight_get and weight_set
Example use:
```import bpy
ob = bpy.context.active_object
gpd = ob.data
gps = gpd.layers[0].frames[0].strokes[0]
i = 0
print("Weights\n================================")
for pt in gps.points:
gps.points.weight_set(vertex_group_index=0, point_index=i, weight=0.5)
i +=1
i = 0
for pt in gps.points:
weight = gps.points.weight_get(vertex_group_index=0, point_index=i)
print(weight)
i +=1
```
Reviewed By: brecht
Maniphest Tasks: T84967
Differential Revision: https://developer.blender.org/D10177
b3f989
Diffstat (limited to 'source/blender/bmesh')
0 files changed, 0 insertions, 0 deletions