From c73dce169f1d7a8abc97b4ac53f8adefb3eb6746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 20 Jul 2016 16:54:06 +0200 Subject: [PATCH] Added a panel that shows custom properties in the image editor. --- blender_cloud/blender.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/blender_cloud/blender.py b/blender_cloud/blender.py index 1877d8f..f030fe6 100644 --- a/blender_cloud/blender.py +++ b/blender_cloud/blender.py @@ -27,6 +27,7 @@ import os.path import bpy from bpy.types import AddonPreferences, Operator, WindowManager, Scene, PropertyGroup from bpy.props import StringProperty, EnumProperty, PointerProperty, BoolProperty +import rna_prop_ui from . import pillar @@ -303,6 +304,17 @@ class PILLAR_OT_subscribe(Operator): return {'FINISHED'} +class PILLAR_PT_image_custom_properties(rna_prop_ui.PropertyPanel, bpy.types.Panel): + """Shows custom properties in the image editor.""" + + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'UI' + bl_label = 'Custom Properties' + + _context_path = 'edit_image' + _property_type = bpy.types.Image + + def preferences() -> BlenderCloudPreferences: return bpy.context.user_preferences.addons[ADDON_NAME].preferences @@ -345,6 +357,7 @@ def register(): bpy.utils.register_class(PillarCredentialsUpdate) bpy.utils.register_class(SyncStatusProperties) bpy.utils.register_class(PILLAR_OT_subscribe) + bpy.utils.register_class(PILLAR_PT_image_custom_properties) addon_prefs = preferences() @@ -376,6 +389,7 @@ def unregister(): bpy.utils.unregister_class(BlenderCloudPreferences) bpy.utils.unregister_class(SyncStatusProperties) bpy.utils.unregister_class(PILLAR_OT_subscribe) + bpy.utils.unregister_class(PILLAR_PT_image_custom_properties) del WindowManager.last_blender_cloud_location del WindowManager.blender_sync_status