Merged changes in the trunk up to revision 38543.
Conflicts resolved: doc/python_api/sphinx_doc_gen.py source/blender/blenkernel/CMakeLists.txt source/blender/makesdna/DNA_material_types.h source/blender/render/intern/source/pipeline.c source/creator/CMakeLists.txt
This commit is contained in:
@@ -25,13 +25,13 @@
|
||||
|
||||
set(INC
|
||||
..
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../blenloader
|
||||
../../editors/include
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../blenkernel
|
||||
../../blenloader
|
||||
../../windowmanager
|
||||
../../editors/include
|
||||
../../freestyle/intern/python
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
@@ -89,9 +89,6 @@ if(WITH_PYTHON_SAFETY)
|
||||
endif()
|
||||
|
||||
if(WITH_AUDASPACE)
|
||||
list(APPEND INC
|
||||
../../../intern/audaspace/intern
|
||||
)
|
||||
add_definitions(-DWITH_AUDASPACE)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
/* external util modules */
|
||||
#include "../generic/mathutils.h"
|
||||
#include "../generic/IDProp.h"
|
||||
#include "../generic/bgl.h"
|
||||
#include "../generic/blf_py_api.h"
|
||||
#include "../generic/IDProp.h"
|
||||
#include "../mathutils/mathutils.h"
|
||||
|
||||
#include "BPy_Freestyle.h"
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
|
||||
#include "bpy_driver.h"
|
||||
|
||||
#include "../generic/py_capi_utils.h"
|
||||
|
||||
/* for pydrivers (drivers using one-line Python expressions to express relationships between targets) */
|
||||
PyObject *bpy_pydriver_Dict= NULL;
|
||||
|
||||
@@ -87,7 +89,7 @@ int bpy_pydriver_create_dict(void)
|
||||
void BPY_driver_reset(void)
|
||||
{
|
||||
PyGILState_STATE gilstate;
|
||||
int use_gil= 1; // (PyThreadState_Get()==NULL);
|
||||
int use_gil= !PYC_INTERPRETER_ACTIVE;
|
||||
|
||||
if(use_gil)
|
||||
gilstate= PyGILState_Ensure();
|
||||
@@ -120,7 +122,7 @@ static void pydriver_error(ChannelDriver *driver)
|
||||
*
|
||||
* note: PyGILState_Ensure() isnt always called because python can call the
|
||||
* bake operator which intern starts a thread which calls scene update which
|
||||
* does a driver update. to avoid a deadlock check PyThreadState_Get() if PyGILState_Ensure() is needed.
|
||||
* does a driver update. to avoid a deadlock check PYC_INTERPRETER_ACTIVE if PyGILState_Ensure() is needed.
|
||||
*/
|
||||
float BPY_driver_exec(ChannelDriver *driver)
|
||||
{
|
||||
@@ -147,7 +149,7 @@ float BPY_driver_exec(ChannelDriver *driver)
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
use_gil= 1; //(PyThreadState_Get()==NULL);
|
||||
use_gil= !PYC_INTERPRETER_ACTIVE;
|
||||
|
||||
if(use_gil)
|
||||
gilstate= PyGILState_Ensure();
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
#include "../generic/py_capi_utils.h"
|
||||
|
||||
/* inittab initialization functions */
|
||||
#include "../generic/noise_py_api.h"
|
||||
#include "../generic/mathutils.h"
|
||||
#include "../generic/bgl.h"
|
||||
#include "../generic/blf_py_api.h"
|
||||
#include "../generic/noise_py_api.h"
|
||||
#include "../mathutils/mathutils.h"
|
||||
|
||||
/* for internal use, when starting and ending python scripts */
|
||||
|
||||
@@ -175,8 +175,8 @@ extern PyObject *AUD_initPython(void);
|
||||
|
||||
static struct _inittab bpy_internal_modules[]= {
|
||||
{(char *)"noise", BPyInit_noise},
|
||||
{(char *)"mathutils", BPyInit_mathutils},
|
||||
// {(char *)"mathutils.geometry", BPyInit_mathutils_geometry},
|
||||
{(char *)"mathutils", PyInit_mathutils},
|
||||
// {(char *)"mathutils.geometry", PyInit_mathutils_geometry},
|
||||
{(char *)"bgl", BPyInit_bgl},
|
||||
{(char *)"blf", BPyInit_blf},
|
||||
#ifdef WITH_AUDASPACE
|
||||
@@ -209,8 +209,6 @@ void BPY_python_start(int argc, const char **argv)
|
||||
|
||||
Py_Initialize();
|
||||
|
||||
bpy_intern_string_init();
|
||||
|
||||
// PySys_SetArgv(argc, argv); // broken in py3, not a huge deal
|
||||
/* sigh, why do python guys not have a char** version anymore? :( */
|
||||
{
|
||||
@@ -233,6 +231,8 @@ void BPY_python_start(int argc, const char **argv)
|
||||
PyImport_ExtendInittab(bpy_internal_modules);
|
||||
#endif
|
||||
|
||||
bpy_intern_string_init();
|
||||
|
||||
/* bpy.* and lets us import it */
|
||||
BPy_init_modules();
|
||||
|
||||
@@ -663,7 +663,9 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
|
||||
#include "BLI_storage.h"
|
||||
/* TODO, reloading the module isnt functional at the moment. */
|
||||
|
||||
extern int main_python(int argc, const char **argv);
|
||||
static void bpy_module_free(void *mod);
|
||||
extern int main_python_enter(int argc, const char **argv);
|
||||
extern void main_python_exit(void);
|
||||
static struct PyModuleDef bpy_proxy_def= {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"bpy", /* m_name */
|
||||
@@ -673,8 +675,8 @@ static struct PyModuleDef bpy_proxy_def= {
|
||||
NULL, /* m_reload */
|
||||
NULL, /* m_traverse */
|
||||
NULL, /* m_clear */
|
||||
NULL, /* m_free */
|
||||
};
|
||||
bpy_module_free, /* m_free */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
@@ -699,7 +701,7 @@ void bpy_module_delay_init(PyObject *bpy_proxy)
|
||||
|
||||
// printf("module found %s\n", argv[0]);
|
||||
|
||||
main_python(argc, argv);
|
||||
main_python_enter(argc, argv);
|
||||
|
||||
/* initialized in BPy_init_modules() */
|
||||
PyDict_Update(PyModule_GetDict(bpy_proxy), PyModule_GetDict(bpy_package_py));
|
||||
@@ -756,4 +758,9 @@ PyInit_bpy(void)
|
||||
return bpy_proxy;
|
||||
}
|
||||
|
||||
static void bpy_module_free(void *UNUSED(mod))
|
||||
{
|
||||
main_python_exit();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -346,7 +346,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
|
||||
static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item);
|
||||
|
||||
#ifdef USE_MATHUTILS
|
||||
#include "../generic/mathutils.h" /* so we can have mathutils callbacks */
|
||||
#include "../mathutils/mathutils.h" /* so we can have mathutils callbacks */
|
||||
|
||||
static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length);
|
||||
static short pyrna_rotation_euler_order_get(PointerRNA *ptr, PropertyRNA **prop_eul_order, short order_fallback);
|
||||
@@ -3847,9 +3847,11 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
|
||||
case PROP_RAW_DOUBLE:
|
||||
item= PyFloat_FromDouble((double) ((double *)array)[i]);
|
||||
break;
|
||||
case PROP_RAW_UNSET:
|
||||
default: /* PROP_RAW_UNSET */
|
||||
/* should never happen */
|
||||
BLI_assert(!"Invalid array type - get");
|
||||
item= Py_None;
|
||||
Py_INCREF(item);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4546,7 +4548,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type= {
|
||||
NULL, /* printfunc tp_print; */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */
|
||||
NULL, /* tp_compare */ /* deprecated in python 3.0! */
|
||||
NULL, /* tp_repr */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
Reference in New Issue
Block a user