Fix T51501: Cycles baking cancel affects baking script

Basically upon invoking cycles baking we could canell it which would
leave G.is_break hanging as true. Since we were not setting is_break to
false before exec baking, it would misbehave.
This commit is contained in:
Dalai Felinto 2017-05-15 13:04:41 +02:00
parent df94f2f399
commit b60f80e9b3
Notes: blender-bot 2023-02-14 06:59:06 +01:00
Referenced by issue #51501, Cycles Baking from Script
1 changed files with 4 additions and 0 deletions

View File

@ -1172,6 +1172,9 @@ static int bake_exec(bContext *C, wmOperator *op)
BakeAPIRender bkr = {NULL};
Scene *scene = CTX_data_scene(C);
G.is_break = false;
G.is_rendering = true;
bake_set_props(op, scene);
bake_init_api_data(op, C, &bkr);
@ -1223,6 +1226,7 @@ static int bake_exec(bContext *C, wmOperator *op)
finally:
G.is_rendering = false;
BLI_freelistN(&bkr.selected_objects);
return result;
}