fix: brushed strokes copy-paste
1.0.1: - fix: copy paste problems - Get points uv_properties (used for brushed points) - Trigger an update on each pasted strokes, recalculate badly drawn uv and fills (works in 2.93+)gpv2
parent
fdbfaaa1e0
commit
c9266b7efe
|
@ -59,6 +59,8 @@ def getMatrix (layer) :
|
|||
|
||||
return matrix.copy()
|
||||
|
||||
default_pt_uv_fill = Vector((0.5, 0.5))
|
||||
|
||||
def dump_gp_point(p, l, obj):
|
||||
'''add properties of a given points to a dic and return it'''
|
||||
pdic = {}
|
||||
|
@ -76,7 +78,15 @@ def dump_gp_point(p, l, obj):
|
|||
|
||||
## get vertex color (long...)
|
||||
if p.vertex_color[:] != (0.0, 0.0, 0.0, 0.0):
|
||||
pdic['vertex_color'] = convertAttr(getattr(p,'vertex_color'))
|
||||
pdic['vertex_color'] = convertAttr(p.vertex_color)
|
||||
|
||||
## UV attr (maybe uv fill is always (0.5,0.5) ? also exists at stroke level...)
|
||||
if p.uv_fill != default_pt_uv_fill:
|
||||
pdic['uv_fill'] = convertAttr(p.uv_fill)
|
||||
if p.uv_factor != 0.0:
|
||||
pdic['uv_factor'] = convertAttr(p.uv_factor)
|
||||
if p.uv_rotation != 0.0:
|
||||
pdic['uv_rotation'] = convertAttr(p.uv_rotation)
|
||||
|
||||
return pdic
|
||||
|
||||
|
@ -342,6 +352,8 @@ def add_stroke(s, frame, layer, obj):
|
|||
else:
|
||||
setattr(ns.points[i], k, v)
|
||||
|
||||
## trigger updapte (in 2.93 fix some drawing problem with fills and UVs)
|
||||
ns.points.update()
|
||||
|
||||
## patch pressure 2
|
||||
# ns.points.foreach_set('pressure', pressure_flat_list)
|
||||
|
|
|
@ -101,6 +101,12 @@ Panel in sidebar : 3D view > sidebar 'N' > Gpencil
|
|||
|
||||
## Changelog:
|
||||
|
||||
1.0.1:
|
||||
|
||||
- fix: copy paste problems
|
||||
- Get points uv_properties (used for brushed points)
|
||||
- Trigger an update on each pasted strokes, recalculate badly drawn uv and fills (works in 2.93+)
|
||||
|
||||
1.0.0:
|
||||
|
||||
- Compatible with official grease pencil tools
|
||||
|
|
|
@ -15,7 +15,7 @@ bl_info = {
|
|||
"name": "GP toolbox",
|
||||
"description": "Set of tools for Grease Pencil in animation production",
|
||||
"author": "Samuel Bernou",
|
||||
"version": (1, 0, 0),
|
||||
"version": (1, 0, 1),
|
||||
"blender": (2, 91, 0),
|
||||
"location": "sidebar (N menu) > Gpencil > Toolbox / Gpencil properties",
|
||||
"warning": "",
|
||||
|
|
Loading…
Reference in New Issue