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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2021-08-10 13:53:56 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2021-08-10 13:53:56 +0300
commitbb587e5bf80ea81d03f4ad7a22f209d687dbf818 (patch)
tree2752b062abe7177ac005cea5afb0a4b63c7623d0
parent78107f78694f47ee6e50a7eb7c16b506af921199 (diff)
Pose Library: transparently handle removal of experimental flag
Add code to deal with the future removal of the experimental flag `context.preferences.experimental.use_asset_browser`. If the `use_asset_browser` attribute is no longer there, allow the pose library UI elements to be shown.
-rw-r--r--pose_library/gui.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/pose_library/gui.py b/pose_library/gui.py
index 5ac6a934..a2f04a22 100644
--- a/pose_library/gui.py
+++ b/pose_library/gui.py
@@ -41,7 +41,12 @@ class VIEW3D_PT_pose_library(Panel):
@classmethod
def poll(cls, context: Context) -> bool:
- return context.preferences.experimental.use_asset_browser
+ exp_prefs = context.preferences.experimental
+ try:
+ return exp_prefs.use_asset_browser
+ except AttributeError:
+ # The 'use_asset_browser' experimental option was removed from Blender.
+ return True
def draw(self, context: Context) -> None:
layout = self.layout
@@ -172,7 +177,12 @@ class DOPESHEET_PT_asset_panel(Panel):
@classmethod
def poll(cls, context: Context) -> bool:
- return context.preferences.experimental.use_asset_browser
+ exp_prefs = context.preferences.experimental
+ try:
+ return exp_prefs.use_asset_browser
+ except AttributeError:
+ # The 'use_asset_browser' experimental option was removed from Blender.
+ return True
def draw(self, context: Context) -> None:
layout = self.layout