A way to set the background image and texture from Python?


I want to create some image data in Python and directly set it as background image in the 3D view. (like seeing yourself from the webcam). Is this possible with the Python API?

And additional: Can I also create/modifiy texturedata from memory? Like seeing yourself from the webcam on a quad. Again with the Python API.

Tip: When you mouseover a button, it will give you a path to the operator that the button runs.

And now that I look into your question, I realize that I don’t know how to do that either. :stuck_out_tongue:

For Blender python questions you should try the Python Support forum. If there’s an answer to be had you’ll find it there. This forum is geared toward C and the Blender source code.

Except that the interface of Blender is largely implemented with Python.


Um, right.
Maybe I can set a new background image, but,
how do I know if an image from bpy.data.images[:]
is being used as a background?

Better yet: how do I pick out the (or, the first) background image in the .blend file?

I’ve been trying for hours, and keep getting error messages. :spin:

See “Low Level” paragraph: http://blender.stackexchange.com/a/6105/1363
It shows how to set a background image properly.

If you want to capture live video, or access a webcam in another way, then better seach for relevant python packages…

Perfect: thank you! :cool: