Blender  V3.3
object_shader_fx.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_gpencil_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_shader_fx_types.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_shader_fx.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_prototypes.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "WM_api.h"
#include "WM_types.h"
#include "object_intern.h"

Go to the source code of this file.

Functions

Public API
ShaderFxDataED_object_shaderfx_add (ReportList *reports, Main *bmain, Scene *UNUSED(scene), Object *ob, const char *name, int type)
 
static bool UNUSED_FUNCTION() object_has_shaderfx (const Object *ob, const ShaderFxData *exclude, ShaderFxType type)
 
static bool object_shaderfx_remove (Main *bmain, Object *ob, ShaderFxData *fx, bool *UNUSED(r_sort_depsgraph))
 
bool ED_object_shaderfx_remove (ReportList *reports, Main *bmain, Object *ob, ShaderFxData *fx)
 
void ED_object_shaderfx_clear (Main *bmain, Object *ob)
 
int ED_object_shaderfx_move_up (ReportList *UNUSED(reports), Object *ob, ShaderFxData *fx)
 
int ED_object_shaderfx_move_down (ReportList *UNUSED(reports), Object *ob, ShaderFxData *fx)
 
bool ED_object_shaderfx_move_to_index (ReportList *reports, Object *ob, ShaderFxData *fx, const int index)
 
void ED_object_shaderfx_link (Object *dst, Object *src)
 
void ED_object_shaderfx_copy (Object *dst, ShaderFxData *fx)
 
Generic Poll Callback Helpers
static bool edit_shaderfx_poll_generic (bContext *C, StructRNA *rna_type, int obtype_flag, const bool is_liboverride_allowed)
 
static bool edit_shaderfx_poll (bContext *C)
 
Add Effect Operator
static int shaderfx_add_exec (bContext *C, wmOperator *op)
 
static const EnumPropertyItemshaderfx_add_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 
void OBJECT_OT_shaderfx_add (wmOperatorType *ot)
 
Generic Functions for Operators Using Names and Data Context
static void edit_shaderfx_properties (wmOperatorType *ot)
 
static void edit_shaderfx_report_property (wmOperatorType *ot)
 
static bool edit_shaderfx_invoke_properties (bContext *C, wmOperator *op, const wmEvent *event, int *r_retval)
 
static ShaderFxDataedit_shaderfx_property_get (wmOperator *op, Object *ob, int type)
 
Remove ShaderFX Operator
static int shaderfx_remove_exec (bContext *C, wmOperator *op)
 
static int shaderfx_remove_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OBJECT_OT_shaderfx_remove (wmOperatorType *ot)
 
Move up ShaderFX Operator
static int shaderfx_move_up_exec (bContext *C, wmOperator *op)
 
static int shaderfx_move_up_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OBJECT_OT_shaderfx_move_up (wmOperatorType *ot)
 
Move Down ShaderFX Operator
static int shaderfx_move_down_exec (bContext *C, wmOperator *op)
 
static int shaderfx_move_down_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OBJECT_OT_shaderfx_move_down (wmOperatorType *ot)
 
Move ShaderFX to Index Operator
static int shaderfx_move_to_index_exec (bContext *C, wmOperator *op)
 
static int shaderfx_move_to_index_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OBJECT_OT_shaderfx_move_to_index (wmOperatorType *ot)
 
Copy Shader Operator
static int shaderfx_copy_exec (bContext *C, wmOperator *op)
 
static int shaderfx_copy_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OBJECT_OT_shaderfx_copy (wmOperatorType *ot)
 

Function Documentation

◆ ED_object_shaderfx_add()

ShaderFxData* ED_object_shaderfx_add ( ReportList reports,
Main bmain,
Scene UNUSEDscene,
Object ob,
const char *  name,
int  type 
)

◆ ED_object_shaderfx_clear()

void ED_object_shaderfx_clear ( Main bmain,
Object ob 
)

◆ ED_object_shaderfx_copy()

void ED_object_shaderfx_copy ( Object dst,
ShaderFxData fx 
)

◆ ED_object_shaderfx_link()

void ED_object_shaderfx_link ( Object dst,
Object src 
)

◆ ED_object_shaderfx_move_down()

int ED_object_shaderfx_move_down ( ReportList UNUSEDreports,
Object ob,
ShaderFxData fx 
)

◆ ED_object_shaderfx_move_to_index()

bool ED_object_shaderfx_move_to_index ( ReportList reports,
Object ob,
ShaderFxData fx,
const int  index 
)

◆ ED_object_shaderfx_move_up()

int ED_object_shaderfx_move_up ( ReportList UNUSEDreports,
Object ob,
ShaderFxData fx 
)

◆ ED_object_shaderfx_remove()

bool ED_object_shaderfx_remove ( ReportList reports,
Main bmain,
Object ob,
ShaderFxData fx 
)

◆ edit_shaderfx_invoke_properties()

static bool edit_shaderfx_invoke_properties ( bContext C,
wmOperator op,
const wmEvent event,
int *  r_retval 
)
static
Parameters
eventIf this isn't NULL, the operator will also look for panels underneath the cursor with custom-data set to a modifier.
r_retvalThis should be used if #event is used in order to return OPERATOR_PASS_THROUGH to check other operators with the same key set.

Definition at line 417 of file object_shader_fx.c.

References BLI_assert, C, CTX_data_pointer_get_type(), PointerRNA::data, ShaderFxData::name, NULL, OPERATOR_CANCELLED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_pointer_is_null(), RNA_string_set(), RNA_struct_is_a(), RNA_struct_property_is_set(), PointerRNA::type, and UI_region_panel_custom_data_under_cursor().

Referenced by shaderfx_copy_invoke(), shaderfx_move_down_invoke(), shaderfx_move_to_index_invoke(), shaderfx_move_up_invoke(), and shaderfx_remove_invoke().

◆ edit_shaderfx_poll()

static bool edit_shaderfx_poll ( bContext C)
static

◆ edit_shaderfx_poll_generic()

static bool edit_shaderfx_poll_generic ( bContext C,
StructRNA rna_type,
int  obtype_flag,
const bool  is_liboverride_allowed 
)
static

◆ edit_shaderfx_properties()

static void edit_shaderfx_properties ( wmOperatorType ot)
static

◆ edit_shaderfx_property_get()

static ShaderFxData* edit_shaderfx_property_get ( wmOperator op,
Object ob,
int  type 
)
static

◆ edit_shaderfx_report_property()

static void edit_shaderfx_report_property ( wmOperatorType ot)
static

◆ object_has_shaderfx()

static bool UNUSED_FUNCTION() object_has_shaderfx ( const Object ob,
const ShaderFxData exclude,
ShaderFxType  type 
)
static

Definition at line 98 of file object_shader_fx.c.

References ShaderFxData::next, type, and ShaderFxData::type.

◆ OBJECT_OT_shaderfx_add()

void OBJECT_OT_shaderfx_add ( wmOperatorType ot)

◆ OBJECT_OT_shaderfx_copy()

void OBJECT_OT_shaderfx_copy ( wmOperatorType ot)

◆ OBJECT_OT_shaderfx_move_down()

void OBJECT_OT_shaderfx_move_down ( wmOperatorType ot)

◆ OBJECT_OT_shaderfx_move_to_index()

void OBJECT_OT_shaderfx_move_to_index ( wmOperatorType ot)

◆ OBJECT_OT_shaderfx_move_up()

void OBJECT_OT_shaderfx_move_up ( wmOperatorType ot)

◆ OBJECT_OT_shaderfx_remove()

void OBJECT_OT_shaderfx_remove ( wmOperatorType ot)

◆ object_shaderfx_remove()

static bool object_shaderfx_remove ( Main bmain,
Object ob,
ShaderFxData fx,
bool UNUSEDr_sort_depsgraph 
)
static

◆ shaderfx_add_exec()

static int shaderfx_add_exec ( bContext C,
wmOperator op 
)
static

◆ shaderfx_add_itemf()

static const EnumPropertyItem* shaderfx_add_itemf ( bContext C,
PointerRNA UNUSEDptr,
PropertyRNA UNUSEDprop,
bool r_free 
)
static

◆ shaderfx_copy_exec()

static int shaderfx_copy_exec ( bContext C,
wmOperator op 
)
static

◆ shaderfx_copy_invoke()

static int shaderfx_copy_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

Definition at line 698 of file object_shader_fx.c.

References C, edit_shaderfx_invoke_properties(), and shaderfx_copy_exec().

Referenced by OBJECT_OT_shaderfx_copy().

◆ shaderfx_move_down_exec()

static int shaderfx_move_down_exec ( bContext C,
wmOperator op 
)
static

◆ shaderfx_move_down_invoke()

static int shaderfx_move_down_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ shaderfx_move_to_index_exec()

static int shaderfx_move_to_index_exec ( bContext C,
wmOperator op 
)
static

◆ shaderfx_move_to_index_invoke()

static int shaderfx_move_to_index_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ shaderfx_move_up_exec()

static int shaderfx_move_up_exec ( bContext C,
wmOperator op 
)
static

◆ shaderfx_move_up_invoke()

static int shaderfx_move_up_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ shaderfx_remove_exec()

static int shaderfx_remove_exec ( bContext C,
wmOperator op 
)
static

◆ shaderfx_remove_invoke()

static int shaderfx_remove_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static