Blender V4.3
BKE_shader_fx.h File Reference

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 *user_data, struct Object *ob, struct ID **idpoin, int cb_flag)
 
typedef void(* ShaderFxTexWalkFunc) (void *user_data, 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)
 
void BKE_shaderfx_unique_name (struct ListBase *shaders, 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 *user_data)
 
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, 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 26 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 29 of file BKE_shader_fx.h.

◆ SHADERFX_TYPE_PANEL_PREFIX

#define SHADERFX_TYPE_PANEL_PREFIX   "FX_PT_"

Definition at line 137 of file BKE_shader_fx.h.

Referenced by BKE_shaderfxType_panel_id().

Typedef Documentation

◆ ShaderFxIDWalkFunc

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

Definition at line 54 of file BKE_shader_fx.h.

◆ ShaderFxTexWalkFunc

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

Definition at line 58 of file BKE_shader_fx.h.

◆ ShaderFxTypeInfo

typedef struct ShaderFxTypeInfo ShaderFxTypeInfo

Enumeration Type Documentation

◆ ShaderFxTypeFlag

Enumerator
eShaderFxTypeFlag_SupportsEditmode 
eShaderFxTypeFlag_EnableInEditmode 
eShaderFxTypeFlag_Single 
eShaderFxTypeFlag_NoUserAdd 

Definition at line 39 of file BKE_shader_fx.h.

◆ ShaderFxTypeType

Enumerator
eShaderFxType_NoneType 
eShaderFxType_GpencilType 

Definition at line 31 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,
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 )

◆ BKE_shaderfx_copydata()

void BKE_shaderfx_copydata ( struct ShaderFxData * fx,
struct ShaderFxData * target )

◆ BKE_shaderfx_copydata_ex()

◆ BKE_shaderfx_copydata_generic()

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

◆ 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 )

◆ BKE_shaderfx_findby_type()

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

◆ BKE_shaderfx_foreach_ID_link()

◆ BKE_shaderfx_free()

void BKE_shaderfx_free ( struct ShaderFxData * fx)

Definition at line 110 of file shader_fx.cc.

References BKE_shaderfx_free_ex().

Referenced by blender::ed::object::object_shaderfx_remove().

◆ BKE_shaderfx_free_ex()

◆ BKE_shaderfx_get_info()

◆ 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 48 of file shader_fx.cc.

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 blender::ed::object::edit_shaderfx_poll_generic().

◆ BKE_shaderfx_new()

◆ BKE_shaderfx_panel_expand()

void BKE_shaderfx_panel_expand ( struct ShaderFxData * fx)

◆ BKE_shaderfx_unique_name()

void BKE_shaderfx_unique_name ( struct ListBase * shaders,
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 panel_register callback.

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

Definition at line 147 of file shader_fx.cc.

References BKE_shaderfx_get_info(), BKE_ST_MAXNAME, BLI_string_join, ShaderFxTypeInfo::name, and SHADERFX_TYPE_PANEL_PREFIX.

Referenced by shaderfx_panel_id(), and shaderfx_panel_register().