WIP: GPv3 - Add support to material render previews #113944
Binary file not shown.
Binary file not shown.
|
@ -905,6 +905,7 @@ if(WITH_BLENDER)
|
||||||
# Blend files.
|
# Blend files.
|
||||||
data_to_c_simple(../../../../release/datafiles/preview.blend SRC)
|
data_to_c_simple(../../../../release/datafiles/preview.blend SRC)
|
||||||
data_to_c_simple(../../../../release/datafiles/preview_grease_pencil.blend SRC)
|
data_to_c_simple(../../../../release/datafiles/preview_grease_pencil.blend SRC)
|
||||||
|
data_to_c_simple(../../../../release/datafiles/preview_grease_pencil_legacy.blend SRC)
|
||||||
|
|
||||||
# Images.
|
# Images.
|
||||||
data_to_c_simple(../../../../release/datafiles/splash.png SRC)
|
data_to_c_simple(../../../../release/datafiles/splash.png SRC)
|
||||||
|
|
|
@ -23,6 +23,9 @@ extern const char datatoc_preview_blend[];
|
||||||
extern int datatoc_preview_grease_pencil_blend_size;
|
extern int datatoc_preview_grease_pencil_blend_size;
|
||||||
extern const char datatoc_preview_grease_pencil_blend[];
|
extern const char datatoc_preview_grease_pencil_blend[];
|
||||||
|
|
||||||
|
extern int datatoc_preview_grease_pencil_legacy_blend_size;
|
||||||
|
extern const char datatoc_preview_grease_pencil_legacy_blend[];
|
||||||
|
|
||||||
extern int datatoc_blender_icons16_png_size;
|
extern int datatoc_blender_icons16_png_size;
|
||||||
extern const char datatoc_blender_icons16_png[];
|
extern const char datatoc_blender_icons16_png[];
|
||||||
|
|
||||||
|
|
|
@ -194,8 +194,16 @@ void ED_preview_ensure_dbase(const bool with_gpencil)
|
||||||
base_initialized = true;
|
base_initialized = true;
|
||||||
}
|
}
|
||||||
if (!base_initialized_gpencil && with_gpencil) {
|
if (!base_initialized_gpencil && with_gpencil) {
|
||||||
G_pr_main_grease_pencil = load_main_from_memory(datatoc_preview_grease_pencil_blend,
|
|
||||||
datatoc_preview_grease_pencil_blend_size);
|
if (U.experimental.use_grease_pencil_version3) {
|
||||||
|
G_pr_main_grease_pencil = load_main_from_memory(datatoc_preview_grease_pencil_blend,
|
||||||
|
datatoc_preview_grease_pencil_blend_size);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
G_pr_main_grease_pencil = load_main_from_memory(
|
||||||
|
datatoc_preview_grease_pencil_legacy_blend,
|
||||||
|
datatoc_preview_grease_pencil_legacy_blend_size);
|
||||||
|
}
|
||||||
base_initialized_gpencil = true;
|
base_initialized_gpencil = true;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -419,7 +427,8 @@ static const char *preview_world_name(const Scene *sce,
|
||||||
* this approximation.
|
* this approximation.
|
||||||
*/
|
*/
|
||||||
if (id_type == ID_MA && pr_method == PR_ICON_RENDER &&
|
if (id_type == ID_MA && pr_method == PR_ICON_RENDER &&
|
||||||
!render_engine_supports_ray_visibility(sce)) {
|
!render_engine_supports_ray_visibility(sce))
|
||||||
|
{
|
||||||
return "WorldFloor";
|
return "WorldFloor";
|
||||||
}
|
}
|
||||||
return "World";
|
return "World";
|
||||||
|
@ -1437,7 +1446,8 @@ static void icon_preview_startjob(void *customdata, bool *stop, bool *do_update)
|
||||||
* only get existing `ibuf`. */
|
* only get existing `ibuf`. */
|
||||||
ibuf = BKE_image_acquire_ibuf(ima, &iuser, nullptr);
|
ibuf = BKE_image_acquire_ibuf(ima, &iuser, nullptr);
|
||||||
if (ibuf == nullptr ||
|
if (ibuf == nullptr ||
|
||||||
(ibuf->byte_buffer.data == nullptr && ibuf->float_buffer.data == nullptr)) {
|
(ibuf->byte_buffer.data == nullptr && ibuf->float_buffer.data == nullptr))
|
||||||
|
{
|
||||||
BKE_image_release_ibuf(ima, ibuf, nullptr);
|
BKE_image_release_ibuf(ima, ibuf, nullptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue