panmari / stanford-shapenet-renderer

Scripts for batch rendering models using Blender. Tested with models from stanfords shapenet library.
MIT License
489 stars 96 forks source link

Camera matrix #31

Open JohnG0024 opened 2 years ago

JohnG0024 commented 2 years ago

Hello, is there a way to retrieve the camera RT matrix from a camera parented to empty with a constraint set tracked to the empty? I borrowed some code from your script to set up the camera and constraint and all, and tried to retrieve the RT matrix, but somehow it's not working correctly. Would you be able to help out? Test file here.

panmari commented 2 years ago

The file doesn't exist. Did you ever find a resolution? If yes, can you document it here to help others on a similar path?

mvoelk commented 1 year ago

I remember doing this via cam.matrix_world . To get the correct values I had to call

bpy.context.scene.view_layers['ViewLayer'].update()

first.