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:
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/__init__.py23
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py24
2 files changed, 45 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index ef705f8fe37..c282b3f281d 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -117,13 +117,19 @@ def register():
for cls in mod.classes:
register_class(cls)
- # space_userprefs.py
from bpy.props import (
+ CollectionProperty,
EnumProperty,
+ IntProperty,
StringProperty,
)
- from bpy.types import WindowManager
+ from bpy.types import (
+ AssetHandle,
+ WindowManager,
+ WorkSpace,
+ )
+ # space_userprefs.py
def addon_filter_items(_self, _context):
import addon_utils
@@ -165,6 +171,19 @@ def register():
)
# done...
+ # space_view3d.py
+ WorkSpace.active_pose_asset_index = IntProperty(
+ name="Active Pose Asset",
+ # TODO explain which list the index belongs to, or how it can be used to get the pose.
+ description="Per workspace index of the active pose asset"
+ )
+ # Register for window-manager. This is a global property that shouldn't be
+ # written to files.
+ WindowManager.pose_assets = CollectionProperty(
+ type=AssetHandle
+ )
+ # done...
+
def unregister():
from bpy.utils import unregister_class
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index e68f006ccc1..5b974dd9b3f 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -7000,6 +7000,29 @@ class VIEW3D_PT_context_properties(Panel):
rna_prop_ui.draw(self.layout, context, member, object, False)
+class VIEW3D_PT_asset_testing(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'UI'
+ bl_label = "Asset Testing"
+ bl_category = "Assets"
+
+ def draw(self, context):
+ layout = self.layout
+
+ wm = context.window_manager
+ workspace = context.workspace
+
+ layout.template_asset_view(
+ "pose_assets",
+ workspace,
+ "active_asset_library",
+ wm,
+ "pose_assets",
+ workspace,
+ "active_pose_asset_index"
+ )
+
+
# Grease Pencil Object - Multiframe falloff tools
class VIEW3D_PT_gpencil_multi_frame(Panel):
bl_space_type = 'VIEW_3D'
@@ -7713,6 +7736,7 @@ classes = (
VIEW3D_PT_transform_orientations,
VIEW3D_PT_overlay_gpencil_options,
VIEW3D_PT_context_properties,
+ VIEW3D_PT_asset_testing,
VIEW3D_PT_paint_vertex_context_menu,
VIEW3D_PT_paint_texture_context_menu,
VIEW3D_PT_paint_weight_context_menu,