Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-01-19 06:04:32 +0300
committerCampbell Barton <campbell@blender.org>2022-01-19 06:05:56 +0300
commitee6507f2b1d776099e199a31a3af0f09d2fbba74 (patch)
treed3e6f823632ceb9d9a6d8365188d25be5b60fcaa /source/blender/windowmanager/intern
parent7e3b1e2c8f9f5d95692d37707506d790c5b503f7 (diff)
Docs: notes on thumbnail sizes
The rationale for storing thumbnails at different sizes wasn't obvious.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 344f4959a93..1478712c3cd 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1521,11 +1521,29 @@ static void wm_history_file_update(void)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Save Main Blend-File (internal) Screen-Shot
+/** \name Thumbnail Generation: Screen-Shot / Camera View
+ *
+ * Thumbnail Sizes
+ * ===============
+ *
+ * - `PREVIEW_RENDER_LARGE_HEIGHT * 2` is used to render a large thumbnail,
+ * giving some over-sampling when scaled down:
+ *
+ * - There are two outputs for this thumbnail:
+ *
+ * - An image is saved to the thumbnail cache, sized at #PREVIEW_RENDER_LARGE_HEIGHT.
+ *
+ * - A smaller thumbnail is stored in the `.blend` file it's self, sized at #BLEN_THUMB_SIZE.
+ * The size is kept small to prevent thumbnails bloating the size of `.blend` files.
+ *
+ * The this thumbnail will be extracted if the file is shared or the local thumbnail cache
+ * is cleared. see: `blendthumb_extract.cc` for logic that extracts the thumbnail.
*
- * Screen-shot the active window.
* \{ */
+/**
+ * Screen-shot the active window.
+ */
static ImBuf *blend_file_thumb_from_screenshot(bContext *C, BlendThumbnail **r_thumb)
{
*r_thumb = NULL;
@@ -1571,15 +1589,11 @@ static ImBuf *blend_file_thumb_from_screenshot(bContext *C, BlendThumbnail **r_t
return ibuf;
}
-/** \} */
-
-/* -------------------------------------------------------------------- */
-/** \name Save Main Blend-File (internal) Camera View
- *
+/**
* Render the current scene with the active camera.
- * \{ */
-
-/* screen can be NULL */
+ *
+ * \param screen: can be NULL.
+ */
static ImBuf *blend_file_thumb_from_camera(const bContext *C,
Scene *scene,
bScreen *screen,
@@ -1617,7 +1631,6 @@ static ImBuf *blend_file_thumb_from_camera(const bContext *C,
return NULL;
}
- /* gets scaled to BLEN_THUMB_SIZE */
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
/* Note that with scaling, this ends up being 0.5,
@@ -1689,6 +1702,12 @@ static ImBuf *blend_file_thumb_from_camera(const bContext *C,
return ibuf;
}
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Write Main Blend-File (internal)
+ * \{ */
+
bool write_crash_blend(void)
{
char path[FILE_MAX];
@@ -2017,7 +2036,7 @@ void wm_autosave_delete(void)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Initialize WM_OT_open_xxx properties
+/** \name Initialize `WM_OT_open_*` Properties
*
* Check if load_ui was set by the caller.
* Fall back to user preference when file flags not specified.