diff options
author | Vilém Duha <vilda.novak@gmail.com> | 2021-01-26 17:44:56 +0300 |
---|---|---|
committer | Vilém Duha <vilda.novak@gmail.com> | 2021-01-28 15:59:46 +0300 |
commit | ec4aa946771433d29cf43a8f27378bb4f4fb713e (patch) | |
tree | 1df5f81699391961ffa6de98f18ae0a2d863d9de /blenderkit/ui_panels.py | |
parent | 41658df313e1948484af81a5c035810a040f637d (diff) |
BlenderKit: fix search results storage
Storing results in scenes increased file size too much. Now the search reasults are stored in window manager and thus not saved. Also this makes them shared between more scenes.
Diffstat (limited to 'blenderkit/ui_panels.py')
-rw-r--r-- | blenderkit/ui_panels.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py index 921d0453..deb3c0bb 100644 --- a/blenderkit/ui_panels.py +++ b/blenderkit/ui_panels.py @@ -1244,7 +1244,7 @@ def draw_asset_context_menu(layout, context, asset_data, from_panel=False): op.invoke_resolution = True o = utils.get_active_model() if o and o.get('asset_data'): - if o['asset_data']['assetBaseId'] == bpy.context.scene['search results'][ui_props.active_index]: + if o['asset_data']['assetBaseId'] == bpy.context.window_manager['search results'][ui_props.active_index]: op.model_location = o.location op.model_rotation = o.rotation_euler else: @@ -1339,9 +1339,9 @@ def draw_asset_context_menu(layout, context, asset_data, from_panel=False): # def draw(self, context): # ui_props = context.scene.blenderkitUI # -# # sr = bpy.context.scene['search results'] +# # sr = bpy.context.window_manager['search results'] # -# # sr = bpy.context.scene['search results'] +# # sr = bpy.context.window_manager['search results'] # # asset_data = sr[ui_props.active_index] # # for k in resolutions.resolution_props_to_server.keys(): @@ -1355,13 +1355,13 @@ class OBJECT_MT_blenderkit_asset_menu(bpy.types.Menu): def draw(self, context): ui_props = context.scene.blenderkitUI - sr = bpy.context.scene['search results'] + sr = bpy.context.window_manager['search results'] asset_data = sr[ui_props.active_index] draw_asset_context_menu(self.layout, context, asset_data, from_panel=False) # ui_props = context.scene.blenderkitUI # - # sr = bpy.context.scene['search results'] + # sr = bpy.context.window_manager['search results'] # asset_data = sr[ui_props.active_index] # layout = self.layout # row = layout.row() @@ -1403,7 +1403,7 @@ class AssetPopupCard(bpy.types.Operator): def draw(self, context): ui_props = context.scene.blenderkitUI - sr = bpy.context.scene['search results'] + sr = bpy.context.window_manager['search results'] asset_data = sr[ui_props.active_index] layout = self.layout row = layout.row() @@ -1442,7 +1442,7 @@ class AssetPopupCard(bpy.types.Operator): wm = context.window_manager ui_props = context.scene.blenderkitUI ui_props.draw_tooltip = False - sr = bpy.context.scene['search results'] + sr = bpy.context.window_manager['search results'] asset_data = sr[ui_props.active_index] self.img = ui.get_large_thumbnail_image(asset_data) # self.tex = utils.get_hidden_texture(self.img) |