Math Vis Console - fixed errors with invalid objects in console locals #104958

Closed
Andrej wants to merge 3 commits from Andrej730/blender-addons:math_vis_fix_invalid_objects into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 30930143ef - Show all commits

View File

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
import bpy
from _bpy import types as bpy_types
Andrej730 marked this conversation as resolved Outdated

It looks like bpy.types works just as well, why not use that?

It looks like `bpy.types` works just as well, why not use that?

Agreed, fixed.

Agreed, fixed.
def console_namespace():
@ -155,6 +156,10 @@ def console_math_data():
if not disp:
continue
# avoid bpy types to avoid possible errors caused by invalidated objects
if isinstance(var, bpy_types.ID):
continue
if isinstance(var, Matrix):
if len(var.col) != 4 or len(var.row) != 4:
if len(var.col) == len(var.row):