diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2021-07-15 12:45:39 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2021-07-15 12:45:39 +0300 |
commit | 7f92ef14e8864fe680fc23f279b506723f624a5a (patch) | |
tree | c42efa0a814635c8216827ac4b776693b8afaad1 | |
parent | 022cd94be488327a1635a56e1bf84d6f9e6405cb (diff) |
Pose library: hide panels when Asset Browser is not enabled
When the Asset Browser is not enabled in the Experimental features prefs,
hide any pose library panels that are outside the Asset Browser. This
hides the 3D Viewport sidebar, as well as the pose asset creation panel
in the animation editors.
-rw-r--r-- | pose_library/gui.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pose_library/gui.py b/pose_library/gui.py index bf2693e9..268c71cb 100644 --- a/pose_library/gui.py +++ b/pose_library/gui.py @@ -39,6 +39,10 @@ class VIEW3D_PT_pose_library(Panel): bl_category = "Animation" bl_label = "Pose Library" + @classmethod + def poll(cls, context: Context) -> bool: + return context.preferences.experimental.use_asset_browser + def draw(self, context: Context) -> None: layout = self.layout @@ -165,6 +169,10 @@ class DOPESHEET_PT_asset_panel(Panel): bl_region_type = "UI" bl_label = "Create Pose Asset" + @classmethod + def poll(cls, context: Context) -> bool: + return context.preferences.experimental.use_asset_browser + def draw(self, context: Context) -> None: layout = self.layout col = layout.column(align=True) |