On Mon, Sep 5, 2011 at 10:15 AM, Terry Brown <[email protected]> wrote:
> Be interested to know if you get that going - seems to me Jaworski did
> not do that, instead using a helper script activated from a button in
> Blender to start the script under development.
Rev 4450 contains the first draft of blender work. It's in test.leo:
@button blender-script @key=Alt-7
===========================
'''Run blender_script.py as a blender script.'''
import subprocess
args = [
r"C:\Program Files (x86)\Blender Foundation\Blender\blender.exe",
"-P",
r"C:/prog/blender_script.py", # *************** change as needed.
]
data = subprocess.Popen(args, None)
@file c:/prog/blender_script.py
=======================
print("Hello from c:/prog/blender_script.py")
print('Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props,
bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils')
print('Convenience Imports: from mathutils import *; from math import *')
# import sys
# for z in sys.path:
# print(z)
print('Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props,
bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils')
print('Convenience Imports: from mathutils import *; from math import *')
# from mathutils import *
# from math import *
import bpy
C = bpy.context
print('\ndir()...')
for z in dir():
print(z)
print('\ndir(bpy)...')
for z in dir(bpy):
print(z)
print('\ndir(C)...')
for z in dir(C):
print(z)
This shows that the environment in which the script executes is
basically the same as the environment that scripts execute in the
blender python console.
The drawback, at present, is that each Alt-7 brings up a new copy of
blender: I haven't found a way of connecting the script to an
already-running blender as is done in the vim plugin with vim's server
option.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.