In this tutorial we will show you how to make a turntable animation using a looping python script and the -renderMeshFromCustomPositionLookAt command.
https://dev.epicgames.com/community/learning/tutorials/q4jY/capturing-reality-turntable-animation-render
Bonjour,
J’ai bien le dossier Frames qui se crée mais aucune image…
# These scripts were created by Epic Games Slovakia, who doesn't carry any liability in case issues related to the sample occur.
import subprocess
import time
import math
import os
frameFolder=os.path.join(os.getcwd(),"frames")
if not os.path.exists (os.path.join(os.getcwd(),"frames")):
# Create a new directory because it does not exist
os.makedirs(os.path.join(os.getcwd(),"frames"))
print("made a frames folder for you")
subprocess.Popen([r"C:\Program Files\Capturing Reality\RealityCapture\RealityCapture.exe", '-setInstanceName','-stdConsole'])
time.sleep(15)
camFocal = 70
imageWidth = 3840
imageHeight = 2160
XLookAt = 1795630.782707
YLookAt = 4221443.125362
ZLookAt = 874.923134
loopRadius = 20
loopHeight = 15
upZ= 25
num_points = 4 # Number of points on the circle
for i in range(num_points):
angle = i * (360 / num_points)
x = loopRadius * math.cos(math.radians(angle))
y = loopRadius * math.sin(math.radians(angle))
camXpos = XLookAt + x
camYpos = YLookAt + y
#print(f"X: {x:.4f} Y: {y:.4f}")
framePath=os.path.join(frameFolder,"frame"+str(i)+".png")
print(framePath)
cmdlist = [
r"C:\Program Files\Capturing Reality\RealityCapture\RealityCapture.exe",
'-delegateTo', "*",'-renderMeshFromCustomPositionLookAt', str(framePath), str(imageWidth), str(imageHeight), str(camFocal), str(camXpos), str(camYpos), str(loopHeight), str(XLookAt), str(YLookAt), str(ZLookAt), '0', '0', str(upZ)
]
print (cmdlist)
subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr = subprocess.STDOUT, universal_newlines=True)
Hi Boilatas,
I tested your script and it worked for me.
Do you have also opened RealityCapture project from which you want to create the images?