Fix #54468: crash calling transform operators with incomplete regiondata #119205

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:54468 into blender-v4.1-release 2024-03-11 09:27:42 +01:00

2 Commits

Author SHA1 Message Date
Philipp Oeser bf162bdf1c improve comment 2024-03-11 09:12:14 +01:00
Philipp Oeser b67ebea8ec Fix #54468: crash calling transform operators with incomplete regiondata
If we run into NULL `RegionView3D` `regiondata` [which e.g. happens if
we just set `bpy.context.area.type = 'VIEW_3D'` without further actions
in the text editor prior to calling the transform operator], we can make
it gracefully work just by using `t->spacetype = SPACE_EMPTY` in
`initTransInfo`.

Similar check is already done in ba229e3859 (marked /* running in the
text editor */).

Transform code is smart enough to have fallback code in place that sets
matrices etc.
2024-03-08 13:47:17 +01:00