Blender
V3.3
|
#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.
ShaderFxData* ED_object_shaderfx_add | ( | ReportList * | reports, |
Main * | bmain, | ||
Scene * | UNUSEDscene, | ||
Object * | ob, | ||
const char * | name, | ||
int | type | ||
) |
Definition at line 57 of file object_shader_fx.c.
References BKE_report(), BKE_reportf(), BKE_shaderfx_findby_type(), BKE_shaderfx_get_info(), BKE_shaderfx_new(), BKE_shaderfx_unique_name(), BLI_addtail(), BLI_strncpy_utf8(), Object::data, DEG_id_tag_update(), DEG_relations_tag_update(), eShaderFxTypeFlag_Single, ShaderFxTypeInfo::flags, bGPdata::id, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, ShaderFxData::name, ID::name, NULL, OB_GPENCIL, RPT_WARNING, Object::shader_fx, type, and Object::type.
Referenced by shaderfx_add_exec().
Definition at line 152 of file object_shader_fx.c.
References DEG_id_tag_update(), DEG_relations_tag_update(), ListBase::first, Object::id, ID_RECALC_GEOMETRY, ShaderFxData::next, object_shaderfx_remove(), and Object::shader_fx.
void ED_object_shaderfx_copy | ( | Object * | dst, |
ShaderFxData * | fx | ||
) |
Definition at line 241 of file object_shader_fx.c.
References BKE_shaderfx_copydata(), BKE_shaderfx_new(), BLI_addtail(), BLI_strncpy(), DEG_id_tag_update(), Object::id, ID_RECALC_GEOMETRY, ShaderFxData::name, NC_OBJECT, ND_SHADERFX, Object::shader_fx, ShaderFxData::type, and WM_main_add_notifier().
Referenced by datastack_drop_copy().
Definition at line 232 of file object_shader_fx.c.
References BKE_shaderfx_copy(), BLI_freelistN(), DEG_id_tag_update(), Object::id, ID_RECALC_GEOMETRY, NC_OBJECT, ND_SHADERFX, Object::shader_fx, src, and WM_main_add_notifier().
Referenced by datastack_drop_link(), and make_links_data_exec().
int ED_object_shaderfx_move_down | ( | ReportList * | UNUSEDreports, |
Object * | ob, | ||
ShaderFxData * | fx | ||
) |
Definition at line 185 of file object_shader_fx.c.
References BLI_insertlinkafter(), BLI_remlink(), ShaderFxData::next, and Object::shader_fx.
Referenced by ED_object_shaderfx_move_to_index(), and shaderfx_move_down_exec().
bool ED_object_shaderfx_move_to_index | ( | ReportList * | reports, |
Object * | ob, | ||
ShaderFxData * | fx, | ||
const int | index | ||
) |
Definition at line 195 of file object_shader_fx.c.
References BKE_report(), BLI_assert, BLI_findindex(), BLI_listbase_count(), DEG_id_tag_update(), ED_object_shaderfx_move_down(), ED_object_shaderfx_move_up(), Object::id, ID_RECALC_GEOMETRY, NC_OBJECT, ND_SHADERFX, NULL, RPT_WARNING, Object::shader_fx, and WM_main_add_notifier().
Referenced by datastack_drop_reorder(), and shaderfx_move_to_index_exec().
int ED_object_shaderfx_move_up | ( | ReportList * | UNUSEDreports, |
Object * | ob, | ||
ShaderFxData * | fx | ||
) |
Definition at line 175 of file object_shader_fx.c.
References BLI_insertlinkbefore(), BLI_remlink(), ShaderFxData::prev, and Object::shader_fx.
Referenced by ED_object_shaderfx_move_to_index(), and shaderfx_move_up_exec().
bool ED_object_shaderfx_remove | ( | ReportList * | reports, |
Main * | bmain, | ||
Object * | ob, | ||
ShaderFxData * | fx | ||
) |
Definition at line 134 of file object_shader_fx.c.
References BKE_reportf(), DEG_id_tag_update(), DEG_relations_tag_update(), Object::id, ID_RECALC_GEOMETRY, ShaderFxData::name, ID::name, object_shaderfx_remove(), and RPT_ERROR.
Referenced by shaderfx_remove_exec().
|
static |
event | If this isn't NULL, the operator will also look for panels underneath the cursor with custom-data set to a modifier. |
r_retval | This 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().
Definition at line 295 of file object_shader_fx.c.
References C, and edit_shaderfx_poll_generic().
Referenced by OBJECT_OT_shaderfx_add(), OBJECT_OT_shaderfx_copy(), OBJECT_OT_shaderfx_move_down(), OBJECT_OT_shaderfx_move_to_index(), OBJECT_OT_shaderfx_move_up(), and OBJECT_OT_shaderfx_remove().
|
static |
Definition at line 258 of file object_shader_fx.c.
References BKE_id_is_editable(), BKE_shaderfx_is_nonlocal_in_liboverride(), C, CTX_data_main(), CTX_data_pointer_get_type(), CTX_wm_operator_poll_msg_set(), PointerRNA::data, ED_object_active_context(), ED_operator_object_active_editable_ex(), ID_IS_OVERRIDE_LIBRARY, is_liboverride_allowed, NULL, PointerRNA::owner_id, ptr, and Object::type.
Referenced by edit_shaderfx_poll().
|
static |
Definition at line 397 of file object_shader_fx.c.
References MAX_NAME, NULL, ot, PROP_HIDDEN, RNA_def_property_flag(), RNA_def_string(), and wmOperatorType::srna.
Referenced by OBJECT_OT_shaderfx_copy(), OBJECT_OT_shaderfx_move_down(), OBJECT_OT_shaderfx_move_to_index(), OBJECT_OT_shaderfx_move_up(), and OBJECT_OT_shaderfx_remove().
|
static |
Definition at line 458 of file object_shader_fx.c.
References BKE_shaderfx_findby_name(), MAX_NAME, NULL, wmOperator::ptr, RNA_string_get(), type, and ShaderFxData::type.
Referenced by shaderfx_copy_exec(), shaderfx_move_down_exec(), shaderfx_move_to_index_exec(), shaderfx_move_up_exec(), and shaderfx_remove_exec().
|
static |
Definition at line 404 of file object_shader_fx.c.
References ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by OBJECT_OT_shaderfx_remove().
|
static |
Definition at line 98 of file object_shader_fx.c.
References ShaderFxData::next, type, and ShaderFxData::type.
void OBJECT_OT_shaderfx_add | ( | wmOperatorType * | ot | ) |
Definition at line 367 of file object_shader_fx.c.
References BLT_I18NCONTEXT_ID_ID, wmOperatorType::description, edit_shaderfx_poll(), eShaderFxType_Blur, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_property_translation_context(), rna_enum_object_shaderfx_type_items, shaderfx_add_exec(), shaderfx_add_itemf(), wmOperatorType::srna, and WM_menu_invoke().
Referenced by ED_operatortypes_object().
void OBJECT_OT_shaderfx_copy | ( | wmOperatorType * | ot | ) |
Definition at line 707 of file object_shader_fx.c.
References wmOperatorType::description, edit_shaderfx_poll(), edit_shaderfx_properties(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, shaderfx_copy_exec(), and shaderfx_copy_invoke().
Referenced by ED_operatortypes_object().
void OBJECT_OT_shaderfx_move_down | ( | wmOperatorType * | ot | ) |
Definition at line 605 of file object_shader_fx.c.
References wmOperatorType::description, edit_shaderfx_poll(), edit_shaderfx_properties(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, shaderfx_move_down_exec(), and shaderfx_move_down_invoke().
Referenced by ED_operatortypes_object().
void OBJECT_OT_shaderfx_move_to_index | ( | wmOperatorType * | ot | ) |
Definition at line 648 of file object_shader_fx.c.
References wmOperatorType::description, edit_shaderfx_poll(), edit_shaderfx_properties(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_int(), shaderfx_move_to_index_exec(), shaderfx_move_to_index_invoke(), and wmOperatorType::srna.
Referenced by ED_operatortypes_object().
void OBJECT_OT_shaderfx_move_up | ( | wmOperatorType * | ot | ) |
Definition at line 560 of file object_shader_fx.c.
References wmOperatorType::description, edit_shaderfx_poll(), edit_shaderfx_properties(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, shaderfx_move_up_exec(), and shaderfx_move_up_invoke().
Referenced by ED_operatortypes_object().
void OBJECT_OT_shaderfx_remove | ( | wmOperatorType * | ot | ) |
Definition at line 514 of file object_shader_fx.c.
References wmOperatorType::description, edit_shaderfx_poll(), edit_shaderfx_properties(), edit_shaderfx_report_property(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, shaderfx_remove_exec(), and shaderfx_remove_invoke().
Referenced by ED_operatortypes_object().
|
static |
Definition at line 113 of file object_shader_fx.c.
References BKE_object_free_derived_caches(), BKE_shaderfx_free(), BLI_findindex(), BLI_remlink(), DEG_relations_tag_update(), and Object::shader_fx.
Referenced by ED_object_shaderfx_clear(), and ED_object_shaderfx_remove().
|
static |
Definition at line 306 of file object_shader_fx.c.
References C, CTX_data_main(), CTX_data_scene(), ED_object_active_context(), ED_object_shaderfx_add(), NC_OBJECT, ND_SHADERFX, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), scene, type, and WM_event_add_notifier().
Referenced by OBJECT_OT_shaderfx_add().
|
static |
Definition at line 322 of file object_shader_fx.c.
References Freestyle::a, BKE_shaderfx_get_info(), C, ED_object_active_context(), eShaderFxTypeFlag_NoUserAdd, ShaderFxTypeInfo::flags, EnumPropertyItem::identifier, NULL, RNA_enum_item_add(), RNA_enum_item_end(), rna_enum_object_shaderfx_type_items, and EnumPropertyItem::value.
Referenced by OBJECT_OT_shaderfx_add().
|
static |
Definition at line 673 of file object_shader_fx.c.
References BKE_shaderfx_copydata(), BKE_shaderfx_new(), BKE_shaderfx_unique_name(), BLI_insertlinkafter(), BLI_strncpy(), C, DEG_id_tag_update(), ED_object_active_context(), edit_shaderfx_property_get(), Object::id, ID_RECALC_GEOMETRY, ShaderFxData::name, NC_OBJECT, ND_SHADERFX, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::shader_fx, ShaderFxData::type, and WM_main_add_notifier().
Referenced by OBJECT_OT_shaderfx_copy(), and shaderfx_copy_invoke().
|
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().
|
static |
Definition at line 581 of file object_shader_fx.c.
References C, DEG_id_tag_update(), ED_object_active_context(), ED_object_shaderfx_move_down(), edit_shaderfx_property_get(), Object::id, ID_RECALC_GEOMETRY, NC_OBJECT, ND_SHADERFX, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, and WM_event_add_notifier().
Referenced by OBJECT_OT_shaderfx_move_down(), and shaderfx_move_down_invoke().
|
static |
Definition at line 596 of file object_shader_fx.c.
References C, edit_shaderfx_invoke_properties(), and shaderfx_move_down_exec().
Referenced by OBJECT_OT_shaderfx_move_down().
|
static |
Definition at line 626 of file object_shader_fx.c.
References C, ED_object_active_context(), ED_object_shaderfx_move_to_index(), edit_shaderfx_property_get(), OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, and RNA_int_get().
Referenced by OBJECT_OT_shaderfx_move_to_index(), and shaderfx_move_to_index_invoke().
|
static |
Definition at line 639 of file object_shader_fx.c.
References C, edit_shaderfx_invoke_properties(), and shaderfx_move_to_index_exec().
Referenced by OBJECT_OT_shaderfx_move_to_index().
|
static |
Definition at line 536 of file object_shader_fx.c.
References C, DEG_id_tag_update(), ED_object_active_context(), ED_object_shaderfx_move_up(), edit_shaderfx_property_get(), Object::id, ID_RECALC_GEOMETRY, NC_OBJECT, ND_SHADERFX, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, and WM_event_add_notifier().
Referenced by OBJECT_OT_shaderfx_move_up(), and shaderfx_move_up_invoke().
|
static |
Definition at line 551 of file object_shader_fx.c.
References C, edit_shaderfx_invoke_properties(), and shaderfx_move_up_exec().
Referenced by OBJECT_OT_shaderfx_move_up().
|
static |
Definition at line 479 of file object_shader_fx.c.
References BKE_reportf(), C, CTX_data_main(), ED_object_active_context(), ED_object_shaderfx_remove(), edit_shaderfx_property_get(), MAX_NAME, ShaderFxData::name, NC_OBJECT, ND_SHADERFX, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RPT_INFO, and WM_event_add_notifier().
Referenced by OBJECT_OT_shaderfx_remove(), and shaderfx_remove_invoke().
|
static |
Definition at line 505 of file object_shader_fx.c.
References C, edit_shaderfx_invoke_properties(), and shaderfx_remove_exec().
Referenced by OBJECT_OT_shaderfx_remove().