point attribute co to position

This commit is contained in:
pullusb
2024-11-11 16:23:11 +01:00
parent 3ece64e517
commit 6e94ee270d
9 changed files with 57 additions and 54 deletions
+4 -4
View File
@@ -31,7 +31,7 @@ def get_matrix(ob) :
def set_matrix(gp_frame,mat):
for stroke in gp_frame.strokes :
for point in stroke.points :
point.co = mat @ point.co
point.position = mat @ point.position
# get view vector location (the 2 methods work fine)
def get_view_origin_position():
@@ -173,7 +173,7 @@ def simple_draw_gp_stroke(pts, frame, width = 2, mat_id = 0):
# for i, pt in enumerate(pts):
# stroke.points.add()
# dest_point = stroke.points[i]
# dest_point.co = pt
# dest_point.position = pt
return stroke
## OLD - need update
@@ -457,7 +457,7 @@ def get_active_frame(layer_name=None):
def get_stroke_2D_coords(stroke):
'''return a list containing points 2D coordinates of passed gp stroke object'''
return [location_to_region(p.co) for p in stroke.points]
return [location_to_region(p.position) for p in stroke.points]
'''#foreach method for retreiving multiple other attribute quickly and stack them
point_nb = len(stroke.points)
@@ -474,7 +474,7 @@ def get_all_stroke_2D_coords(frame):
## using modification from get_stroke_2D_coords func'
return [get_stroke_2D_coords(s) for s in frame.strokes]
## direct
#return[[location_to_region(p.co) for p in s.points] for s in frame.strokes]
#return[[location_to_region(p.position) for p in s.points] for s in frame.strokes]
def selected_strokes(frame):
'''return all stroke having a point selected as a list of strokes objects'''