15549
|
|
|
Dietrich Bollmann |
13 years ago
|
|
|
15548
|
|
|
Dietrich Bollmann |
13 years ago
|
|
|
15547
|
|
|
Dietrich Bollmann |
13 years ago
|
|
|
15546
|
|
|
Dietrich Bollmann |
13 years ago
|
|
|
15545
|
|
|
Dietrich Bollmann |
13 years ago
|
|
|
15544
|
|
|
Dietrich Bollmann |
13 years ago
|
|
|
15543
|
|
|
Dietrich Bollmann |
13 years ago
|
|
|
15542
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15541
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15540
|
|
* Finally the blender 2.5 command port works again :)
Fixed the blender context error by using the hack from function run_python() (file: blender/source/creator/creator.c) and borrowing the bpy.context.scene from the first window in the wm window queue...
Example:
# starting the server:
blender -p 10 10 800 600 --command-port 6789
> found bundled python: /home/dietrich/blendev/bazaar/blender/working/branches/blender-command-port/install/linux2/.blender/python > Starting the Blender command port - listening on port 6789.
# starting the client:
blash --port 6789
> This is Blash - the GNU BLender-Again SHell :) > Connection to Blender Server established. (IP address: 127.0.0.1, port: 6789)
import bpy bpy.ops.mesh.primitive_monkey_add(layer = [True]+[False]*31)
> {'FINISHED'}
bpy.ops.mesh.primitive_monkey_add(view_align = False, enter_editmode = False, location = (0, 0, 0), rotation = (0, 0, 0), layer = [True]+[False]*31)
> {'FINISHED'}
quit
> bye...
TODO:
- To see the newly created mesh I currently have to cause a redraw of the GUI by moving the mouse over the blender window... ...Have to find a way to redraw the window from the bash shell.
- When executing the following code, the result is printed twice (and probably the code is executed twice also...).
| >>> for i in range(3): | ... print(i) | 0 | 1 | 2 | ... | 0 | 1 | 2 | >>>
- If a better way is found for setting the context in function run_python() (file: blender/source/creator/creator.c) adapt the command port code also!
|
Dietrich Bollmann |
14 years ago
|
|
|
15539
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15538
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15537
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15536
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15535
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15534
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15533
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15532
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15531
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|
15530
|
|
|
Dietrich Bollmann |
14 years ago
|
|
|