2
$\begingroup$

I'm new to Blender. I wrote a Python script where I sequentially read the camera poses from a csv file (real user traces), move the camera accordingly and render the scene. In my scene, there is a virtual object but for each camera trace, orientation of the camera is different so I have to manually re-adjust the position of the virtual object for it to fall within the camera viewport.

How can I set the location of the object automatically, depending on the camera orientation? Assume a constant distance between the camera and the object, I just want to adjust the orientation.

$\endgroup$

1 Answer 1

2
$\begingroup$

Just parent your object to the camera (adjust the position one time manually) and it will stay forever in the middle.

Like this:

enter image description here

result:

enter image description here

$\endgroup$
2
  • $\begingroup$ What if I want to do this only once at the beginning? I want to put the object in the center of the camera viewport for the first camera position and then not move it again. Similar to "Align active camera to view" but the other way around, i.e. align the object to the active camera. Can I do this using the Python APi? $\endgroup$ Commented Dec 2, 2021 at 10:57
  • $\begingroup$ you could add a child of constraint instead of parenting it. Then you can animate the influence value. If my answer helped you, please check the checkmark left to my answer. If you have other/further questions, please open a new question. Thanks. $\endgroup$
    – Chris
    Commented Dec 2, 2021 at 12:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .