Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-06-08 16:42:50 +0300
committerJeroen Bakker <jeroen@blender.org>2020-06-18 10:08:30 +0300
commit5fc252feaeab0e86799c59eb328e64e71328b816 (patch)
tree5cc26e22224a486e9d58cf912d254b4a3e748ecf /source
parent296e3ee62c284c601e12c010dc1ec7cbb95af663 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/object_remesh.c7
1 files changed, 6 insertions, 1 deletions
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;