Fix #112083: Loop cut requires GL only in interactive mode #112121

Merged
YimingWu merged 2 commits from ChengduLittleA/blender:fix-112083 into main 2023-09-18 15:45:24 +02:00
1 changed files with 3 additions and 0 deletions
Showing only changes of commit 243c933114 - Show all commits

View File

@ -374,6 +374,9 @@ static void loopcut_mouse_move(RingSelOpData *lcd, const int previewlines)
/* called by both init() and exec() */
static int loopcut_init(bContext *C, wmOperator *op, const wmEvent *event)
{
/* Check whether both `rv3d` and `event` is present, this way we allow the loopcut operator to
* run non-interactively no matter whether the graphical UI is present or not (e.g. from scripts
* with UI running, or entirely in the background with `blender -b`). */
RegionView3D *rv3d = CTX_wm_region_view3d(C);
const bool is_interactive = (rv3d != nullptr) && (event != nullptr);