diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-07-12 15:18:17 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-07-12 15:18:17 +0300 |
commit | 325501247d88647fd2457f9fc02209aadc6a52f1 (patch) | |
tree | 55fae5cc8dc44bb7e35b5d8151144dfa11df5ab9 /release | |
parent | 439777f081ed9ee7ee0d5ea9042dc87bd2fd4b1a (diff) |
Fix AttributeError in mesh properties panel when mesh is pinned
When a mesh datablock is pinned in the properties panel,
`context.object` is `None`. This in turn causes `obj.mode` to raise an
`AttributeError` exception as `None.mode` doesn't exist.
Since there is no (fast/simple) way to check whether the owning object
is in edit mode or not, the properties will be disabled. Not ideal, but
better than spewing an exception on every panel draw.
Reviewed By: campbellbarton, brecht
Differential Revision: https://developer.blender.org/D5237
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_mesh.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index e4fd09bb5ff..63e4d44eada 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -483,7 +483,7 @@ class DATA_PT_customdata(MeshButtonsPanel, Panel): col = layout.column() - col.enabled = (obj.mode != 'EDIT') + col.enabled = obj is not None and obj.mode != 'EDIT' col.prop(me, "use_customdata_vertex_bevel") col.prop(me, "use_customdata_edge_bevel") col.prop(me, "use_customdata_edge_crease") |