Determining blender commands to be used in python scripts?

How do I determine the proper commands to be added to a python script to control blender? Say, I want to write a python script that sets my material color differently or modifies an object or something… is there a way to do that action in blender and see the blender related code to do it? As an example, here is some code that selects a camera:


Now, how did you guys come up with that? In this specific instance, I am trying to modify the resolution settings to a different number. But, I thought I’d ask you guys how to fish rather than just asking for a fish.


perhaps you should consult Blender’s Python API Reference to get the proper commands and syntax.

for further python specific questions you may go to the python forum here in this place

Thanks, I’ll start reading through there and I also posted my specific question here:


This is just standard Object Oriented programming trickery. Functions (methods) like Object.Get() return an actual object and not just a value like sin() or sqrt(). This means you can chain commands together like the example shows.

Another way to write the code snippet above is to break it down into its component parts:

cam = Object.Get(“Camera01”)
scene = Scene.getCurrent()
scene.setCurrentCamera( cam )