Merged changes in the trunk up to revision 27226 (Blender 2.5 alpha 2 release point).
This commit is contained in:
@@ -37,7 +37,8 @@
|
||||
/* external util modules */
|
||||
#include "../generic/Mathutils.h"
|
||||
#include "../generic/Geometry.h"
|
||||
#include "../generic/BGL.h"
|
||||
#include "../generic/bgl.h"
|
||||
#include "../generic/blf.h"
|
||||
#include "../generic/IDProp.h"
|
||||
|
||||
#include "BPy_Freestyle.h"
|
||||
@@ -108,6 +109,7 @@ void BPy_init_modules( void )
|
||||
Geometry_Init();
|
||||
Mathutils_Init();
|
||||
BGL_Init();
|
||||
BLF_Init();
|
||||
IDProp_Init_Types();
|
||||
Freestyle_Init();
|
||||
|
||||
|
||||
@@ -32,17 +32,11 @@
|
||||
#include "structseq.h"
|
||||
|
||||
#ifdef BUILD_DATE
|
||||
extern char * build_date;
|
||||
extern char * build_time;
|
||||
extern char * build_rev;
|
||||
extern char * build_platform;
|
||||
extern char * build_type;
|
||||
#else
|
||||
static char * build_date = "Unknown";
|
||||
static char * build_time = "Unknown";
|
||||
static char * build_rev = "Unknown";
|
||||
static char * build_platform = "Unknown";
|
||||
static char * build_type = "Unknown";
|
||||
extern const char * build_date;
|
||||
extern const char * build_time;
|
||||
extern const char * build_rev;
|
||||
extern const char * build_platform;
|
||||
extern const char * build_type;
|
||||
#endif
|
||||
|
||||
static PyTypeObject BlenderAppType;
|
||||
@@ -111,11 +105,19 @@ static PyObject *make_app_info(void)
|
||||
SetObjItem(PyBool_FromLong(G.f & G_DEBUG));
|
||||
|
||||
/* build info */
|
||||
#ifdef BUILD_DATE
|
||||
SetStrItem(strip_quotes(buf, build_date));
|
||||
SetStrItem(strip_quotes(buf, build_time));
|
||||
SetStrItem(strip_quotes(buf, build_rev));
|
||||
SetStrItem(strip_quotes(buf, build_platform));
|
||||
SetStrItem(strip_quotes(buf, build_type));
|
||||
#else
|
||||
SetStrItem(strip_quotes(buf, "Unknown"));
|
||||
SetStrItem(strip_quotes(buf, "Unknown"));
|
||||
SetStrItem(strip_quotes(buf, "Unknown"));
|
||||
SetStrItem(strip_quotes(buf, "Unknown"));
|
||||
SetStrItem(strip_quotes(buf, "Unknown"));
|
||||
#endif
|
||||
|
||||
#undef SetIntItem
|
||||
#undef SetStrItem
|
||||
|
||||
@@ -2663,7 +2663,7 @@ static struct PyMethodDef pyrna_struct_methods[] = {
|
||||
|
||||
/* maybe this become and ID function */
|
||||
{"keyframe_insert", (PyCFunction)pyrna_struct_keyframe_insert, METH_VARARGS, NULL},
|
||||
// {"keyframe_delete", (PyCFunction)pyrna_struct_keyframe_delete, METH_VARARGS, NULL}, // WIP
|
||||
{"keyframe_delete", (PyCFunction)pyrna_struct_keyframe_delete, METH_VARARGS, NULL},
|
||||
{"driver_add", (PyCFunction)pyrna_struct_driver_add, METH_VARARGS, NULL},
|
||||
{"is_property_set", (PyCFunction)pyrna_struct_is_property_set, METH_VARARGS, NULL},
|
||||
{"is_property_hidden", (PyCFunction)pyrna_struct_is_property_hidden, METH_VARARGS, NULL},
|
||||
|
||||
@@ -32,12 +32,9 @@
|
||||
#include "BKE_context.h"
|
||||
#include "ED_space_api.h"
|
||||
|
||||
EnumPropertyItem region_draw_mode_items[] = {
|
||||
{REGION_DRAW_POST_VIEW, "POST_VIEW", 0, "Pose View", ""},
|
||||
{REGION_DRAW_POST_PIXEL, "POST_PIXEL", 0, "Post Pixel", ""},
|
||||
{REGION_DRAW_PRE_VIEW, "PRE_VIEW", 0, "Pre View", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
/* use this to stop other capsules from being mis-used */
|
||||
#define RNA_CAPSULE_ID "RNA_HANDLE"
|
||||
#define RNA_CAPSULE_ID_INVALID "RNA_HANDLE_REMOVED"
|
||||
|
||||
void cb_region_draw(const bContext *C, ARegion *ar, void *customdata)
|
||||
{
|
||||
@@ -74,6 +71,12 @@ PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args)
|
||||
|
||||
if(RNA_struct_is_a(self->ptr.type, &RNA_Region)) {
|
||||
|
||||
static EnumPropertyItem region_draw_mode_items[] = {
|
||||
{REGION_DRAW_POST_VIEW, "POST_VIEW", 0, "Pose View", ""},
|
||||
{REGION_DRAW_POST_PIXEL, "POST_PIXEL", 0, "Post Pixel", ""},
|
||||
{REGION_DRAW_PRE_VIEW, "PRE_VIEW", 0, "Pre View", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
if(pyrna_enum_value_from_id(region_draw_mode_items, cb_event_str, &cb_event, "bpy_struct.callback_add()") < 0)
|
||||
return NULL;
|
||||
|
||||
@@ -81,24 +84,28 @@ PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args)
|
||||
Py_INCREF(args);
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "callbcak_add(): type does not suppport cllbacks");
|
||||
PyErr_SetString(PyExc_TypeError, "callback_add(): type does not suppport callbacks");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return PyCapsule_New((void *)handle, NULL, NULL);
|
||||
return PyCapsule_New((void *)handle, RNA_CAPSULE_ID, NULL);
|
||||
}
|
||||
|
||||
PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
PyObject *py_handle;
|
||||
PyObject *py_args;
|
||||
void *handle;
|
||||
void *customdata;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O!:callback_remove", &PyCapsule_Type, &py_handle))
|
||||
return NULL;
|
||||
|
||||
handle= PyCapsule_GetPointer(py_handle, NULL);
|
||||
handle= PyCapsule_GetPointer(py_handle, RNA_CAPSULE_ID);
|
||||
|
||||
if(handle==NULL) {
|
||||
PyErr_SetString(PyExc_ValueError, "callback_remove(handle): NULL handle given, invalid or already removed.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(RNA_struct_is_a(self->ptr.type, &RNA_Region)) {
|
||||
customdata= ED_region_draw_cb_customdata(handle);
|
||||
@@ -107,5 +114,8 @@ PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args)
|
||||
ED_region_draw_cb_exit(((ARegion *)self->ptr.data)->type, handle);
|
||||
}
|
||||
|
||||
/* dont allow reuse */
|
||||
PyCapsule_SetName(py_handle, RNA_CAPSULE_ID_INVALID);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user