a lot of stuff
This commit is contained in:
1 parent
86f54deb01
commit
a3a80dfa16
35 files changed
+407
No files matched your search
Executable
+19
@@ -0,0 +1,19 @@
|
||||
from pathlib import Path
|
||||
|
||||
import unreal
|
||||
|
||||
RENDER_TARGET_ASSET = "/Game/NewTextureRenderTarget2D"
|
||||
OUTPUT_FILE = Path(unreal.Paths.project_saved_dir()) / "demo_from_cpp.png"
|
||||
|
||||
render_target = unreal.load_asset(RENDER_TARGET_ASSET)
|
||||
|
||||
# Parametry Out funkcji UFUNCTION wracaja w Pythonie jako tuple.
|
||||
png_bytes, error = unreal.DemoRenderBridge.render_target_to_png(
|
||||
render_target
|
||||
)
|
||||
|
||||
if error:
|
||||
raise RuntimeError(error)
|
||||
|
||||
OUTPUT_FILE.write_bytes(bytes(png_bytes))
|
||||
unreal.log(f"preview saved as {OUTPUT_FILE}")
|
||||
Reference in new issue
Block a user