mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
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.
Pull Request: https://projects.blender.org/blender/blender/pulls/119205
This commit is contained in:
parent
e7332f5309
commit
73f313c119
1 changed files with 5 additions and 2 deletions
|
|
@ -228,8 +228,11 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
|
|||
/* background mode */
|
||||
t->spacetype = SPACE_EMPTY;
|
||||
}
|
||||
else if ((region == NULL) && (area->spacetype == SPACE_VIEW3D)) {
|
||||
/* running in the text editor */
|
||||
else if (((region == NULL) || (region->regiondata == NULL)) &&
|
||||
(area->spacetype == SPACE_VIEW3D))
|
||||
{
|
||||
/* Running the operator through the text editor where e.g. `area.type` was
|
||||
* set to 'VIEW_3D' but the viewport was not updated. */
|
||||
t->spacetype = SPACE_EMPTY;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue