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>2021-01-18 16:16:58 +0300
committerVilém Duha <vilda.novak@gmail.com>2021-01-18 16:16:58 +0300
commitaf50ac234088b0d7eeab54cd498c0318a1f95c76 (patch)
tree67ca7af94560f36f2a3a5a0d35e82ce5b4a07e6f /blenderkit/autothumb.py
parentd59052f4d5ed74fdb49ddd4529215560af041715 (diff)
BlenderKit: fix T84766 - Specify utf-8 encoding for all json file write/reads
This is used on various places of the addon, and was introduced to fix (once more and better) T48766.
Diffstat (limited to 'blenderkit/autothumb.py')
-rw-r--r--blenderkit/autothumb.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/blenderkit/autothumb.py b/blenderkit/autothumb.py
index 0008d670..da6e6d29 100644
--- a/blenderkit/autothumb.py
+++ b/blenderkit/autothumb.py
@@ -120,7 +120,7 @@ def start_thumbnailer(self, context):
obnames = []
for ob in obs:
obnames.append(ob.name)
- with open(datafile, 'w') as s:
+ with open(datafile, 'w', encoding = 'utf-8') as s:
bkit = mainmodel.blenderkit
json.dump({
"type": "model",
@@ -131,7 +131,7 @@ def start_thumbnailer(self, context):
"thumbnail_resolution": bkit.thumbnail_resolution,
"thumbnail_samples": bkit.thumbnail_samples,
"thumbnail_denoising": bkit.thumbnail_denoising,
- }, s)
+ }, s, ensure_ascii=False, indent=4)
proc = subprocess.Popen([
binary_path,
@@ -190,7 +190,7 @@ def start_material_thumbnailer(self, context, wait=False):
# save a copy of actual scene but don't interfere with the users models
bpy.ops.wm.save_as_mainfile(filepath=filepath, compress=False, copy=True)
- with open(datafile, 'w') as s:
+ with open(datafile, 'w', encoding = 'utf-8') as s:
bkit = mat.blenderkit
json.dump({
"type": "material",
@@ -204,7 +204,7 @@ def start_material_thumbnailer(self, context, wait=False):
"thumbnail_denoising": bkit.thumbnail_denoising,
"adaptive_subdivision": bkit.adaptive_subdivision,
"texture_size_meters": bkit.texture_size_meters,
- }, s)
+ }, s, ensure_ascii=False, indent=4)
proc = subprocess.Popen([
binary_path,