[Bf-extensions-cvs] [9bc02e82] master: BlenderKit: model thumbnail resolution options

Vilém Duha noreply at git.blender.org
Mon Aug 12 16:05:28 CEST 2019


Commit: 9bc02e82d2b268dfe3d50acb9b92385853bf7929
Author: Vilém Duha
Date:   Sat Aug 10 23:45:24 2019 +0200
Branches: master
https://developer.blender.org/rBA9bc02e82d2b268dfe3d50acb9b92385853bf7929

BlenderKit: model thumbnail resolution options

===================================================================

M	blenderkit/__init__.py
M	blenderkit/autothumb.py
M	blenderkit/autothumb_model_bg.py

===================================================================

diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py
index 6a2a68b3..c6b25312 100644
--- a/blenderkit/__init__.py
+++ b/blenderkit/__init__.py
@@ -820,6 +820,13 @@ class BlenderKitModelUploadProps(PropertyGroup, BlenderKitCommonUploadProps):
         description='typical placing of the interior. Leave on ground for most objects that respect gravity :)',
     )
 
+    thumbnail_resolution: EnumProperty(
+        name="Resolution",
+        items=thumbnail_resolutions,
+        description="Thumbnail resolution.",
+        default="512",
+    )
+
     thumbnail_samples: IntProperty(name="Cycles Samples",
                                    description="cycles samples setting", default=200,
                                    min=5, max=5000)
diff --git a/blenderkit/autothumb.py b/blenderkit/autothumb.py
index c38be3d1..b5f659aa 100644
--- a/blenderkit/autothumb.py
+++ b/blenderkit/autothumb.py
@@ -142,6 +142,7 @@ def start_thumbnailer(self, context):
                 "thumbnail_angle": bkit.thumbnail_angle,
                 "thumbnail_snap_to": bkit.thumbnail_snap_to,
                 "thumbnail_background_lightness": bkit.thumbnail_background_lightness,
+                "thumbnail_resolution": bkit.thumbnail_resolution,
                 "thumbnail_samples": bkit.thumbnail_samples,
                 "thumbnail_denoising": bkit.thumbnail_denoising,
             }, s)
diff --git a/blenderkit/autothumb_model_bg.py b/blenderkit/autothumb_model_bg.py
index 5df0738b..9173391e 100644
--- a/blenderkit/autothumb_model_bg.py
+++ b/blenderkit/autothumb_model_bg.py
@@ -153,6 +153,9 @@ if __name__ == "__main__":
         img.filepath = ipath
         img.reload()
 
+        bpy.context.scene.render.resolution_x = int(data['thumbnail_resolution'])
+        bpy.context.scene.render.resolution_y = int(data['thumbnail_resolution'])
+
         bg_blender.progress('rendering thumbnail')
         render_thumbnails()
         fpath = BLENDERKIT_THUMBNAIL_PATH + '0001.jpg'



More information about the Bf-extensions-cvs mailing list