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:
authorVilém Duha <vilda.novak@gmail.com>2020-05-07 15:30:48 +0300
committerVilém Duha <vilda.novak@gmail.com>2020-05-07 15:30:48 +0300
commit4fe390b6bad2807f604656752f122861fd26efc1 (patch)
treebd69c8e3b69e519e68172edc29b7b5626b0f792e
parent20760ae61e35f9fdcfdd9e15322349e2ce1fd91e (diff)
BlenderKit: block clipboard reading on linux
This was causing T73507
-rw-r--r--blenderkit/search.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/blenderkit/search.py b/blenderkit/search.py
index 641b1548..8406e47d 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -55,7 +55,7 @@ from bpy.types import (
import requests, os, random
import time
import threading
-import tempfile
+import platform
import json
import bpy
@@ -133,19 +133,20 @@ last_clipboard = ''
def check_clipboard():
# clipboard monitoring to search assets from web
- global last_clipboard
- if bpy.context.window_manager.clipboard != last_clipboard:
- last_clipboard = bpy.context.window_manager.clipboard
- instr = 'asset_base_id:'
- # first check if contains asset id, then asset type
- if last_clipboard[:len(instr)] == instr:
- atstr = 'asset_type:'
- ati = last_clipboard.find(atstr)
- # this only checks if the asset_type keyword is there but let's the keywords update function do the parsing.
- if ati > -1:
- search_props = utils.get_search_props()
- search_props.search_keywords = last_clipboard
- # don't run search after this - assigning to keywords runs the search_update function.
+ if platform.system() != 'Linux':
+ global last_clipboard
+ if bpy.context.window_manager.clipboard != last_clipboard:
+ last_clipboard = bpy.context.window_manager.clipboard
+ instr = 'asset_base_id:'
+ # first check if contains asset id, then asset type
+ if last_clipboard[:len(instr)] == instr:
+ atstr = 'asset_type:'
+ ati = last_clipboard.find(atstr)
+ # this only checks if the asset_type keyword is there but let's the keywords update function do the parsing.
+ if ati > -1:
+ search_props = utils.get_search_props()
+ search_props.search_keywords = last_clipboard
+ # don't run search after this - assigning to keywords runs the search_update function.
# @bpy.app.handlers.persistent