Take the 2-minute tour ×
Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. It's 100% free, no registration required.

My friend told me that you could create games in blender and it has an game engine in it. Now I want to do some simple things with blender such as rolling ball, the topic now in this question.

enter image description here

Basically, my problem contain

Problems

  1. a learning problem and reference-request.

  2. I am using DVO -layout where many keys such as " and ' are broken -- and many hotkeys are broken (things are apparently hard-coded to QWE -layout).

  3. I find it hard to find help about using python inside Blender, besides broken window-paste-board in X, lack of TAB as auto-completion and lack of good examples.

Helper questions

  1. what kind of modules and functions does it have to edit and tune the Blender -objects?

  2. How can I do a rolling ball such as from (-500,0) to (50,0) with 7-turns in 7 seconds?

  3. Is it possible to handle basic operations in the Python console?

  4. Where can I find Blender-Python code to see examples?

  5. How can I render and open up the render-result to a new window with the console?

share|improve this question
add comment

1 Answer

Answers

I. a learning problem and reference-request.

Please, see very good examples here. The code can also become useful here. Good tutorial video here. Main docs here.

II. I am using DVO -layout where many keys such as " and ' are broken -- and many hotkeys are broken (things are apparently hard-coded to QWE -layout).

Press AltGr + <quote key> or select no-dead-key-keyboard, keys such as shift-space tend to interrupt with Blender -keys.

III. I find it hard to find help about using python inside Blender, besides broken window-paste-board in X, lack of TAB as auto-completion and lack of good examples.

The key is auto-completion (not with TAB for some odd reason but CTRL+SPACE) and the key command is $ bpy. I haven't yet found a solution for the clipboard, investigating.

Example 1: specify a ball to origin with Python in Blender

Select your ball in 3D mode and then:

$ bpy.context.object.location.xyz=[0,0,0] 

so you have your ball in origin.

Animation

It is not easy to explain this so some puzzles while also working on it.

Puzze 0: show the details about things

>>> for object in bpy.data.objects: 
         print(object.name + " is at location " + str(object.location))

Puzzle 1: create cubes (source)

 >>> mylayers = [False]*20
 >>> mylayers[0] = True
 >>> add_cube = bpy.ops.mesh.primitive_cube_add
 >>> for index in range(0, 5):
 ...     add_cube(location=(index*3, 0, 0), layers=mylayers)

Puzzle 2: perhaps useful things

>>> bpy.context.object.animation_
data
data_clear(
data_create(
visualisation

Related Questions

  1. http://stackoverflow.com/questions/10972637/how-can-i-access-bpy-in-standard-python-console-bpy-is-the-blender-python-thin/10973302#10973302

  2. http://stackoverflow.com/questions/3924294/blender-python-scripting-tutorials?rq=1

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.