Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
3f282d22
Commit
3f282d22
authored
5 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
Fix T66107: Error when numpy arrays are defined in math-vis add-on
parent
fcea7efd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
space_view3d_math_vis/utils.py
+21
-4
21 additions, 4 deletions
space_view3d_math_vis/utils.py
with
21 additions
and
4 deletions
space_view3d_math_vis/utils.py
+
21
−
4
View file @
3f282d22
...
...
@@ -95,12 +95,29 @@ def get_math_data():
variables
=
{}
for
key
,
var
in
locals
.
items
():
if
len
(
key
)
==
0
or
key
[
0
]
==
"
_
"
or
not
var
:
if
len
(
key
)
==
0
or
key
[
0
]
==
"
_
"
:
continue
if
type
(
var
)
in
{
Matrix
,
Vector
,
Quaternion
,
Euler
}
or
\
type
(
var
)
in
{
tuple
,
list
}
and
is_display_list
(
var
):
variables
[
key
]
=
type
(
var
)
type_var
=
type
(
var
)
# Rules out sets/dicts.
# It's also possible the length check below is slow
# for data with underlying linked-list structure.
if
not
hasattr
(
type_var
,
"
__getitem__
"
):
continue
# Don't do a truth test on the data because this causes an error with some
# array types, see T66107.
len_fn
=
getattr
(
type_var
,
"
__len__
"
,
None
)
if
len_fn
is
None
:
continue
if
len_fn
(
var
)
==
0
:
continue
if
type_var
in
{
Matrix
,
Vector
,
Quaternion
,
Euler
}
or
\
type_var
in
{
tuple
,
list
}
and
is_display_list
(
var
):
variables
[
key
]
=
type_var
return
variables
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment