Skip to content

Commit 8d3dc3b

Browse files
authored
Merge pull request #757 from hx2A/flip-v-param
Flip v and flip u params
2 parents 943af27 + 01281ed commit 8d3dc3b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

py5-resources/py5-module/src/py5/shape_conversion.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,10 @@ def trimesh_trimesh_to_py5shape_converter(sketch, obj: Trimesh, **kwargs):
470470
if isinstance(obj.visual, TextureVisuals):
471471
use_texture = True
472472
uv = obj.visual.uv[obj_faces_ravel]
473-
uv[:, 1] = 1 - uv[:, 1]
473+
if kwargs.get("flip_u", False):
474+
uv[:, 0] = 1 - uv[:, 0]
475+
if kwargs.get("flip_v", False):
476+
uv[:, 1] = 1 - uv[:, 1]
474477
vertices = np.hstack([vertices, uv])
475478

476479
if "texture" in kwargs:

0 commit comments

Comments
 (0)