Merged changes in the trunk up to revision 30397.

This commit is contained in:
2010-07-15 21:05:11 +00:00
90 changed files with 675 additions and 694 deletions

View File

@@ -565,10 +565,9 @@ def rna2sphinx(BASEPATH):
fw(" %s\n\n" % struct.description)
# properties sorted in alphabetical order
zip_props_ids = zip(struct.properties, [prop.identifier for prop in struct.properties])
zip_props_ids = sorted(zip_props_ids, key=lambda p: p[1])
sorted_struct_properties = [x[0] for x in zip_props_ids]
sorted_struct_properties = struct.properties[:]
sorted_struct_properties.sort(key=lambda prop: prop.identifier)
for prop in sorted_struct_properties:
type_descr = prop.get_type_description(class_fmt=":class:`%s`")
# readonly properties use "data" directive, variables properties use "attribute" directive

View File

@@ -27,9 +27,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
/* This file is the Blender.BGL part of opy_draw.c, from the old
* bpython/intern dir, with minor changes to adapt it to the new Python
* implementation. The BGL submodule "wraps" OpenGL functions and constants,
/* This file is the 'bgl' module.
* The BGL submodule "wraps" OpenGL functions and constants,
* allowing script writers to make OpenGL calls in their Python scripts. */
#include "bgl.h" /*This must come first */

View File

@@ -43,33 +43,23 @@
#include "BPy_Freestyle.h"
static char bpy_home_paths_doc[] =
".. function:: home_paths(subfolder)\n"
static char bpy_script_paths_doc[] =
".. function:: script_paths()\n"
"\n"
" Return 3 paths to blender home directories.\n"
" Return 2 paths to blender scripts directories.\n"
"\n"
" :arg subfolder: The name of a subfolder to find within the blenders home directory.\n"
" :type subfolder: string\n"
" :return: (system, local, user) strings will be empty when not found.\n"
" :return: (system, user) strings will be empty when not found.\n"
" :rtype: tuple of strigs\n";
PyObject *bpy_home_paths(PyObject *self, PyObject *args)
PyObject *bpy_script_paths(PyObject *self)
{
PyObject *ret= PyTuple_New(3);
PyObject *ret= PyTuple_New(2);
char *path;
char *subfolder= "";
if (!PyArg_ParseTuple(args, "|s:blender_homes", &subfolder))
return NULL;
path= BLI_gethome_folder(subfolder, BLI_GETHOME_SYSTEM);
path= BLI_get_folder(BLENDER_USER_SCRIPTS, NULL);
PyTuple_SET_ITEM(ret, 0, PyUnicode_FromString(path?path:""));
path= BLI_gethome_folder(subfolder, BLI_GETHOME_LOCAL);
path= BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL);
PyTuple_SET_ITEM(ret, 1, PyUnicode_FromString(path?path:""));
path= BLI_gethome_folder(subfolder, BLI_GETHOME_USER);
PyTuple_SET_ITEM(ret, 2, PyUnicode_FromString(path?path:""));
return ret;
}
@@ -122,7 +112,7 @@ static PyObject *bpy_blend_paths(PyObject * self, PyObject *args, PyObject *kw)
return list;
}
static PyMethodDef meth_bpy_home_paths[] = {{ "home_paths", (PyCFunction)bpy_home_paths, METH_VARARGS, bpy_home_paths_doc}};
static PyMethodDef meth_bpy_script_paths[] = {{ "script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc}};
static PyMethodDef meth_bpy_blend_paths[] = {{ "blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc}};
static void bpy_import_test(char *modname)
@@ -194,7 +184,7 @@ void BPy_init_modules( void )
PyModule_AddObject(mod, "context", (PyObject *)bpy_context_module);
/* utility func's that have nowhere else to go */
PyModule_AddObject(mod, meth_bpy_home_paths->ml_name, (PyObject *)PyCFunction_New(meth_bpy_home_paths, NULL));
PyModule_AddObject(mod, meth_bpy_script_paths->ml_name, (PyObject *)PyCFunction_New(meth_bpy_script_paths, NULL));
PyModule_AddObject(mod, meth_bpy_blend_paths->ml_name, (PyObject *)PyCFunction_New(meth_bpy_blend_paths, NULL));
/* add our own modules dir, this is a python package */