We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55104f0 commit 39e8f05Copy full SHA for 39e8f05
examples/rotate_texture.py
@@ -0,0 +1,15 @@
1
+from PIL import Image
2
+import unreal_engine as ue
3
+from unreal_engine.classes import Texture2D
4
+
5
+def rotate_selected_assets_data(degrees):
6
+ for asset in ue.get_selected_assets():
7
+ if asset.is_a(Texture2D):
8
+ tex = ue.load_object(Texture2D, asset.get_path_name())
9
+ data = tex.texture_get_data()
10
+ size = (asset.Blueprint_GetSizeX(), asset.Blueprint_GetSizeY())
11
12
+ img = Image.frombytes("RGB", size, data)
13
+ img.show()
14
+ out = img.rotate(degrees, expand=1)
15
+ tex.texture_set_data(out.tobytes())
0 commit comments