[Bf-blender-cvs] [5fc252feaea] blender-v2.83-release: Fix crash running "Edit Voxel Size" operator outside of a main 3D View region
Julian Eisel
noreply at git.blender.org
Thu Jun 18 10:15:23 CEST 2020
Commit: 5fc252feaeab0e86799c59eb328e64e71328b816
Author: Julian Eisel
Date: Mon Jun 8 15:42:50 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB5fc252feaeab0e86799c59eb328e64e71328b816
Fix crash running "Edit Voxel Size" operator outside of a main 3D View region
Accessed `RegionView3D` data from context, which of course would only be set if
actually executed from a main 3D View region.
===================================================================
M source/blender/editors/object/object_remesh.c
===================================================================
diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c
index 9f9179440a8..313d2a2db90 100644
--- a/source/blender/editors/object/object_remesh.c
+++ b/source/blender/editors/object/object_remesh.c
@@ -584,6 +584,11 @@ static int voxel_size_edit_invoke(bContext *C, wmOperator *op, const wmEvent *ev
return OPERATOR_RUNNING_MODAL;
}
+static bool voxel_size_edit_poll(bContext *C)
+{
+ return CTX_wm_region_view3d(C) && object_remesh_poll(C);
+}
+
void OBJECT_OT_voxel_size_edit(wmOperatorType *ot)
{
/* identifiers */
@@ -592,7 +597,7 @@ void OBJECT_OT_voxel_size_edit(wmOperatorType *ot)
ot->idname = "OBJECT_OT_voxel_size_edit";
/* api callbacks */
- ot->poll = object_remesh_poll;
+ ot->poll = voxel_size_edit_poll;
ot->invoke = voxel_size_edit_invoke;
ot->modal = voxel_size_edit_modal;
ot->cancel = voxel_size_edit_cancel;
More information about the Bf-blender-cvs
mailing list