Merged changes in the trunk up to revision 46557.
Conflicts resolved: source/blender/blenkernel/intern/material.c source/blender/blenkernel/intern/subsurf_ccg.c source/blender/blenloader/intern/readfile.c source/blender/editors/animation/anim_channels_defines.c source/blender/makesrna/intern/rna_scene.c Additional changes: * Fix for recent changes of BKE_* function renaming. * Fix for an "attempt to free NULL pointer" in BlenderStrokeRenderer::RenderStrokeRepBasic().
This commit is contained in:
@@ -96,7 +96,7 @@ static double bpy_timer_run_tot; /* accumulate python runs */
|
||||
#endif
|
||||
|
||||
/* use for updating while a python script runs - in case of file load */
|
||||
void bpy_context_update(bContext *C)
|
||||
void BPY_context_update(bContext *C)
|
||||
{
|
||||
/* don't do this from a non-main (e.g. render) thread, it can cause a race
|
||||
* condition on C->data.recursion. ideal solution would be to disable
|
||||
@@ -117,7 +117,7 @@ void bpy_context_set(bContext *C, PyGILState_STATE *gilstate)
|
||||
*gilstate = PyGILState_Ensure();
|
||||
|
||||
if (py_call_level == 1) {
|
||||
bpy_context_update(C);
|
||||
BPY_context_update(C);
|
||||
|
||||
#ifdef TIME_PY_RUN
|
||||
if (bpy_timer_count == 0) {
|
||||
@@ -178,7 +178,8 @@ void BPY_modules_update(bContext *C)
|
||||
|
||||
/* refreshes the main struct */
|
||||
BPY_update_rna_module();
|
||||
bpy_context_module->ptr.data = (void *)C;
|
||||
if(bpy_context_module)
|
||||
bpy_context_module->ptr.data = (void *)C;
|
||||
}
|
||||
|
||||
void BPY_context_set(bContext *C)
|
||||
@@ -623,7 +624,7 @@ void BPY_modules_load_user(bContext *C)
|
||||
/* update pointers since this can run from a nested script
|
||||
* on file load */
|
||||
if (py_call_level) {
|
||||
bpy_context_update(C);
|
||||
BPY_context_update(C);
|
||||
}
|
||||
|
||||
bpy_context_set(C, &gilstate);
|
||||
|
||||
@@ -1550,9 +1550,13 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
|
||||
}
|
||||
else {
|
||||
int param_i = (int)param;
|
||||
RNA_property_int_clamp(ptr, prop, ¶m_i);
|
||||
if (data) *((int *)data) = param_i;
|
||||
else RNA_property_int_set(ptr, prop, param_i);
|
||||
if (data) {
|
||||
RNA_property_int_clamp(ptr, prop, ¶m_i);
|
||||
*((int *)data) = param_i;
|
||||
}
|
||||
else {
|
||||
RNA_property_int_set(ptr, prop, param_i);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1567,9 +1571,13 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
RNA_property_float_clamp(ptr, prop, (float *)¶m);
|
||||
if (data) *((float *)data) = param;
|
||||
else RNA_property_float_set(ptr, prop, param);
|
||||
if (data) {
|
||||
RNA_property_float_clamp(ptr, prop, (float *)¶m);
|
||||
*((float *)data) = param;
|
||||
}
|
||||
else {
|
||||
RNA_property_float_set(ptr, prop, param);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -6339,11 +6347,13 @@ PyObject *BPY_rna_module(void)
|
||||
|
||||
void BPY_update_rna_module(void)
|
||||
{
|
||||
if(rna_module_ptr) {
|
||||
#if 0
|
||||
RNA_main_pointer_create(G.main, rna_module_ptr);
|
||||
RNA_main_pointer_create(G.main, rna_module_ptr);
|
||||
#else
|
||||
rna_module_ptr->data = G.main; /* just set data is enough */
|
||||
rna_module_ptr->data = G.main; /* just set data is enough */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -49,7 +49,6 @@ short BPy_errors_to_report(struct ReportList *reports);
|
||||
struct bContext *BPy_GetContext(void);
|
||||
void BPy_SetContext(struct bContext *C);
|
||||
|
||||
extern void bpy_context_update(struct bContext *C);
|
||||
extern void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate);
|
||||
extern void bpy_context_clear(struct bContext *C, PyGILState_STATE *gilstate);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user