|
Blender
V3.3
|
#include "BLI_listbase.h"#include "BLI_string.h"#include "MEM_guardedalloc.h"#include "BKE_context.h"#include "BKE_object.h"#include "BKE_screen.h"#include "BKE_shader_fx.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_screen_types.h"#include "DNA_shader_fx_types.h"#include "ED_object.h"#include "BLT_translation.h"#include "UI_interface.h"#include "UI_resources.h"#include "RNA_access.h"#include "RNA_prototypes.h"#include "WM_api.h"#include "WM_types.h"#include "FX_ui_common.h"Go to the source code of this file.
Functions | |
Panel Drag and Drop, Expansion Saving | |
| static void | shaderfx_reorder (bContext *C, Panel *panel, int new_index) |
| static short | get_shaderfx_expand_flag (const bContext *UNUSED(C), Panel *panel) |
| static void | set_shaderfx_expand_flag (const bContext *UNUSED(C), Panel *panel, short expand_flag) |
ShaderFx Registration Helpers | |
| static bool | shaderfx_ui_poll (const bContext *C, PanelType *UNUSED(pt)) |
| PanelType * | shaderfx_panel_register (ARegionType *region_type, ShaderFxType type, PanelDrawFn draw) |
| PanelType * | shaderfx_subpanel_register (ARegionType *region_type, const char *name, const char *label, PanelDrawFn draw_header, PanelDrawFn draw, PanelType *parent) |
ShaderFx Panel Layouts | |
| #define | ERROR_LIBDATA_MESSAGE TIP_("External library data") |
| void | shaderfx_panel_end (uiLayout *layout, PointerRNA *ptr) |
| PointerRNA * | shaderfx_panel_get_property_pointers (Panel *panel, PointerRNA *r_ob_ptr) |
| static void | gpencil_shaderfx_ops_extra_draw (bContext *C, uiLayout *layout, void *fx_v) |
| static void | shaderfx_panel_header (const bContext *UNUSED(C), Panel *panel) |
Definition at line 107 of file FX_ui_common.c.
Get the expand flag from the active effect to use for the panel.
Definition at line 61 of file FX_ui_common.c.
References PointerRNA::data, ShaderFxData::ui_expand_flag, and UI_panel_custom_data_get().
Referenced by shaderfx_panel_register().
Definition at line 109 of file FX_ui_common.c.
References BLI_listbase_count(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, C, CTX_IFACE_, ED_object_active_context(), Object::id, IFACE_, ShaderFxData::next, NULL, ShaderFxData::prev, ptr, RNA_int_set(), RNA_pointer_create(), Object::shader_fx, UI_block_flag_enable(), UI_BLOCK_IS_FLIP, uiItemFullO(), uiItemO(), uiItemS(), uiLayoutColumn(), uiLayoutGetBlock(), uiLayoutSetContextPointer(), uiLayoutSetEnabled(), uiLayoutSetOperatorContext(), uiLayoutSetUnitsX(), and WM_OP_INVOKE_DEFAULT.
Referenced by shaderfx_panel_header().
|
static |
Save the expand flag for the panel and sub-panels to the effect.
Definition at line 71 of file FX_ui_common.c.
References PointerRNA::data, ShaderFxData::ui_expand_flag, and UI_panel_custom_data_get().
Referenced by shaderfx_panel_register().
| void shaderfx_panel_end | ( | struct uiLayout * | layout, |
| PointerRNA * | ptr | ||
| ) |
Draw shaderfx error message.
Definition at line 84 of file FX_ui_common.c.
References PointerRNA::data, ShaderFxData::error, ptr, TIP_, uiItemL(), and uiLayoutRow().
Referenced by panel_draw().
| PointerRNA* shaderfx_panel_get_property_pointers | ( | struct Panel * | panel, |
| struct PointerRNA * | r_ob_ptr | ||
| ) |
Gets RNA pointers for the active object and the panel's shaderfx data.
Definition at line 93 of file FX_ui_common.c.
References BLI_assert, NULL, PointerRNA::owner_id, ptr, RNA_pointer_create(), RNA_struct_is_a(), PointerRNA::type, UI_panel_context_pointer_set(), and UI_panel_custom_data_get().
Referenced by blur_panel_draw(), panel_draw(), shaderfx_panel_header(), wave_header_draw(), and wave_panel_draw().
Definition at line 164 of file FX_ui_common.c.
References BKE_shaderfx_get_info(), PointerRNA::data, ERROR_LIBDATA_MESSAGE, eShaderFxTypeFlag_SupportsEditmode, ShaderFxTypeInfo::flags, gpencil_shaderfx_ops_extra_draw(), ID_IS_LINKED, ShaderFxTypeInfo::isDisabled, Panel::layout, NULL, PointerRNA::owner_id, ptr, RNA_struct_ui_icon(), shaderfx_panel_get_property_pointers(), Panel::sizex, PointerRNA::type, UI_block_lock_set(), UI_EMBOSS_NONE, UI_UNIT_X, uiItemL(), uiItemMenuF(), uiItemO(), uiItemR(), uiItemS(), uiLayoutGetBlock(), uiLayoutRow(), uiLayoutSetActive(), uiLayoutSetEmboss(), and uiLayoutSetRedAlert().
Referenced by shaderfx_panel_register().
| PanelType* shaderfx_panel_register | ( | ARegionType * | region_type, |
| ShaderFxType | type, | ||
| PanelDrawFn | draw | ||
| ) |
Create a panel in the context's region
Definition at line 223 of file FX_ui_common.c.
References BKE_shaderfxType_panel_id(), BKE_ST_MAXNAME, BLI_addtail(), BLI_strncpy(), BLT_I18NCONTEXT_DEFAULT_BPYRNA, PanelType::context, PanelType::draw, PanelType::draw_header, PanelType::flag, PanelType::get_list_data_expand_flag, get_shaderfx_expand_flag(), PanelType::idname, PanelType::label, MEM_callocN, PANEL_TYPE_HEADER_EXPAND, PANEL_TYPE_INSTANCED, ARegionType::paneltypes, PanelType::poll, PanelType::reorder, PanelType::set_list_data_expand_flag, set_shaderfx_expand_flag(), shaderfx_panel_header(), shaderfx_reorder(), shaderfx_ui_poll(), PanelType::translation_context, and type.
Referenced by panelRegister().
Move an effect to the index it's moved to after a drag and drop.
Definition at line 44 of file FX_ui_common.c.
References C, PointerRNA::data, ShaderFxData::name, NULL, ot, RNA_int_set(), RNA_string_set(), UI_panel_custom_data_get(), WM_OP_INVOKE_DEFAULT, WM_operator_name_call_ptr(), WM_operator_properties_create_ptr(), WM_operator_properties_free(), and WM_operatortype_find().
Referenced by shaderfx_panel_register().
| PanelType* shaderfx_subpanel_register | ( | struct ARegionType * | region_type, |
| const char * | name, | ||
| const char * | label, | ||
| PanelDrawFn | draw_header, | ||
| PanelDrawFn | draw, | ||
| struct PanelType * | parent | ||
| ) |
Add a child panel to the parent.
Definition at line 248 of file FX_ui_common.c.
References BKE_ST_MAXNAME, BLI_addtail(), BLI_assert, BLI_genericNodeN(), BLI_snprintf(), BLI_strncpy(), BLT_I18NCONTEXT_DEFAULT_BPYRNA, PanelType::children, PanelType::context, PanelType::draw, PanelType::draw_header, PanelType::flag, PanelType::idname, PanelType::label, label, MEM_callocN, NULL, PANEL_TYPE_DEFAULT_CLOSED, ARegionType::paneltypes, PanelType::parent, PanelType::parent_id, PanelType::poll, shaderfx_ui_poll(), and PanelType::translation_context.
Referenced by panelRegister().
Definition at line 216 of file FX_ui_common.c.
References C, ED_object_active_context(), NULL, OB_GPENCIL, and Object::type.
Referenced by shaderfx_panel_register(), and shaderfx_subpanel_register().