Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
BKE_shader_fx.h File Reference
#include "BLI_compiler_attrs.h"
#include "DNA_shader_fx_types.h"

Go to the source code of this file.

Classes

struct  ShaderFxTypeInfo
 

Macros

#define SHADER_FX_ACTIVE(_fx, _is_render)
 
#define SHADER_FX_EDIT(_fx, _is_edit)   ((((_fx)->mode & eShaderFxMode_Editmode) == 0) && (_is_edit))
 
#define SHADERFX_TYPE_PANEL_PREFIX   "FX_PT_"
 

Typedefs

typedef void(* ShaderFxIDWalkFunc) (void *userData, struct Object *ob, struct ID **idpoin, int cb_flag)
 
typedef void(* ShaderFxTexWalkFunc) (void *userData, struct Object *ob, struct ShaderFxData *fx, const char *propname)
 
typedef struct ShaderFxTypeInfo ShaderFxTypeInfo
 

Enumerations

enum  ShaderFxTypeType { eShaderFxType_NoneType , eShaderFxType_GpencilType }
 
enum  ShaderFxTypeFlag { eShaderFxTypeFlag_SupportsEditmode = (1 << 0) , eShaderFxTypeFlag_EnableInEditmode = (1 << 2) , eShaderFxTypeFlag_Single = (1 << 4) , eShaderFxTypeFlag_NoUserAdd = (1 << 5) }
 

Functions

void BKE_shaderfx_init (void)
 
void BKE_shaderfxType_panel_id (ShaderFxType type, char *r_idname)
 
void BKE_shaderfx_panel_expand (struct ShaderFxData *fx)
 
const ShaderFxTypeInfoBKE_shaderfx_get_info (ShaderFxType type)
 
struct ShaderFxDataBKE_shaderfx_new (int type)
 
void BKE_shaderfx_free_ex (struct ShaderFxData *fx, int flag)
 
void BKE_shaderfx_free (struct ShaderFxData *fx)
 
bool BKE_shaderfx_unique_name (struct ListBase *shaderfx, struct ShaderFxData *fx)
 
bool BKE_shaderfx_depends_ontime (struct ShaderFxData *fx)
 
bool BKE_shaderfx_is_nonlocal_in_liboverride (const struct Object *ob, const struct ShaderFxData *shaderfx)
 
struct ShaderFxDataBKE_shaderfx_findby_type (struct Object *ob, ShaderFxType type)
 
struct ShaderFxDataBKE_shaderfx_findby_name (struct Object *ob, const char *name)
 
void BKE_shaderfx_copydata_generic (const struct ShaderFxData *fx_src, struct ShaderFxData *fx_dst)
 
void BKE_shaderfx_copydata (struct ShaderFxData *fx, struct ShaderFxData *target)
 
void BKE_shaderfx_copydata_ex (struct ShaderFxData *fx, struct ShaderFxData *target, int flag)
 
void BKE_shaderfx_copy (struct ListBase *dst, const struct ListBase *src)
 
void BKE_shaderfx_foreach_ID_link (struct Object *ob, ShaderFxIDWalkFunc walk, void *userData)
 
bool BKE_shaderfx_has_gpencil (const struct Object *ob)
 
void BKE_shaderfx_blend_write (struct BlendWriter *writer, struct ListBase *fxbase)
 
void BKE_shaderfx_blend_read_data (struct BlendDataReader *reader, struct ListBase *lb)
 
void BKE_shaderfx_blend_read_lib (struct BlendLibReader *reader, struct Object *ob)
 

Macro Definition Documentation

◆ SHADER_FX_ACTIVE

#define SHADER_FX_ACTIVE (   _fx,
  _is_render 
)
Value:
((((_fx)->mode & eShaderFxMode_Realtime) && (_is_render == false)) || \
(((_fx)->mode & eShaderFxMode_Render) && (_is_render == true)))
@ eShaderFxMode_Realtime
@ eShaderFxMode_Render

Definition at line 25 of file BKE_shader_fx.h.

◆ SHADER_FX_EDIT

#define SHADER_FX_EDIT (   _fx,
  _is_edit 
)    ((((_fx)->mode & eShaderFxMode_Editmode) == 0) && (_is_edit))

Definition at line 28 of file BKE_shader_fx.h.

◆ SHADERFX_TYPE_PANEL_PREFIX

#define SHADERFX_TYPE_PANEL_PREFIX   "FX_PT_"

Definition at line 136 of file BKE_shader_fx.h.

Typedef Documentation

◆ ShaderFxIDWalkFunc

typedef void(* ShaderFxIDWalkFunc) (void *userData, struct Object *ob, struct ID **idpoin, int cb_flag)

Definition at line 53 of file BKE_shader_fx.h.

◆ ShaderFxTexWalkFunc

typedef void(* ShaderFxTexWalkFunc) (void *userData, struct Object *ob, struct ShaderFxData *fx, const char *propname)

Definition at line 57 of file BKE_shader_fx.h.

◆ ShaderFxTypeInfo

Enumeration Type Documentation

◆ ShaderFxTypeFlag

Enumerator
eShaderFxTypeFlag_SupportsEditmode 
eShaderFxTypeFlag_EnableInEditmode 
eShaderFxTypeFlag_Single 
eShaderFxTypeFlag_NoUserAdd 

Definition at line 38 of file BKE_shader_fx.h.

◆ ShaderFxTypeType

Enumerator
eShaderFxType_NoneType 
eShaderFxType_GpencilType 

Definition at line 30 of file BKE_shader_fx.h.

Function Documentation

◆ BKE_shaderfx_blend_read_data()

void BKE_shaderfx_blend_read_data ( struct BlendDataReader reader,
struct ListBase lb 
)

◆ BKE_shaderfx_blend_read_lib()

void BKE_shaderfx_blend_read_lib ( struct BlendLibReader reader,
struct Object ob 
)

◆ BKE_shaderfx_blend_write()

void BKE_shaderfx_blend_write ( struct BlendWriter writer,
struct ListBase fxbase 
)

◆ BKE_shaderfx_copy()

void BKE_shaderfx_copy ( struct ListBase dst,
const struct ListBase src 
)

Referenced by ED_object_shaderfx_link().

◆ BKE_shaderfx_copydata()

void BKE_shaderfx_copydata ( struct ShaderFxData fx,
struct ShaderFxData target 
)

◆ BKE_shaderfx_copydata_ex()

void BKE_shaderfx_copydata_ex ( struct ShaderFxData fx,
struct ShaderFxData target,
int  flag 
)

◆ BKE_shaderfx_copydata_generic()

void BKE_shaderfx_copydata_generic ( const struct ShaderFxData fx_src,
struct ShaderFxData fx_dst 
)

Referenced by copyData().

◆ BKE_shaderfx_depends_ontime()

bool BKE_shaderfx_depends_ontime ( struct ShaderFxData fx)

◆ BKE_shaderfx_findby_name()

struct ShaderFxData* BKE_shaderfx_findby_name ( struct Object ob,
const char *  name 
)

Definition at line 259 of file shader_fx.c.

References BLI_findstring(), and Object::shader_fx.

Referenced by edit_shaderfx_property_get().

◆ BKE_shaderfx_findby_type()

struct ShaderFxData* BKE_shaderfx_findby_type ( struct Object ob,
ShaderFxType  type 
)

◆ BKE_shaderfx_foreach_ID_link()

void BKE_shaderfx_foreach_ID_link ( struct Object ob,
ShaderFxIDWalkFunc  walk,
void userData 
)

◆ BKE_shaderfx_free()

void BKE_shaderfx_free ( struct ShaderFxData fx)

Definition at line 117 of file shader_fx.c.

References BKE_shaderfx_free_ex().

Referenced by object_shaderfx_remove().

◆ BKE_shaderfx_free_ex()

void BKE_shaderfx_free_ex ( struct ShaderFxData fx,
int  flag 
)

◆ BKE_shaderfx_get_info()

const ShaderFxTypeInfo* BKE_shaderfx_get_info ( ShaderFxType  type)

◆ BKE_shaderfx_has_gpencil()

bool BKE_shaderfx_has_gpencil ( const struct Object ob)

Check if exist grease pencil effects.

◆ BKE_shaderfx_init()

void BKE_shaderfx_init ( void  )

Initialize global data (type info and some common global storage).

Definition at line 56 of file shader_fx.c.

References shader_fx_types, and shaderfx_type_init().

Referenced by main().

◆ BKE_shaderfx_is_nonlocal_in_liboverride()

bool BKE_shaderfx_is_nonlocal_in_liboverride ( const struct Object ob,
const struct ShaderFxData shaderfx 
)

Check whether given shaderfx is not local (i.e. from linked data) when the object is a library override.

Parameters
shaderfxMay be NULL, in which case we consider it as a non-local shaderfx case.

Referenced by edit_shaderfx_poll_generic().

◆ BKE_shaderfx_new()

struct ShaderFxData* BKE_shaderfx_new ( int  type)

◆ BKE_shaderfx_panel_expand()

void BKE_shaderfx_panel_expand ( struct ShaderFxData fx)

Definition at line 163 of file shader_fx.c.

References ShaderFxData::ui_expand_flag, and UI_PANEL_DATA_EXPAND_ROOT.

Referenced by outliner_set_properties_tab().

◆ BKE_shaderfx_unique_name()

bool BKE_shaderfx_unique_name ( struct ListBase shaderfx,
struct ShaderFxData fx 
)

◆ BKE_shaderfxType_panel_id()

void BKE_shaderfxType_panel_id ( ShaderFxType  type,
char *  r_idname 
)

Get an effect's panel type, which was defined in the panelRegister callback.

Note
ShaderFx panel types are assumed to be named with the struct name field concatenated to the defined prefix.

Definition at line 155 of file shader_fx.c.

References BKE_shaderfx_get_info(), ShaderFxTypeInfo::name, SHADERFX_TYPE_PANEL_PREFIX, and type.

Referenced by shaderfx_panel_id(), and shaderfx_panel_register().