Fix #115153: Snap Base in Camera View crashes Blender
Snap to geometry is not supported when moving camera in camera view. This is because the camera would make jumps that would be difficult to predict and control. The same happens if Snap Base were supported. Therefore, disable Edit Snap Base when transforming camera into camera view.
This commit is contained in:
@@ -707,6 +707,10 @@ static bool transform_modal_item_poll(const wmOperator *op, int value)
|
||||
/* More modes can be added over time if this feature proves useful for them. */
|
||||
return false;
|
||||
}
|
||||
if (t->options & CTX_CAMERA) {
|
||||
/* Not supported. */
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TFM_MODAL_PASSTHROUGH_NAVIGATE:
|
||||
|
||||
@@ -165,6 +165,12 @@ void transform_mode_snap_source_init(TransInfo *t, wmOperator * /*op*/)
|
||||
return;
|
||||
}
|
||||
|
||||
if (t->tsnap.snap_target_fn) {
|
||||
/* A `snap_target_fn` is required for the operation to work.
|
||||
* `snap_target_fn` can be `nullptr` when transforming camera in camera view. */
|
||||
return;
|
||||
}
|
||||
|
||||
if (ELEM(t->mode, TFM_INIT, TFM_DUMMY)) {
|
||||
/* Fallback */
|
||||
transform_mode_init(t, nullptr, TFM_TRANSLATION);
|
||||
|
||||
Reference in New Issue
Block a user