diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-24 10:19:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-24 10:19:28 +0300 |
commit | 3581b997d4793e8fd9ad7be7722b01edb2d75287 (patch) | |
tree | f7ebc91cce9d508aea5aa695531d37f368c21a59 /release/datafiles/blender_icons_geom.py | |
parent | 4b544e857c94118ff3957d7fa15758507fd94181 (diff) |
UI: use icons for the toolbar
Diffstat (limited to 'release/datafiles/blender_icons_geom.py')
-rw-r--r-- | release/datafiles/blender_icons_geom.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/release/datafiles/blender_icons_geom.py b/release/datafiles/blender_icons_geom.py index b98f5a5a67d..3e2e5732074 100644 --- a/release/datafiles/blender_icons_geom.py +++ b/release/datafiles/blender_icons_geom.py @@ -123,7 +123,7 @@ def write_mesh_data_lists(me): return (tris_coords, tris_colors) -def write_mesh_to_py(fh, me): +def write_mesh_to_py(fh, ob): def float_as_byte(f): # -1..1 -> 0..255 @@ -131,14 +131,24 @@ def write_mesh_to_py(fh, me): f = int(round(f * 255)) return min(max(f, 0), 255) - tris_coords, tris_colors = write_mesh_data_lists(me) + with TriMesh(ob) as me: + tris_coords, tris_colors = write_mesh_data_lists(me) + + # pixel size needs to be increased since a pixel needs one extra geom coordinate + coords_range = ( + ob.get("size_x") or 255, + ob.get("size_y") or 255, + ) + + + print("Writing:", fh.name, coords_range) fw = fh.write # Header (version 0). fw(b'VCO\x00') # Width, Height - fw(bytes((255, 255))) + fw(bytes(coords_range)) # X, Y fw(bytes((0, 0))) @@ -197,10 +207,8 @@ def main(): for name, ob in objects: filename = os.path.join(args.output_dir, name + ".dat") - print("Writing:", filename) with open(filename, 'wb') as fh: - with TriMesh(ob) as me: - write_mesh_to_py(fh, me) + write_mesh_to_py(fh, ob) if __name__ == "__main__": |