X-Git-Url: https://harrygodden.com/git/?p=convexer.git;a=blobdiff_plain;f=__init__.py;fp=__init__.py;h=3ce19bdce4b7eb645e855d44fbcde0b1f9250d88;hp=c8fbad983495b7a3f434666bba8aa79b79cee504;hb=8e1b6889db7ce10f8d594539ef74dc4390e8e891;hpb=4c8d56259c110af8a97ff44402ed6152921727b2 diff --git a/__init__.py b/__init__.py index c8fbad9..3ce19bd 100644 --- a/__init__.py +++ b/__init__.py @@ -258,7 +258,8 @@ class cxr_edge(Structure): class cxr_static_loop(Structure): _fields_ = [("index",c_int32), ("edge_index",c_int32), - ("uv",c_double * 2)] + ("uv",c_double * 2), + ("alpha",c_double)] class cxr_polygon(Structure): _fields_ = [("loop_start",c_int32), @@ -351,6 +352,14 @@ def mesh_cxr_format(obj): else: loop_data[loop_index].uv[0] = c_double(0.0) loop_data[loop_index].uv[1] = c_double(0.0) + + if data.vertex_colors: + alpha = data.vertex_colors.active.data[loop_index].color[0] + else: + alpha = 0.0 + + loop_data[loop_index].alpha = alpha + center = obj.matrix_world @ poly.center normal = mtx_rot @ poly.normal