- fix for crash if drivers were used in the .B.blend
- fix for problem where proxy objects could enter editmode but not exit
This commit is contained in:
@@ -499,6 +499,10 @@ static int editmode_toggle_poll(bContext *C)
|
|||||||
{
|
{
|
||||||
Object *ob = CTX_data_active_object(C);
|
Object *ob = CTX_data_active_object(C);
|
||||||
|
|
||||||
|
/* covers proxies too */
|
||||||
|
if(ob->data==NULL || ((ID *)ob->data)->lib)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return ob && (ob->type == OB_MESH || ob->type == OB_ARMATURE ||
|
return ob && (ob->type == OB_MESH || ob->type == OB_ARMATURE ||
|
||||||
ob->type == OB_FONT || ob->type == OB_MBALL ||
|
ob->type == OB_FONT || ob->type == OB_MBALL ||
|
||||||
ob->type == OB_LATTICE || ob->type == OB_SURF ||
|
ob->type == OB_LATTICE || ob->type == OB_SURF ||
|
||||||
|
@@ -698,8 +698,13 @@ int BPY_button_eval(bContext *C, char *expr, double *value)
|
|||||||
void BPY_load_user_modules(bContext *C)
|
void BPY_load_user_modules(bContext *C)
|
||||||
{
|
{
|
||||||
PyGILState_STATE gilstate;
|
PyGILState_STATE gilstate;
|
||||||
|
Main *bmain= CTX_data_main(C);
|
||||||
Text *text;
|
Text *text;
|
||||||
|
|
||||||
|
/* can happen on file load */
|
||||||
|
if(bmain==NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
bpy_context_set(C, &gilstate);
|
bpy_context_set(C, &gilstate);
|
||||||
|
|
||||||
for(text=CTX_data_main(C)->text.first; text; text= text->id.next) {
|
for(text=CTX_data_main(C)->text.first; text; text= text->id.next) {
|
||||||
|
@@ -50,7 +50,7 @@ typedef struct wmJob wmJob;
|
|||||||
/* general API */
|
/* general API */
|
||||||
void WM_setprefsize (int stax, int stay, int sizx, int sizy);
|
void WM_setprefsize (int stax, int stay, int sizx, int sizy);
|
||||||
|
|
||||||
void WM_init (struct bContext *C);
|
void WM_init (struct bContext *C, int argc, char **argv);
|
||||||
void WM_exit (struct bContext *C);
|
void WM_exit (struct bContext *C);
|
||||||
void WM_main (struct bContext *C);
|
void WM_main (struct bContext *C);
|
||||||
|
|
||||||
|
@@ -106,9 +106,9 @@ static void wm_free_reports(bContext *C)
|
|||||||
|
|
||||||
|
|
||||||
/* only called once, for startup */
|
/* only called once, for startup */
|
||||||
void WM_init(bContext *C)
|
void WM_init(bContext *C, int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!G.background) {
|
if (!G.background) {
|
||||||
wm_ghost_init(C); /* note: it assigns C to ghost! */
|
wm_ghost_init(C); /* note: it assigns C to ghost! */
|
||||||
wm_init_cursor_data();
|
wm_init_cursor_data();
|
||||||
@@ -129,9 +129,18 @@ void WM_init(bContext *C)
|
|||||||
|
|
||||||
init_builtin_keyingsets(); /* editors/animation/keyframing.c */
|
init_builtin_keyingsets(); /* editors/animation/keyframing.c */
|
||||||
|
|
||||||
|
/* python needs initializing before loading the .B.blend
|
||||||
|
* because it may contain PyDrivers. It also needs to be after
|
||||||
|
* initializing space types and other internal data */
|
||||||
|
#ifndef DISABLE_PYTHON
|
||||||
|
BPY_set_context(C); /* necessary evil */
|
||||||
|
BPY_start_python(argc, argv);
|
||||||
|
BPY_load_user_modules(C);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* get the default database, plus a wm */
|
/* get the default database, plus a wm */
|
||||||
WM_read_homefile(C, NULL);
|
WM_read_homefile(C, NULL);
|
||||||
|
|
||||||
wm_init_reports(C); /* reports cant be initialized before the wm */
|
wm_init_reports(C); /* reports cant be initialized before the wm */
|
||||||
|
|
||||||
if (!G.background) {
|
if (!G.background) {
|
||||||
|
@@ -493,13 +493,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WM_init(C);
|
WM_init(C, argc, argv);
|
||||||
|
|
||||||
#ifndef DISABLE_PYTHON
|
|
||||||
BPY_set_context(C); /* necessary evil */
|
|
||||||
BPY_start_python(argc, argv);
|
|
||||||
BPY_load_user_modules(C);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// XXX BRECHT SOLVE
|
// XXX BRECHT SOLVE
|
||||||
BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */
|
BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */
|
||||||
@@ -539,13 +533,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WM_init(C);
|
WM_init(C, argc, argv);
|
||||||
|
|
||||||
#ifndef DISABLE_PYTHON
|
|
||||||
BPY_set_context(C); /* necessary evil */
|
|
||||||
BPY_start_python(argc, argv);
|
|
||||||
BPY_load_user_modules(C);
|
|
||||||
#endif
|
|
||||||
BLI_where_is_temp( btempdir, 0 ); /* call after loading the .B.blend so we can read U.tempdir */
|
BLI_where_is_temp( btempdir, 0 ); /* call after loading the .B.blend so we can read U.tempdir */
|
||||||
}
|
}
|
||||||
#ifndef DISABLE_PYTHON
|
#ifndef DISABLE_PYTHON
|
||||||
|
Reference in New Issue
Block a user