176 const int fileflags =
G.fileflags;
177 Main *bmain =
nullptr;
186 G.fileflags = fileflags;
195 static bool base_initialized =
false;
196 static bool base_initialized_gpencil =
false;
198 if (!base_initialized) {
200 base_initialized =
true;
202 if (!base_initialized_gpencil && with_gpencil) {
205 base_initialized_gpencil =
true;
236 if (pr_main ==
nullptr) {
253 return "Shader Ball";
259 return "World Sphere";
299 return "FloorHidden";
329 if (
STREQ(base->object->id.name + 2,
"Floor")) {
336 if (base->object->type ==
OB_MESH) {
338 pr_main,
static_cast<Mesh *
>(base->object->data), scene, pr_method);
357 if (world ==
nullptr) {
381 nullptr, &world->
id,
"World Nodetree",
"ShaderNodeTree");
415 switch (
GS(
id->name)) {
435 return &instance_empty->
id;
442 if (!allow_failure) {
549 if (id_type ==
ID_TE) {
554 if (id_type ==
ID_MA) {
576 const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
580 const float dark[4] = {0.05f, 0.05f, 0.05f, 0.05f};
593 if (base->object->id.name[2] ==
'p') {
601 int actcol =
max_ii(base->object->actcol - 1, 0);
603 if (matar && actcol < base->
object->totcol) {
604 (*matar)[actcol] = mat;
607 else if (base->object->type ==
OB_LAMP) {
613 else if (id_type ==
ID_TE) {
614 Tex *tex =
nullptr, *origtex = (
Tex *)
id;
623 else if (id_type ==
ID_LA) {
639 const float black[4] = {0.0f, 0.0f, 0.0f, 0.0f};
645 if (base->object->id.name[2] ==
'p') {
646 if (base->object->type ==
OB_LAMP) {
647 base->object->data = la;
652 else if (id_type ==
ID_WO) {
653 World *wrld =
nullptr, *origwrld = (
World *)
id;
675 Scene *scene,
const void *owner,
int split,
int first,
const rcti *rect,
rcti *newrect)
683 const void *split_owner = (!
split || first) ? owner : (
char *)owner + 1;
693 newx = newx - newx / 2;
715 if (rv && rv->
ibuf) {
721 float fx = rect->
xmin + offx;
722 float fy = rect->
ymin;
744 ID *parent = (
ID *)parentp;
779 if (sbuts !=
nullptr) {
794 if (preview->id_session_uid ==
id.session_uid) {
834 float dummy_scale[3];
839 const float eul[3] = {
M_PI * 0.4f, 0.0f,
M_PI * 0.1f};
853 Depsgraph **r_depsgraph)
870 preview_data->
pr_main, scene, view_layer, preview_data->
object);
872 scene->
camera = camera_object;
897 char err_out[256] =
"unknown";
902 preview_data.
pr_main = preview_main;
925 preview_sized->
sizex,
926 preview_sized->
sizey,
964 if (
object ==
nullptr) {
968 if (
object->pose ==
nullptr) {
970 "Object %s has no pose, unable to apply the Action before rendering",
991 object, &pose_action, slot.
handle, &anim_eval_context);
1002 if (pose_backup ==
nullptr) {
1016 char err_out[256] =
"";
1030 if (camera_eval ==
nullptr) {
1031 printf(
"Scene has no camera, unable to render preview of %s without it.\n",
1043 preview_sized->
sizex,
1044 preview_sized->
sizey,
1055 if (err_out[0] !=
'\0') {
1056 printf(
"Error rendering Action %s preview: %s\n", preview->
id->
name + 2, err_out);
1073 return scene->
camera !=
nullptr;
1089 if (camera_eval ==
nullptr) {
1092 "Scene has no camera, unable to render preview of %s without it.",
1097 char err_out[256] =
"";
1104 preview_sized->
sizex,
1105 preview_sized->
sizey,
1114 if (err_out[0] !=
'\0') {
1117 "Error rendering Scene %s preview: %s.",
1156 int width = sp->
sizex;
1157 int height = sp->
sizey;
1179 float tex_coord[3] = {0.0f, 0.0f, 0.0f};
1181 for (
int y = 0;
y < height;
y++) {
1185 for (
int x = 0;
x < width;
x++) {
1214 short idtype =
GS(
id->name);
1221 sizex = sp->
sizex / 2;
1234 sce->
r.
xsch = sizex;
1241 if (sce ==
nullptr) {
1245 const void *split_owner = (!
split || first) ? sp->
owner : (
char *)sp->
owner + 1;
1249 if (re ==
nullptr) {
1274 if (sizex > sp->
sizey) {
1279 if (idtype ==
ID_TE) {
1303 if (idtype ==
ID_TE) {
1342 ID *main_id_copy =
nullptr;
1343 ID *sub_id_copy =
nullptr;
1392 if (ibuf ==
nullptr ||
1398 float scaledx, scaledy;
1399 if (ibuf->
x > ibuf->
y) {
1404 scaledx = (
float(ibuf->
x) /
float(ibuf->
y)) *
float(h);
1409 int ex = std::max<int>(1, scaledx);
1410 int ey = std::max<int>(1, scaledy);
1412 int dx = (
w - ex) / 2;
1413 int dy = (h - ey) / 2;
1416 if (ima ==
nullptr) {
1428 drect += dy *
w + dx;
1429 for (; ey > 0; ey--) {
1430 memcpy(drect, srect, ex *
sizeof(
int));
1438static void set_alpha(
char *cp,
int sizex,
int sizey,
char alpha)
1440 int a,
size = sizex * sizey;
1442 for (a = 0; a <
size; a++, cp += 4) {
1457 short idtype =
GS(
id->name);
1461 if (idtype ==
ID_IM) {
1463 ImBuf *ibuf =
nullptr;
1467 if (ima ==
nullptr) {
1479 if (ibuf ==
nullptr ||
1498 if (idtype ==
ID_WO) {
1554 if ((ma ==
nullptr) || (ma->
gp_style ==
nullptr)) {
1575 if ((preview_image->
w[
i] == icon_size->
sizex) && (preview_image->
h[
i] == icon_size->
sizey)) {
1580 BLI_assert_msg(0,
"The searched icon size does not match any in the preview image");
1595 if (worker_status->
stop) {
1612 const bool use_solid_render_mode = (ip->
id !=
nullptr) &&
1635 if (ip->
id !=
nullptr) {
1670 if (cur_size->
sizex == sizex && cur_size->
sizey == sizey) {
1675 cur_size = cur_size->
next;
1679 new_size->
sizex = sizex;
1680 new_size->
sizey = sizey;
1681 new_size->
rect = rect;
1700 if (prv_img->gputexture[
i]) {
1702 prv_img->gputexture[
i] =
nullptr;
1736 struct RequestedPreview {
1741 std::atomic<bool> done =
false;
1744 std::atomic<bool> failure =
false;
1747 : preview(preview), icon_size(icon_size)
1756 std::list<RequestedPreview> requested_previews_;
1769 static void update_fn(
void *customdata);
1770 static void end_fn(
void *customdata);
1771 static void free_fn(
void *customdata);
1774 static void finish_request(RequestedPreview &request);
1790 PreviewLoadJob *job_data = MEM_new<PreviewLoadJob>(
"PreviewLoadJobData");
1809 run_fn(&job_data, &worker_status);
1810 update_fn(&job_data);
1822 requested_previews_.emplace_back(preview, icon_size);
1833 while (RequestedPreview *request =
static_cast<RequestedPreview *
>(
1836 if (worker_status->
stop) {
1845 if (!source || !filepath) {
1860 preview->
w[request->icon_size] = thumb->
x;
1861 preview->
h[request->icon_size] = thumb->
y;
1867 preview->
w[request->icon_size],
1868 preview->
h[request->icon_size],
1869 preview->
rect[request->icon_size]);
1874 request->failure =
true;
1877 request->done =
true;
1885void PreviewLoadJob::finish_request(RequestedPreview &request)
1889 preview->
runtime->tag &= ~PRV_TAG_DEFFERED_RENDERING;
1890 if (request.failure) {
1896 "Deferred releasing of preview images should only run on the main thread");
1903void PreviewLoadJob::update_fn(
void *customdata)
1907 for (
auto request_it = job_data->requested_previews_.begin();
1908 request_it != job_data->requested_previews_.end();)
1910 RequestedPreview &requested = *request_it;
1912 if (!requested.done) {
1916 finish_request(requested);
1919 auto next_it = job_data->requested_previews_.erase(request_it);
1920 request_it = next_it;
1924void PreviewLoadJob::end_fn(
void *customdata)
1929 for (RequestedPreview &request : job_data->requested_previews_) {
1930 finish_request(request);
1932 job_data->requested_previews_.clear();
1935void PreviewLoadJob::free_fn(
void *customdata)
1959 if (
id ==
nullptr) {
1965 const auto [
result, disabled_hint] = [
id]() -> std::pair<bool, const char *> {
1966 switch (
GS(
id->name)) {
1968 return {
false,
RPT_(
"Node groups do not support automatic previews")};
1971 RPT_(
"Object type does not support automatic previews")};
1975 RPT_(
"Collection does not contain object types that can be rendered for the automatic "
1979 RPT_(
"Scenes without a camera do not support previews")};
1982 RPT_(
"Data-block type does not support automatic previews")};
1986 if (
result ==
false && disabled_hint && r_disabled_hint) {
1987 *r_disabled_hint = disabled_hint;
1997 if (prv_img->
runtime->deferred_loading_data) {
2014 ip.
scene = icon_scene;
2033 &ip, prv_img->
rect[icon_size], prv_img->
w[icon_size], prv_img->
h[icon_size]);
2050 if (prv_img->
runtime->deferred_loading_data) {
2069 "Generating icon preview...",
2085 ip->
scene = icon_scene;
2096 ip->
owner = prv_img;
2102 ip, prv_img->
rect[icon_size], prv_img->
w[icon_size], prv_img->
h[icon_size]);
2146 "Generating shader preview...",
2169 if (id_type ==
ID_MA) {
2173 if ((ma ==
nullptr) || (ma->
gp_style ==
nullptr)) {
2207 if (
wm && preview) {
2230 queue_entry->
id =
id;
Functions and classes to work with Actions.
Functions to work with animation poses.
void ED_draw_imbuf(ImBuf *ibuf, float x, float y, bool use_filter, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float zoom_x, float zoom_y)
bool BKE_collection_contains_geometry_recursive(const Collection *collection)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
SpaceProperties * CTX_wm_space_properties(const bContext *C)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
void BKE_image_pool_free(ImagePool *pool)
ImagePool * BKE_image_pool_new()
void BKE_imageuser_default(ImageUser *iuser)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer)
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
ListBase * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
void BKE_libblock_free_datablock(ID *id, int flag) ATTR_NONNULL()
void BKE_libblock_free_data(ID *id, bool do_id_user) ATTR_NONNULL()
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
@ LIB_ID_COPY_NO_ANIMDATA
const char * BKE_id_name(const ID &id)
General operations, lookup, etc. for blender lights.
void BKE_main_free(Main *bmain)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
General operations, lookup, etc. for materials.
Material *** BKE_object_material_array_p(Object *ob)
General operations, lookup, etc. for blender objects.
Object * BKE_object_add(Main *bmain, Scene *scene, ViewLayer *view_layer, int type, const char *name) ATTR_NONNULL(1
Object * BKE_object_add_only_object(Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
struct PoseBackup * BKE_pose_backup_create_all_bones(blender::Span< Object * > objects, const struct bAction *action) ATTR_WARN_UNUSED_RESULT
void BKE_pose_backup_restore(const struct PoseBackup *pbd)
void BKE_pose_backup_free(struct PoseBackup *pbd)
void BKE_previewimg_deferred_release(PreviewImage *prv)
PreviewImage * BKE_previewimg_id_get(const ID *id)
bool BKE_previewimg_is_finished(const PreviewImage *prv, int size)
std::optional< int > BKE_previewimg_deferred_thumb_source_get(const PreviewImage *prv)
bool BKE_previewimg_id_supports_jobs(const ID *id)
PreviewImage * BKE_previewimg_id_ensure(ID *id)
PreviewImage ** BKE_previewimg_id_get_p(const ID *id)
void BKE_previewimg_clear_single(PreviewImage *prv, enum eIconSizes size)
const char * BKE_previewimg_deferred_filepath_get(const PreviewImage *prv)
void BKE_previewimg_finish(PreviewImage *prv, int size)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Depsgraph * BKE_scene_ensure_depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer)
Scene * BKE_scene_add(Main *bmain, const char *name)
void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain)
void BKE_screen_view3d_shading_init(View3DShading *shading)
void BKE_texture_fetch_images_for_pool(struct Tex *texture, struct ImagePool *pool)
void BKE_texture_get_value_ex(struct Tex *texture, const float *tex_co, struct TexResult *texres, struct ImagePool *pool, bool use_color_management)
struct World * BKE_world_add(struct Main *bmain, const char *name)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
void void void BLI_movelisttolist(ListBase *dst, ListBase *src) ATTR_NONNULL(1
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
void mul_m3_m3_post(float R[3][3], const float B[3][3])
void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], const float wmat[4][4])
void eul_to_mat3(float mat[3][3], const float eul[3])
void mat3_to_quat(float q[4], const float mat[3][3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
#define STRNCPY_UTF8(dst, src)
@ BLI_THREAD_QUEUE_WORK_PRIORITY_NORMAL
ThreadQueue * BLI_thread_queue_init(void)
void BLI_thread_queue_free(ThreadQueue *queue)
uint64_t BLI_thread_queue_push(ThreadQueue *queue, void *work, ThreadQueueWorkPriority priority)
int BLI_thread_is_main(void)
void * BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms)
#define ARRAY_SET_ITEMS(...)
external readfile function prototypes.
BlendFileData * BLO_read_from_memory(const void *mem, int memsize, eBLOReadSkip skip_flags, ReportList *reports)
void DEG_id_tag_update(ID *id, unsigned int flags)
Depsgraph * DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode)
void DEG_evaluate_on_refresh(Depsgraph *graph, DepsgraphEvaluateSyncWriteback sync_writeback=DEG_EVALUATE_SYNC_WRITEBACK_NO)
void DEG_graph_free(Depsgraph *graph)
void DEG_graph_build_from_view_layer(Depsgraph *graph)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
Scene * DEG_get_input_scene(const Depsgraph *graph)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ PRV_TAG_DEFFERED_DELETE
@ PRV_TAG_DEFFERED_RENDERING
@ PRV_TAG_DEFFERED_INVALID
#define ID_IS_EDITABLE(_id)
struct PreviewImage PreviewImage
Object groups, one object can be in many groups at once.
@ BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT
Object is a sort of wrapper for general info.
#define OB_TYPE_IS_GEOMETRY(_type)
#define OB_TYPE_SUPPORT_MATERIAL(_type)
#define BASE_SELECTED(v3d, base)
@ SCE_DISPLAY_AA_SAMPLES_8
@ V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS
const char datatoc_preview_grease_pencil_blend[]
int datatoc_preview_grease_pencil_blend_size
const char datatoc_preview_blend[]
int datatoc_preview_blend_size
bool ED_view3d_camera_to_view_selected_with_set_clipping(Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
ImBuf * ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, Object *camera, int width, int height, eImBufFlags imbuf_flags, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256])
static void split(const char *text, const char *seps, char ***str, int *count)
void GPU_texture_free(blender::gpu::Texture *texture)
void IMB_premultiply_alpha(ImBuf *ibuf)
void IMB_assign_float_buffer(ImBuf *ibuf, float *buffer_data, ImBufOwnership ownership)
void IMB_byte_from_float(ImBuf *ibuf)
void IMB_freeImBuf(ImBuf *ibuf)
ImBuf * IMB_scale_into_new(const ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
void IMB_thumb_path_unlock(const char *path)
void IMB_thumb_locks_acquire()
ImBuf * IMB_thumb_manage(const char *file_or_lib_path, ThumbSize size, ThumbSource source)
void IMB_thumb_path_lock(const char *path)
void IMB_thumb_locks_release()
Read Guarded memory(de)allocation.
void UI_icon_render_id(const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job)
@ WM_JOB_TYPE_RENDER_PREVIEW
@ WM_JOB_TYPE_LOAD_PREVIEW
BPy_StructRNA * depsgraph
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static void load_jobless(PreviewImage *preview, eIconSizes icon_size)
void push_load_request(PreviewImage *preview, eIconSizes icon_size)
static PreviewLoadJob & ensure_job(wmWindowManager *wm, wmWindow *win)
RenderEngineType * RE_engines_find(const char *idname)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
void pose_apply_action_all_bones(Object *ob, bAction *action, slot_handle_t slot_handle, const AnimationEvalContext *anim_eval_context)
Slot & get_best_pose_slot_for_id(const ID &id, Action &pose_data)
bNode * node_find_node_by_name(bNodeTree &ntree, StringRefNull name)
bNodeTree * node_tree_add_tree_embedded(Main *bmain, ID *owner_id, StringRefNull name, StringRefNull idname)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, StringRef identifier)
bNode * node_add_node(const bContext *C, bNodeTree &ntree, StringRef idname, std::optional< int > unique_identifier=std::nullopt)
bNodeLink & node_add_link(bNodeTree &ntree, bNode &fromnode, bNodeSocket &fromsock, bNode &tonode, bNodeSocket &tosock)
void node_set_active(bNodeTree &ntree, bNode &node)
float wrap(float value, float max, float min)
static bool preview_method_is_render(const ePreviewRenderMethod pr_method)
static bool scene_preview_is_supported(const Scene *scene)
static void icon_preview_add_size(IconPreview *ip, uint *rect, int sizex, int sizey)
static void shader_preview_texture(ShaderPreview *sp, Tex *tex, Scene *sce, Render *re)
static ID * duplicate_ids(ID *id, const bool allow_failure)
static void icon_preview_endjob(void *customdata)
static bool render_engine_supports_ray_visibility(const Scene *sce)
void ED_preview_free_dbase()
static void icon_preview_startjob_all_sizes(void *customdata, wmJobWorkerStatus *worker_status)
static ListBase G_restart_previews_queue
static void shader_preview_free(void *customdata)
World * ED_preview_prepare_world(Main *pr_main, const Scene *scene, const World *world, const ID_Type id_type, const ePreviewRenderMethod pr_method)
static void preview_sync_exposure(World *dst, const World *src)
static Main * load_main_from_memory(const void *blend, int blend_size)
static void icon_copy_rect(const ImBuf *ibuf, uint w, uint h, uint *rect)
static void shader_preview_update(void *spv, RenderResult *, rcti *)
static void action_preview_render_cleanup(IconPreview *preview, PoseBackup *pose_backup)
const char * ED_preview_collection_name(const ePreviewType pr_type)
static World * preview_get_localized_world(ShaderPreview *sp, World *world)
void ED_preview_world_simple_set_rgb(World *world, const float color[4])
static void icon_preview_free(void *customdata)
void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, uiPreview *ui_preview, rcti *rect)
void ED_preview_kill_jobs(wmWindowManager *wm, Main *)
void ED_preview_icon_render(const bContext *C, Scene *scene, PreviewImage *prv_img, ID *id, eIconSizes icon_size)
static bool ed_preview_draw_rect(Scene *scene, const void *owner, int split, int first, const rcti *rect, rcti *newrect)
static Scene * preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_type, ShaderPreview *sp)
static World * preview_get_world(Main *pr_main, const Scene *sce, const ID_Type id_type, const ePreviewRenderMethod pr_method)
static void other_id_types_preview_render(IconPreview *ip, IconPreviewSize *cur_size, const ePreviewRenderMethod pr_method, wmJobWorkerStatus *worker_status)
void ED_preview_restart_queue_work(const bContext *C)
void ED_preview_shader_job(const bContext *C, const void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey, ePreviewRenderMethod method)
void ED_preview_restart_queue_add(ID *id, enum eIconSizes size)
static Scene * preview_get_scene(Main *pr_main)
World * ED_preview_prepare_world_simple(Main *pr_main)
static Scene * object_preview_scene_create(const ObjectPreviewData *preview_data, Depsgraph **r_depsgraph)
void ED_preview_kill_jobs_for_id(wmWindowManager *wm, const ID *id)
static void object_preview_render(IconPreview *preview, IconPreviewSize *preview_sized)
static int icon_previewimg_size_index_get(const IconPreviewSize *icon_size, const PreviewImage *preview_image)
static void switch_preview_floor_visibility(Main *pr_main, const Scene *scene, ViewLayer *view_layer, const ePreviewRenderMethod pr_method)
static void action_preview_render(IconPreview *preview, IconPreviewSize *preview_sized)
void ED_preview_ensure_dbase(const bool with_gpencil)
void ED_preview_set_visibility(Main *pr_main, Scene *scene, ViewLayer *view_layer, const ePreviewType pr_type, const ePreviewRenderMethod pr_method)
static Main * G_pr_main_grease_pencil
static void set_alpha(char *cp, int sizex, int sizey, char alpha)
bool ED_check_engine_supports_preview(const Scene *scene)
static void shader_preview_startjob(void *customdata, bool *stop, bool *do_update)
static const char * preview_world_name(const Scene *sce, const ID_Type id_type, const ePreviewRenderMethod pr_method)
static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int first)
static void preview_id_copy_free(ID *id)
static void switch_preview_collection_visibility(ViewLayer *view_layer, const ePreviewType pr_type)
bool ED_preview_use_image_size(const PreviewImage *preview, eIconSizes size)
static Object * object_preview_camera_create(Main *preview_main, Scene *scene, ViewLayer *view_layer, Object *preview_object)
bool ED_preview_id_is_supported(const ID *id, const char **r_disabled_hint)
static void scene_preview_render(IconPreview *preview, IconPreviewSize *preview_sized, ReportList *reports)
void ED_previews_tag_dirty_by_id(const Main &bmain, const ID &id)
static bool object_preview_is_type_supported(const Object *ob)
static const char * preview_floor_material_name(const Scene *scene, const ePreviewRenderMethod pr_method)
static void common_preview_startjob(void *customdata, wmJobWorkerStatus *worker_status)
void ED_preview_icon_job(const bContext *C, PreviewImage *prv_img, ID *id, eIconSizes icon_size, const bool delay)
static void switch_preview_floor_material(Main *pr_main, Mesh *mesh, const Scene *scene, const ePreviewRenderMethod pr_method)
static void icon_preview_startjob(void *customdata, bool *stop, bool *do_update)
void ED_preview_restart_queue_free()
static bool shader_preview_break(void *spv)
static void shader_preview_updatejob(void *)
static PoseBackup * action_preview_render_prepare(IconPreview *preview)
ImBuf * RE_RenderViewEnsureImBuf(const RenderResult *render_result, RenderView *render_view)
RenderView * RE_RenderViewGetById(RenderResult *rr, const int view_id)
const char * RE_engine_id_BLENDER_EEVEE
void RE_ReleaseResultImageViews(Render *re, RenderResult *rr)
void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
void RE_test_break_cb(Render *re, void *handle, bool(*f)(void *handle))
void RE_InitState(Render *re, Render *source, RenderData *rd, ListBase *, ViewLayer *single_layer, int winx, int winy, const rcti *disprect)
void RE_ResultGet32(Render *re, uint *rect)
Render * RE_NewRender(const void *owner)
RenderResult * RE_AcquireResultWrite(Render *re)
void RE_ReleaseResult(Render *re)
void RE_display_update_cb(Render *re, void *handle, void(*f)(void *handle, RenderResult *rr, rcti *rect))
void RE_AcquireResultImageViews(Render *re, RenderResult *rr)
void RE_SetScene(Render *re, Scene *sce)
Render * RE_GetRender(const void *owner)
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
struct LayerCollection * next
ListBase layer_collections
struct Collection * collection
struct PreviewImage * preview
struct MaterialGPencilStyle * gp_style
struct Collection * instance_collection
PreviewImageRuntimeHandle * runtime
PreviewRestartQueueEntry * prev
PreviewRestartQueueEntry * next
struct Collection * master_collection
struct SceneDisplay display
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
ePreviewRenderMethod pr_method
struct bNodeTree * nodetree
struct ViewLayerEEVEE eevee
ListBase layer_collections
struct bNodeTree * nodetree
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
void WM_global_report(eReportType type, const char *message)
void WM_main_add_notifier(uint type, void *reference)
void WM_global_reportf(eReportType type, const char *format,...)
bool WM_jobs_is_running(const wmJob *wm_job)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
void WM_jobs_kill_type(wmWindowManager *wm, const void *owner, int job_type)
void * WM_jobs_customdata_get(wmJob *wm_job)
void WM_jobs_delay_start(wmJob *wm_job, double delay_time)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
bool WM_jobs_test(const wmWindowManager *wm, const void *owner, int job_type)
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))
void * WM_jobs_customdata_from_type(wmWindowManager *wm, const void *owner, int job_type)