Blender V2.61 - r43446
Classes | Typedefs | Functions | Variables

render_preview.c File Reference

#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "BLO_readfile.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "DNA_world_types.h"
#include "DNA_camera_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_lamp_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "DNA_scene_types.h"
#include "DNA_brush_types.h"
#include "DNA_screen_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_image.h"
#include "BKE_icons.h"
#include "BKE_lamp.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_texture.h"
#include "BKE_world.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "PIL_time.h"
#include "RE_pipeline.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_render.h"
#include "ED_view3d.h"
#include "UI_interface.h"
#include "render_intern.h"

Go to the source code of this file.

Classes

struct  ShaderPreview

Typedefs

typedef struct ShaderPreview ShaderPreview

Functions

ImBufget_brush_icon (Brush *brush)
void ED_preview_init_dbase (void)
void ED_preview_free_dbase (void)
static int preview_mat_has_sss (Material *mat, bNodeTree *ntree)
static Scenepreview_prepare_scene (Scene *scene, ID *id, int id_type, ShaderPreview *sp)
static int ed_preview_draw_rect (ScrArea *sa, Scene *sce, ID *id, int split, int first, rcti *rect, rcti *newrect)
void ED_preview_draw (const bContext *C, void *idp, void *parentp, void *slotp, rcti *rect)
static void shader_preview_draw (void *spv, RenderResult *UNUSED(rr), volatile struct rcti *UNUSED(rect))
static int shader_preview_break (void *spv)
static void shader_preview_updatejob (void *spv)
static void shader_preview_render (ShaderPreview *sp, ID *id, int split, int first)
static void shader_preview_startjob (void *customdata, short *stop, short *do_update)
static void shader_preview_free (void *customdata)
static void icon_copy_rect (ImBuf *ibuf, unsigned int w, unsigned int h, unsigned int *rect)
static void set_alpha (char *cp, int sizex, int sizey, char alpha)
static void icon_preview_startjob (void *customdata, short *stop, short *do_update)
static void common_preview_startjob (void *customdata, short *stop, short *do_update, float *UNUSED(progress))
static void common_preview_endjob (void *customdata)
void ED_preview_icon_job (const bContext *C, void *owner, ID *id, unsigned int *rect, int sizex, int sizey)
void ED_preview_shader_job (const bContext *C, void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey, int method)
void ED_preview_kill_jobs (const struct bContext *C)

Variables

static Mainpr_main = NULL

Detailed Description

Definition in file render_preview.c.


Typedef Documentation

typedef struct ShaderPreview ShaderPreview

Function Documentation

static void common_preview_endjob ( void *  customdata) [static]

Definition at line 947 of file render_preview.c.

References GS, ShaderPreview::id, ID_BR, NA_EDITED, ID::name, NC_BRUSH, and WM_main_add_notifier().

Referenced by ED_preview_icon_job().

static void common_preview_startjob ( void *  customdata,
short *  stop,
short *  do_update,
float *  UNUSEDprogress 
) [static]
void ED_preview_draw ( const bContext C,
void *  idp,
void *  parentp,
void *  slotp,
rcti rect 
)
static int ed_preview_draw_rect ( ScrArea sa,
Scene sce,
ID id,
int  split,
int  first,
rcti rect,
rcti newrect 
) [static]
void ED_preview_free_dbase ( void  )

Definition at line 190 of file render_preview.c.

References free_main().

Referenced by WM_exit_ext().

void ED_preview_icon_job ( const bContext C,
void *  owner,
ID id,
unsigned int *  rect,
int  sizex,
int  sizey 
)
void ED_preview_init_dbase ( void  )
void ED_preview_kill_jobs ( const struct bContext C)
void ED_preview_shader_job ( const bContext C,
void *  owner,
ID id,
ID parent,
MTex slot,
int  sizex,
int  sizey,
int  method 
)
ImBuf* get_brush_icon ( Brush brush) [read]
static void icon_copy_rect ( ImBuf ibuf,
unsigned int  w,
unsigned int  h,
unsigned int *  rect 
) [static]
static void icon_preview_startjob ( void *  customdata,
short *  stop,
short *  do_update 
) [static]
static int preview_mat_has_sss ( Material mat,
bNodeTree ntree 
) [static]
static Scene* preview_prepare_scene ( Scene scene,
ID id,
int  id_type,
ShaderPreview sp 
) [static]

Definition at line 224 of file render_preview.c.

References Object::actcol, Material::alpha, RenderData::alphamode, Scene::base, BLI_addtail(), BLI_findstring(), BLI_strncpy(), Scene::camera, RenderData::cfra, ShaderPreview::col, Object::col, RenderData::color_mgt_flag, copy_v4_v4(), Object::data, end_render_material(), RenderData::engine, World::exp, ListBase::first, Tex::flag, give_current_material(), give_matarar(), Object::id, ID_LA, ID_MA, ID_TE, ID_WO, init_render_material(), LA_SUN, LA_SUN_EFFECT_SKY, Main::lamp, ShaderPreview::lampcopy, Scene::lay, localize_lamp(), localize_material(), localize_texture(), localize_world(), MA_ATMOS, MA_FLAT, MA_LAMP, MA_OBCOLOR, MA_RAYMIRROR, MA_RAYTRANSP, MA_SHADBUF, MA_SKY, MA_SPHERE_A, MA_TEXTURE, MA_TRANSP, MA_TYPE_HALO, MA_TYPE_VOLUME, MAP_ALPHA, MTex::mapto, Main::mat, ShaderPreview::matcopy, Material::material_type, MAX2, Material::mode, RenderData::mode, Material::mode_l, Material::mtex, ID::name, Base::next, World::nodetree, Lamp::nodetree, Tex::nodetree, Material::nodetree, ntreeInitPreview(), NULL, OB_LAMP, OB_RESTRICT_RENDER, OB_TYPE_SUPPORT_MATERIAL, Main::object, Base::object, PR_ICON_RENDER, ShaderPreview::pr_method, PR_NODE_RENDER, Material::pr_type, preview_mat_has_sss(), Scene::r, R_ADDSKY, R_ALPHAPREMUL, R_COLOR_MANAGEMENT, R_OSA, R_PREVIEWBUTS, R_RAYTRACE, R_SHADOW, R_SSS, World::range, Object::restrictflag, RenderData::scemode, Main::scene, Material::septex, Material::shade_flag, ShaderPreview::sizex, ShaderPreview::sizey, ShaderPreview::slot, Lamp::sun_effect_type, MTex::tex, Main::tex, TEX_PRV_ALPHA, ShaderPreview::texcopy, Lamp::type, Object::type, MTex::which_output, Main::world, Scene::world, ShaderPreview::worldcopy, RenderData::xparts, and RenderData::yparts.

Referenced by shader_preview_render().

static void set_alpha ( char *  cp,
int  sizex,
int  sizey,
char  alpha 
) [static]

Definition at line 864 of file render_preview.c.

References size().

Referenced by icon_preview_startjob().

static int shader_preview_break ( void *  spv) [static]

Definition at line 577 of file render_preview.c.

References ShaderPreview::stop.

Referenced by shader_preview_render().

static void shader_preview_draw ( void *  spv,
RenderResult UNUSEDrr,
volatile struct rcti UNUSEDrect 
) [static]

Definition at line 569 of file render_preview.c.

References ShaderPreview::do_update.

Referenced by shader_preview_render().

static void shader_preview_free ( void *  customdata) [static]
static void shader_preview_render ( ShaderPreview sp,
ID id,
int  split,
int  first 
) [static]
static void shader_preview_startjob ( void *  customdata,
short *  stop,
short *  do_update 
) [static]
static void shader_preview_updatejob ( void *  spv) [static]

Variable Documentation

Main* pr_main = NULL [static]

Definition at line 169 of file render_preview.c.