* Matches the C/RNA api structure * Thin wrapper ~(600 lines) * No functions specific to any blender object type. * Defines 2 types, BPy_StructRNA and BPy_PropertyRNA. * Python 3.0 target (compatible with python 2.4,5,6) * http://wiki.blender.org/index.php/BlenderDev/Blender2.5/PyRNA - continue docs/discussion here. Todo * Collection iterators * Write access to data * Define how constants should be accessed (as strings or some special type) * Solve the "Python keeping invalid blender pointers" problem. This cant just be solved in the py api - we need blender to notify when ID's are removed Examples Here are some examples that work with the current implementation of the api. rna.lamps["Lamp.006"].energy -> (1.0) rna.lamps["Lamp.007"].shadow -> ("NOSHADOW") rna.materials.keys() -> ['flyingsquirrel_eye', 'frankie_skin', 'frankie_theeth'] rna.scenes["hud"].objects["num_text_p2_4"].data.novnormalflip -> False rna.meshes["mymesh"].uv_layers.keys() -> ['UVTex', 'UVTex'] rna.meshes.items() For a dump of yo-frankie level see - http://pasteall.org/3294/python Notes * Added python back, can only execute scripts from the command line with -P script.py * bpy_interface.c is just enough functionality to run a python file.
17 lines
569 B
Python
17 lines
569 B
Python
#!/usr/bin/python
|
|
Import ('env')
|
|
|
|
sources = env.Glob('intern/*.c')
|
|
|
|
incs = '. ../editors/include ../makesdna ../makesrna ../blenlib ../blenkernel ../nodes'
|
|
incs += ' ../imbuf ../blenloader ../render/extern/include'
|
|
incs += ' #intern/guardedalloc #intern/memutil'
|
|
incs += ' ' + env['BF_PYTHON_INC']
|
|
|
|
defs = []
|
|
|
|
if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc') and env['BF_DEBUG']:
|
|
defs.append('Py_TRACE_REFS')
|
|
|
|
env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','intern'], priority = [33,43])
|