Fix: crash in transform.create_orientation on curves without a 3D view

This commit is contained in:
Campbell Barton
2025-03-19 03:32:34 +00:00
parent 484aed26d6
commit 7ecbe51522
2 changed files with 3 additions and 1 deletions

View File

@@ -1220,7 +1220,7 @@ int getTransformOrientation_ex(const Scene *scene,
}
}
else {
const bool use_handle = v3d->overlay.handle_display != CURVE_HANDLE_NONE;
const bool use_handle = v3d ? (v3d->overlay.handle_display != CURVE_HANDLE_NONE) : true;
for (nu = static_cast<Nurb *>(nurbs->first); nu; nu = nu->next) {
/* Only bezier has a normal. */

View File

@@ -76,6 +76,8 @@ enum {
/**
* Calculate unit length values into `r_normal` & `r_plane`
* from selected objects in the 3D viewport.
*
* \param v3d: The 3D viewport or null.
*/
int getTransformOrientation_ex(const Scene *scene,
ViewLayer *view_layer,