Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2019-07-12 15:18:17 +0300
committerSybren A. Stüvel <sybren@blender.org>2019-07-12 15:18:17 +0300
commit325501247d88647fd2457f9fc02209aadc6a52f1 (patch)
tree55fae5cc8dc44bb7e35b5d8151144dfa11df5ab9 /release/scripts/startup/bl_ui
parent439777f081ed9ee7ee0d5ea9042dc87bd2fd4b1a (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/scripts/startup/bl_ui')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py2
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")