Hi all, vexe here, from Unity community. First post here
I’m relatively new to blender, I have my modeler - but I occasionally jump to mess with some renders, camera settings, make quick levels for testing, etc.
In our game we deal with static camera angles and pre-rendered backgrounds. Problem is, if I change a camera angle/position in blender I’d have to re-export the level back to Unity. So I was wondering if I could just write a script that helps ease the process for me by just writing out the cameras positions to a file and then I could just read that from Unity. I looked up blender scripting and I found out that I could either do it via a python script or blender addons? – I’m not sure about addons, like do I write C++ there? or … ?
The cameras in my blender scene have a consistent naming: Camera.N where N is the camera number (starts from 0)
I have no trouble writing python or C++ - but I’m not sure what the relevant API is.
PS: It would be nice if I could also access the camera’s fov. Currently, I’m writing the fov values manually to a file and then getting the values in unity and converting them to vertical fov (since blender uses horizontal fov and unity vertical)
An example file/output of what I would like to do:
Camera.1: p: 10.2, 0, 1 r: 12, 30, 0 fov: 30
Camera.2: p: etc
p: position, r: rotation
Any pointers or guides are appreciated.
Cheers!