FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
UnrealEnginePython/examples/rotate_texture.py at master · Devination/UnrealEnginePython · GitHub
Devination
UnrealEnginePython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
UnrealEnginePython
/
examples
/
rotate_texture.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (12 loc) · 594 Bytes
Breadcrumbs
UnrealEnginePython
/
examples
/
rotate_texture.py
Copy path
File metadata and controls
21 lines (12 loc) · 594 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from
PIL
import
Image
import
unreal_engine
as
ue
from
unreal_engine
.
classes
import
Texture2D
def
rotate_selected_assets_data
(
degrees
):
for
asset
in
ue
.
get_selected_assets
():
if
asset
.
is_a
(
Texture2D
):
data
=
asset
.
texture_get_source_data
()
size
=
(
asset
.
texture_get_width
(),
asset
.
texture_get_height
())
img
=
Image
.
frombytes
(
'RGBA'
,
size
,
bytes
(
data
))
out
=
img
.
rotate
(
degrees
)
asset
.
texture_set_source_data
(
out
.
tobytes
())
rotate_selected_assets_data
(
45
)
Back
|
FazBrowse Home
|
New Git URL