Cleanup: Remove unnecessary struct keyword from editors includes

This commit is contained in:
Hans Goudey
2023-08-04 22:15:25 -04:00
parent ffe4fbe832
commit 88de2f25ed
57 changed files with 2936 additions and 3658 deletions

View File

@@ -16,13 +16,14 @@ struct ColorManagedDisplaySettings;
struct ColorManagedViewSettings;
struct ImBuf;
struct bContext;
struct GPUShader;
typedef struct IMMDrawPixelsTexState {
struct GPUShader *shader;
struct IMMDrawPixelsTexState {
GPUShader *shader;
unsigned int pos;
unsigned int texco;
bool do_shader_unbind;
} IMMDrawPixelsTexState;
};
/* To be used before calling immDrawPixelsTex
* Default shader is GPU_SHADER_2D_IMAGE_COLOR
@@ -158,23 +159,23 @@ void immDrawPixelsTexTiled_scaling_clipping(IMMDrawPixelsTexState *state,
* For better performance clipping coordinates can be specified so parts of the
* image outside the view are skipped. */
void ED_draw_imbuf(struct ImBuf *ibuf,
void ED_draw_imbuf(ImBuf *ibuf,
float x,
float y,
bool use_filter,
const struct ColorManagedViewSettings *view_settings,
const struct ColorManagedDisplaySettings *display_settings,
const ColorManagedViewSettings *view_settings,
const ColorManagedDisplaySettings *display_settings,
float zoom_x,
float zoom_y);
/**
* Draw given image buffer on a screen using GLSL for display transform.
*/
void ED_draw_imbuf_clipping(struct ImBuf *ibuf,
void ED_draw_imbuf_clipping(ImBuf *ibuf,
float x,
float y,
bool use_filter,
const struct ColorManagedViewSettings *view_settings,
const struct ColorManagedDisplaySettings *display_settings,
const ColorManagedViewSettings *view_settings,
const ColorManagedDisplaySettings *display_settings,
float clip_min_x,
float clip_min_y,
float clip_max_x,
@@ -182,15 +183,10 @@ void ED_draw_imbuf_clipping(struct ImBuf *ibuf,
float zoom_x,
float zoom_y);
void ED_draw_imbuf_ctx(const struct bContext *C,
struct ImBuf *ibuf,
float x,
float y,
bool use_filter,
float zoom_x,
float zoom_y);
void ED_draw_imbuf_ctx_clipping(const struct bContext *C,
struct ImBuf *ibuf,
void ED_draw_imbuf_ctx(
const bContext *C, ImBuf *ibuf, float x, float y, bool use_filter, float zoom_x, float zoom_y);
void ED_draw_imbuf_ctx_clipping(const bContext *C,
ImBuf *ibuf,
float x,
float y,
bool use_filter,
@@ -201,9 +197,9 @@ void ED_draw_imbuf_ctx_clipping(const struct bContext *C,
float zoom_x,
float zoom_y);
int ED_draw_imbuf_method(const struct ImBuf *ibuf);
int ED_draw_imbuf_method(const ImBuf *ibuf);
/**
* Don't move to `GPU_immediate_util.h` because this uses user-prefs and isn't very low level.
*/
void immDrawBorderCorners(unsigned int pos, const struct rcti *border, float zoomx, float zoomy);
void immDrawBorderCorners(unsigned int pos, const rcti *border, float zoomx, float zoomy);

View File

@@ -21,11 +21,13 @@ struct ARegionType;
struct FModifier;
struct Main;
struct NlaStrip;
struct NlaTrack;
struct PanelType;
struct ReportList;
struct ScrArea;
struct SpaceLink;
struct View2D;
struct ViewLayer;
struct rctf;
struct bContext;
struct wmKeyConfig;
@@ -56,7 +58,7 @@ struct PropertyRNA;
* This struct defines a structure used for animation-specific
* 'context' information.
*/
typedef struct bAnimContext {
struct bAnimContext {
/** data to be filtered for use in animation editor */
void *data;
/** type of data eAnimCont_Types */
@@ -70,35 +72,34 @@ typedef struct bAnimContext {
short regiontype;
/** editor host */
struct ScrArea *area;
ScrArea *area;
/** editor data */
struct SpaceLink *sl;
SpaceLink *sl;
/** region within editor */
struct ARegion *region;
ARegion *region;
/** dopesheet data for editor (or which is being used) */
struct bDopeSheet *ads;
bDopeSheet *ads;
/** Current Main */
struct Main *bmain;
Main *bmain;
/** active scene */
struct Scene *scene;
Scene *scene;
/** active scene layer */
struct ViewLayer *view_layer;
ViewLayer *view_layer;
/** active dependency graph */
struct Depsgraph *depsgraph;
Depsgraph *depsgraph;
/** active object */
struct Object *obact;
Object *obact;
/** active set of markers */
ListBase *markers;
/** pointer to current reports list */
struct ReportList *reports;
} bAnimContext;
ReportList *reports;
};
/* Main Data container types */
typedef enum eAnimCont_Types {
enum eAnimCont_Types {
ANIMCONT_NONE = 0, /* invalid or no data */
ANIMCONT_ACTION = 1, /* action (#bAction) */
ANIMCONT_SHAPEKEY = 2, /* shape-key (#Key) */
@@ -110,7 +111,7 @@ typedef enum eAnimCont_Types {
ANIMCONT_CHANNEL = 8, /* animation channel (#bAnimListElem) */
ANIMCONT_MASK = 9, /* mask dope-sheet */
ANIMCONT_TIMELINE = 10, /* "timeline" editor (#bDopeSheet) */
} eAnimCont_Types;
};
/** \} */
@@ -122,8 +123,8 @@ typedef enum eAnimCont_Types {
* This struct defines a structure used for quick and uniform access for
* channels of animation data.
*/
typedef struct bAnimListElem {
struct bAnimListElem *next, *prev;
struct bAnimListElem {
bAnimListElem *next, *prev;
/** source data this elem represents */
void *data;
@@ -156,9 +157,9 @@ typedef struct bAnimListElem {
* it's impossible to go the other way (i.e. one action may be used in multiple places).
*/
/** ID block that channel is attached to */
struct ID *id;
ID *id;
/** source of the animation data attached to ID block (for convenience) */
struct AnimData *adt;
AnimData *adt;
/**
* For list element which corresponds to a f-curve, this is an ID which
@@ -171,13 +172,13 @@ typedef struct bAnimListElem {
* NOTE: this is different from id above. The id above will be set to
* an object if the f-curve is coming from action associated with that object.
*/
struct ID *fcurve_owner_id;
ID *fcurve_owner_id;
/**
* for per-element F-Curves
* (e.g. NLA Control Curves), the element that this represents (e.g. NlaStrip) */
void *owner;
} bAnimListElem;
};
/**
* Some types for easier type-testing
@@ -185,7 +186,7 @@ typedef struct bAnimListElem {
* \note need to keep the order of these synchronized with the channels define code
* which is used for drawing and handling channel lists for.
*/
typedef enum eAnim_ChannelType {
enum eAnim_ChannelType {
ANIMTYPE_NONE = 0,
ANIMTYPE_ANIMDATA,
ANIMTYPE_SPECIALDATA__UNUSED,
@@ -243,10 +244,10 @@ typedef enum eAnim_ChannelType {
/* always as last item, the total number of channel types... */
ANIMTYPE_NUM_TYPES,
} eAnim_ChannelType;
};
/* types of keyframe data in bAnimListElem */
typedef enum eAnim_KeyType {
enum eAnim_KeyType {
ALE_NONE = 0, /* no keyframe data */
ALE_FCURVE, /* F-Curve */
ALE_GPFRAME, /* Grease Pencil Frames (Legacy) */
@@ -259,18 +260,18 @@ typedef enum eAnim_KeyType {
ALE_OB, /* Object summary */
ALE_ACT, /* Action summary */
ALE_GROUP, /* Action Group summary */
} eAnim_KeyType;
};
/**
* Flags for specifying the types of updates (i.e. recalculation/refreshing) that
* needs to be performed to the data contained in a channel following editing.
* For use with ANIM_animdata_update()
*/
typedef enum eAnim_Update_Flags {
enum eAnim_Update_Flags {
ANIM_UPDATE_DEPS = (1 << 0), /* referenced data and dependencies get refreshed */
ANIM_UPDATE_ORDER = (1 << 1), /* keyframes need to be sorted */
ANIM_UPDATE_HANDLES = (1 << 2), /* recalculate handles */
} eAnim_Update_Flags;
};
/* used for most tools which change keyframes (flushed by ANIM_animdata_update) */
#define ANIM_UPDATE_DEFAULT (ANIM_UPDATE_DEPS | ANIM_UPDATE_ORDER | ANIM_UPDATE_HANDLES)
@@ -479,7 +480,7 @@ size_t ANIM_animdata_filter(bAnimContext *ac,
* - Clears data and sets the information from Blender Context which is useful
* \return whether the operation was successful.
*/
bool ANIM_animdata_get_context(const struct bContext *C, bAnimContext *ac);
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac);
/**
* Obtain current anim-data context,
@@ -513,17 +514,17 @@ bool ANIM_animdata_can_have_greasepencil(const eAnimCont_Types type);
* \{ */
/** Role or level of anim-channel in the hierarchy. */
typedef enum eAnimChannel_Role {
enum eAnimChannel_Role {
/** datablock expander - a "composite" channel type */
ACHANNEL_ROLE_EXPANDER = -1,
/** special purposes - not generally for hierarchy processing */
/* ACHANNEL_ROLE_SPECIAL = 0, */ /* UNUSED */
/** data channel - a channel representing one of the actual building blocks of channels */
ACHANNEL_ROLE_CHANNEL = 1,
} eAnimChannel_Role;
};
/* flag-setting behavior */
typedef enum eAnimChannels_SetFlag {
enum eAnimChannels_SetFlag {
/** turn off */
ACHANNEL_SETFLAG_CLEAR = 0,
/** turn on */
@@ -534,10 +535,10 @@ typedef enum eAnimChannels_SetFlag {
ACHANNEL_SETFLAG_TOGGLE = 3,
/** turn off, keep active flag **/
ACHANNEL_SETFLAG_EXTEND_RANGE = 4,
} eAnimChannels_SetFlag;
};
/* types of settings for AnimChannels */
typedef enum eAnimChannel_Settings {
enum eAnimChannel_Settings {
ACHANNEL_SETTING_SELECT = 0,
/** WARNING: for drawing UI's, need to check if this is off (maybe inverse this later). */
ACHANNEL_SETTING_PROTECT = 1,
@@ -552,10 +553,10 @@ typedef enum eAnimChannel_Settings {
ACHANNEL_SETTING_MOD_OFF = 7,
/** channel is pinned and always visible */
ACHANNEL_SETTING_ALWAYS_VISIBLE = 8,
} eAnimChannel_Settings;
};
/** Drawing, mouse handling, and flag setting behavior. */
typedef struct bAnimChannelType {
struct bAnimChannelType {
/* -- Type data -- */
/* name of the channel type, for debugging */
const char *channel_type_name;
@@ -575,7 +576,7 @@ typedef struct bAnimChannelType {
/** Get name (for channel lists). */
void (*name)(bAnimListElem *ale, char *name);
/** Get RNA property+pointer for editing the name. */
bool (*name_prop)(bAnimListElem *ale, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop);
bool (*name_prop)(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop);
/** Get icon (for channel lists). */
int (*icon)(bAnimListElem *ale);
@@ -590,21 +591,21 @@ typedef struct bAnimChannelType {
* - assume that setting has been checked to be valid for current context.
*/
void *(*setting_ptr)(bAnimListElem *ale, eAnimChannel_Settings setting, short *r_type);
} bAnimChannelType;
};
/** \} */
/* -------------------------------------------------------------------- */
/** \name Channel dimensions API
* \{ */
float ANIM_UI_get_keyframe_scale_factor(void);
float ANIM_UI_get_channel_height(void);
float ANIM_UI_get_channel_skip(void);
float ANIM_UI_get_keyframe_scale_factor();
float ANIM_UI_get_channel_height();
float ANIM_UI_get_channel_skip();
float ANIM_UI_get_first_channel_top(View2D *v2d);
float ANIM_UI_get_channel_step(void);
float ANIM_UI_get_channel_step();
float ANIM_UI_get_channels_total_height(View2D *v2d, int item_count);
float ANIM_UI_get_channel_name_width(void);
float ANIM_UI_get_channel_button_width(void);
float ANIM_UI_get_channel_name_width();
float ANIM_UI_get_channel_button_width();
/** \} */
@@ -635,10 +636,10 @@ void ANIM_channel_draw(
/**
* Draw UI widgets the given channel.
*/
void ANIM_channel_draw_widgets(const struct bContext *C,
void ANIM_channel_draw_widgets(const bContext *C,
bAnimContext *ac,
bAnimListElem *ale,
struct uiBlock *block,
uiBlock *block,
rctf *rect,
size_t channel_index);
@@ -680,7 +681,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac,
eAnimChannel_Settings setting,
eAnimChannels_SetFlag mode);
void ANIM_frame_channel_y_extents(struct bContext *C, bAnimContext *ac);
void ANIM_frame_channel_y_extents(bContext *C, bAnimContext *ac);
/**
* Set selection state of all animation channels in the context.
@@ -711,7 +712,7 @@ bool ANIM_is_active_channel(bAnimListElem *ale);
* Delete the F-Curve from the given AnimData block (if possible),
* as appropriate according to animation context.
*/
void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, struct AnimData *adt, struct FCurve *fcu);
void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *fcu);
/**
* Unlink the action from animdata if it's empty.
@@ -719,7 +720,7 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, struct AnimData *adt, st
* If the action has no F-Curves, unlink it from AnimData if it did not
* come from a NLA Strip being tweaked.
*/
bool ANIM_remove_empty_action_from_animdata(struct AnimData *adt);
bool ANIM_remove_empty_action_from_animdata(AnimData *adt);
/* ************************************************ */
/* DRAWING API */
@@ -746,7 +747,7 @@ typedef enum eAnimEditDraw_CurrentFrame {
/**
* General call for drawing current frame indicator in animation editor.
*/
void ANIM_draw_cfra(const struct bContext *C, struct View2D *v2d, short flag);
void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag);
/** \} */
@@ -759,7 +760,7 @@ void ANIM_draw_cfra(const struct bContext *C, struct View2D *v2d, short flag);
/**
* Draw preview range 'curtains' for highlighting where the animation data is.
*/
void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d, int end_frame_width);
void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width);
/** \} */
@@ -774,14 +775,14 @@ void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d, int en
*
* TODO: Should we still show these when preview range is enabled?
*/
void ANIM_draw_framerange(struct Scene *scene, struct View2D *v2d);
void ANIM_draw_framerange(Scene *scene, View2D *v2d);
/**
* Draw manually set intended playback frame range guides for the action in the background.
* Allows specifying a subset of the Y range of the view.
*/
void ANIM_draw_action_framerange(
struct AnimData *adt, struct bAction *action, struct View2D *v2d, float ymin, float ymax);
AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax);
/* ************************************************* */
/* F-MODIFIER TOOLS */
@@ -792,30 +793,30 @@ void ANIM_draw_action_framerange(
/** \name UI Panel Drawing
* \{ */
bool ANIM_nla_context_track_ptr(const struct bContext *C, struct PointerRNA *r_ptr);
bool ANIM_nla_context_strip_ptr(const struct bContext *C, struct PointerRNA *r_ptr);
bool ANIM_nla_context_track_ptr(const bContext *C, PointerRNA *r_ptr);
bool ANIM_nla_context_strip_ptr(const bContext *C, PointerRNA *r_ptr);
struct NlaTrack *ANIM_nla_context_track(const struct bContext *C);
struct NlaStrip *ANIM_nla_context_strip(const struct bContext *C);
struct FCurve *ANIM_graph_context_fcurve(const struct bContext *C);
NlaTrack *ANIM_nla_context_track(const bContext *C);
NlaStrip *ANIM_nla_context_strip(const bContext *C);
FCurve *ANIM_graph_context_fcurve(const bContext *C);
/** Needed for abstraction between the graph editor and the NLA editor. */
typedef bool (*PanelTypePollFn)(const struct bContext *C, struct PanelType *pt);
using PanelTypePollFn = bool (*)(const bContext *C, PanelType *pt);
/** Avoid including `UI_interface.hh` here. */
typedef void (*uiListPanelIDFromDataFunc)(void *data_link, char *r_idname);
using uiListPanelIDFromDataFunc = void (*)(void *data_link, char *r_idname);
/**
* Checks if the panels match the active strip / curve, rebuilds them if they don't.
*/
void ANIM_fmodifier_panels(const struct bContext *C,
struct ID *owner_id,
struct ListBase *fmodifiers,
void ANIM_fmodifier_panels(const bContext *C,
ID *owner_id,
ListBase *fmodifiers,
uiListPanelIDFromDataFunc panel_id_fn);
void ANIM_modifier_panels_register_graph_and_NLA(struct ARegionType *region_type,
void ANIM_modifier_panels_register_graph_and_NLA(ARegionType *region_type,
const char *modifier_panel_prefix,
PanelTypePollFn poll_function);
void ANIM_modifier_panels_register_graph_only(struct ARegionType *region_type,
void ANIM_modifier_panels_register_graph_only(ARegionType *region_type,
const char *modifier_panel_prefix,
PanelTypePollFn poll_function);
@@ -828,7 +829,7 @@ void ANIM_modifier_panels_register_graph_only(struct ARegionType *region_type,
/**
* Free the copy/paste buffer.
*/
void ANIM_fmodifiers_copybuf_free(void);
void ANIM_fmodifiers_copybuf_free();
/**
* Copy the given F-Modifiers to the buffer, returning whether anything was copied or not
@@ -841,7 +842,7 @@ bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active);
* 'Paste' the F-Modifier(s) from the buffer to the specified list
* \param replace: Free all the existing modifiers to leave only the pasted ones.
*/
bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace, struct FCurve *curve);
bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace, FCurve *curve);
/* ************************************************* */
/* ASSORTED TOOLS */
@@ -864,7 +865,7 @@ bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace, struct FC
* \warning name buffer we're writing to cannot exceed 256 chars
* (check anim_channels_defines.cc for details).
*/
int getname_anim_fcurve(char *name, struct ID *id, struct FCurve *fcu);
int getname_anim_fcurve(char *name, ID *id, FCurve *fcu);
/**
* Automatically determine a color for the nth F-Curve.
@@ -884,7 +885,7 @@ void getcolor_fcurve_rainbow(int cur, int tot, float out[3]);
* Get color to use for NLA Action channel's background.
* \note color returned includes fine-tuned alpha!
*/
void nla_action_get_color(struct AnimData *adt, struct bAction *act, float color[4]);
void nla_action_get_color(AnimData *adt, bAction *act, float color[4]);
/** \} */
@@ -899,17 +900,14 @@ void nla_action_get_color(struct AnimData *adt, struct bAction *act, float color
*
* TODO: do not supply return this if the animdata tells us that there is no mapping to perform.
*/
struct AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale);
AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale);
/**
* Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve
* \param restore: Whether to map points back to non-mapped time.
* \param only_keys: Whether to only adjust the location of the center point of beztriples.
*/
void ANIM_nla_mapping_apply_fcurve(struct AnimData *adt,
struct FCurve *fcu,
bool restore,
bool only_keys);
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys);
/* ..... */
@@ -928,7 +926,7 @@ void ED_nla_postop_refresh(bAnimContext *ac);
/* `anim_draw.cc` */
/** Flags for conversion mapping. */
typedef enum eAnimUnitConv_Flags {
enum eAnimUnitConv_Flags {
/** Restore to original internal values. */
ANIM_UNITCONV_RESTORE = (1 << 0),
/** Ignore handles (i.e. only touch main keyframes). */
@@ -945,7 +943,7 @@ typedef enum eAnimUnitConv_Flags {
* prevents curves from jumping all over the place when tweaking them.
*/
ANIM_UNITCONV_NORMALIZE_FREEZE = (1 << 6),
} eAnimUnitConv_Flags;
};
/**
* Get flags used for normalization in ANIM_unit_mapping_get_factor.
@@ -954,8 +952,7 @@ short ANIM_get_normalization_flags(bAnimContext *ac);
/**
* Get unit conversion factor for given ID + F-Curve.
*/
float ANIM_unit_mapping_get_factor(
struct Scene *scene, struct ID *id, struct FCurve *fcu, short flag, float *r_offset);
float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset);
/** \} */
@@ -1020,20 +1017,20 @@ float ANIM_unit_mapping_get_factor(
/**
* Tags the given ID block for refreshes (if applicable) due to Animation Editor editing.
*/
void ANIM_id_update(struct Main *bmain, struct ID *id);
void ANIM_id_update(Main *bmain, ID *id);
/**
* Tags the given anim list element for refreshes (if applicable) due to Animation Editor editing.
*/
void ANIM_list_elem_update(struct Main *bmain, struct Scene *scene, bAnimListElem *ale);
void ANIM_list_elem_update(Main *bmain, Scene *scene, bAnimListElem *ale);
/* data -> channels syncing */
/**
* Main call to be exported to animation editors.
*/
void ANIM_sync_animchannels_to_data(const struct bContext *C);
void ANIM_sync_animchannels_to_data(const bContext *C);
void ANIM_center_frame(struct bContext *C, int smooth_viewtx);
void ANIM_center_frame(bContext *C, int smooth_viewtx);
/** \} */
@@ -1042,19 +1039,19 @@ void ANIM_center_frame(struct bContext *C, int smooth_viewtx);
* \{ */
/* generic animation channels */
void ED_operatortypes_animchannels(void);
void ED_keymap_animchannels(struct wmKeyConfig *keyconf);
void ED_operatortypes_animchannels();
void ED_keymap_animchannels(wmKeyConfig *keyconf);
/* generic time editing */
void ED_operatortypes_anim(void);
void ED_keymap_anim(struct wmKeyConfig *keyconf);
void ED_operatortypes_anim();
void ED_keymap_anim(wmKeyConfig *keyconf);
/* space_graph */
void ED_operatormacros_graph(void);
void ED_operatormacros_graph();
/* space_action */
void ED_operatormacros_action(void);
void ED_operatormacros_action();
/* space_nla */
void ED_operatormacros_nla(void);
void ED_operatormacros_nla();
/** \} */
@@ -1068,25 +1065,20 @@ void ED_operatormacros_nla(void);
* Action Editor - Action Management.
* Helper function to find the active AnimData block from the Action Editor context.
*/
struct AnimData *ED_actedit_animdata_from_context(const struct bContext *C,
struct ID **r_adt_id_owner);
void ED_animedit_unlink_action(struct bContext *C,
struct ID *id,
struct AnimData *adt,
struct bAction *act,
struct ReportList *reports,
bool force_delete);
AnimData *ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owner);
void ED_animedit_unlink_action(
bContext *C, ID *id, AnimData *adt, bAction *act, ReportList *reports, bool force_delete);
/**
* Set up UI configuration for Drivers Editor
* (drivers editor window) and RNA (mode switching).
* \note Currently called from window-manager.
*/
void ED_drivers_editor_init(struct bContext *C, struct ScrArea *area);
void ED_drivers_editor_init(bContext *C, ScrArea *area);
/* ************************************************ */
typedef enum eAnimvizCalcRange {
enum eAnimvizCalcRange {
/** Update motion paths at the current frame only. */
ANIMVIZ_CALC_RANGE_CURRENT_FRAME,
@@ -1095,16 +1087,16 @@ typedef enum eAnimvizCalcRange {
/** Update an entire range of the motion paths. */
ANIMVIZ_CALC_RANGE_FULL,
} eAnimvizCalcRange;
};
struct Depsgraph *animviz_depsgraph_build(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
struct ListBase *targets);
Depsgraph *animviz_depsgraph_build(Main *bmain,
Scene *scene,
ViewLayer *view_layer,
ListBase *targets);
void animviz_calc_motionpaths(struct Depsgraph *depsgraph,
struct Main *bmain,
struct Scene *scene,
void animviz_calc_motionpaths(Depsgraph *depsgraph,
Main *bmain,
Scene *scene,
ListBase *targets,
eAnimvizCalcRange range,
bool restore);
@@ -1116,12 +1108,12 @@ void animviz_calc_motionpaths(struct Depsgraph *depsgraph,
* \param ob: Object to compute range for (must be provided)
* \param scene: Used when scene range is chosen.
*/
void animviz_motionpath_compute_range(struct Object *ob, struct Scene *scene);
void animviz_motionpath_compute_range(Object *ob, Scene *scene);
/**
* Get list of motion paths to be baked for the given object.
* - assumes the given list is ready to be used.
*/
void animviz_get_object_motionpaths(struct Object *ob, ListBase *targets);
void animviz_get_object_motionpaths(Object *ob, ListBase *targets);
/** \} */

View File

@@ -64,17 +64,15 @@ struct wmOperator;
*
* \note should be used everywhere, now it allocates bones still locally in functions.
*/
struct EditBone *ED_armature_ebone_add(struct bArmature *arm, const char *name);
struct EditBone *ED_armature_ebone_add_primitive(struct Object *obedit_arm,
float length,
bool view_aligned);
EditBone *ED_armature_ebone_add(bArmature *arm, const char *name);
EditBone *ED_armature_ebone_add_primitive(Object *obedit_arm, float length, bool view_aligned);
/* `armature_edit.cc` */
/**
* Adjust bone roll to align Z axis with vector `align_axis` is in local space and is normalized.
*/
float ED_armature_ebone_roll_to_vector(const struct EditBone *bone,
float ED_armature_ebone_roll_to_vector(const EditBone *bone,
const float align_axis[3],
bool axis_only);
/**
@@ -83,12 +81,12 @@ float ED_armature_ebone_roll_to_vector(const struct EditBone *bone,
* \note Exported for use in `editors/object/`.
*/
void ED_armature_origin_set(
struct Main *bmain, struct Object *ob, const float cursor[3], int centermode, int around);
Main *bmain, Object *ob, const float cursor[3], int centermode, int around);
/**
* See #BKE_armature_transform for object-mode transform.
*/
void ED_armature_edit_transform(struct bArmature *arm, const float mat[4][4], bool do_props);
void ED_armature_transform(struct bArmature *arm, const float mat[4][4], bool do_props);
void ED_armature_edit_transform(bArmature *arm, const float mat[4][4], bool do_props);
void ED_armature_transform(bArmature *arm, const float mat[4][4], bool do_props);
/* `armature_naming.cc` */
@@ -96,15 +94,15 @@ void ED_armature_transform(struct bArmature *arm, const float mat[4][4], bool do
* Ensure the bone name is unique.
* If bone is already in list, pass it as argument to ignore it.
*/
void ED_armature_ebone_unique_name(struct ListBase *ebones, char *name, struct EditBone *bone);
void ED_armature_ebone_unique_name(ListBase *ebones, char *name, EditBone *bone);
/**
* Bone Rename (called by UI for renaming a bone).
* Seems messy, but that's what you get with not using pointers but channel names :).
* \warning make sure the original bone was not renamed yet!
*/
void ED_armature_bone_rename(struct Main *bmain,
struct bArmature *arm,
void ED_armature_bone_rename(Main *bmain,
bArmature *arm,
const char *oldnamep,
const char *newnamep);
/**
@@ -117,64 +115,59 @@ void ED_armature_bone_rename(struct Main *bmain,
* \param bones_names: List of bone conflict elements (#LinkData pointing to names).
* \param do_strip_numbers: if set, try to get rid of dot-numbers at end of bone names.
*/
void ED_armature_bones_flip_names(struct Main *bmain,
struct bArmature *arm,
struct ListBase *bones_names,
void ED_armature_bones_flip_names(Main *bmain,
bArmature *arm,
ListBase *bones_names,
bool do_strip_numbers);
/* `armature_ops.cc` */
void ED_operatortypes_armature(void);
void ED_operatormacros_armature(void);
void ED_keymap_armature(struct wmKeyConfig *keyconf);
void ED_keymap_armature(wmKeyConfig *keyconf);
/* `armature_relations.cc` */
/**
* Join armature exec is exported for use in object->join objects operator.
*/
int ED_armature_join_objects_exec(struct bContext *C, struct wmOperator *op);
int ED_armature_join_objects_exec(bContext *C, wmOperator *op);
/* `armature_select.cc` */
struct Base *ED_armature_base_and_ebone_from_select_buffer(struct Base **bases,
uint bases_len,
unsigned int select_id,
struct EditBone **r_ebone);
struct Object *ED_armature_object_and_ebone_from_select_buffer(struct Object **objects,
uint objects_len,
unsigned int select_id,
struct EditBone **r_ebone);
struct Base *ED_armature_base_and_pchan_from_select_buffer(struct Base **bases,
uint bases_len,
unsigned int select_id,
struct bPoseChannel **r_pchan);
Base *ED_armature_base_and_ebone_from_select_buffer(Base **bases,
uint bases_len,
unsigned int select_id,
EditBone **r_ebone);
Object *ED_armature_object_and_ebone_from_select_buffer(Object **objects,
uint objects_len,
unsigned int select_id,
EditBone **r_ebone);
Base *ED_armature_base_and_pchan_from_select_buffer(Base **bases,
uint bases_len,
unsigned int select_id,
bPoseChannel **r_pchan);
/**
* For callers that don't need the pose channel.
*/
struct Base *ED_armature_base_and_bone_from_select_buffer(struct Base **bases,
uint bases_len,
unsigned int select_id,
struct Bone **r_bone);
bool ED_armature_edit_deselect_all(struct Object *obedit);
bool ED_armature_edit_deselect_all_visible(struct Object *obedit);
bool ED_armature_edit_deselect_all_multi_ex(struct Base **bases, uint bases_len);
bool ED_armature_edit_deselect_all_visible_multi_ex(struct Base **bases, uint bases_len);
bool ED_armature_edit_deselect_all_visible_multi(struct bContext *C);
Base *ED_armature_base_and_bone_from_select_buffer(Base **bases,
uint bases_len,
unsigned int select_id,
Bone **r_bone);
bool ED_armature_edit_deselect_all(Object *obedit);
bool ED_armature_edit_deselect_all_visible(Object *obedit);
bool ED_armature_edit_deselect_all_multi_ex(Base **bases, uint bases_len);
bool ED_armature_edit_deselect_all_visible_multi_ex(Base **bases, uint bases_len);
bool ED_armature_edit_deselect_all_visible_multi(bContext *C);
/**
* \return True when pick finds an element or the selection changed.
*/
bool ED_armature_edit_select_pick_bone(struct bContext *C,
struct Base *basact,
struct EditBone *ebone,
int selmask,
const struct SelectPick_Params *params);
bool ED_armature_edit_select_pick_bone(
bContext *C, Base *basact, EditBone *ebone, int selmask, const SelectPick_Params *params);
/**
* Bone selection picking for armature edit-mode in the view3d.
*/
bool ED_armature_edit_select_pick(struct bContext *C,
const int mval[2],
const struct SelectPick_Params *params);
bool ED_armature_edit_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params);
/**
* Perform a selection operation on elements which have been 'touched',
* use for lasso & border select but can be used elsewhere too.
@@ -187,46 +180,43 @@ bool ED_armature_edit_select_pick(struct bContext *C,
*
* \note Visibility checks must be done by the caller.
*/
bool ED_armature_edit_select_op_from_tagged(struct bArmature *arm, int sel_op);
bool ED_armature_edit_select_op_from_tagged(bArmature *arm, int sel_op);
/* `armature_skinning.cc` */
#define ARM_GROUPS_NAME 1
#define ARM_GROUPS_ENVELOPE 2
#define ARM_GROUPS_AUTO 3
void ED_object_vgroup_calc_from_armature(struct ReportList *reports,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
struct Object *par,
void ED_object_vgroup_calc_from_armature(ReportList *reports,
Depsgraph *depsgraph,
Scene *scene,
Object *ob,
Object *par,
int mode,
bool mirror);
/* editarmature_undo.cc */
/** Export for ED_undo_sys. */
void ED_armature_undosys_type(struct UndoType *ut);
void ED_armature_undosys_type(UndoType *ut);
/* `armature_utils.cc` */
/** Sync selection to parent for connected children. */
void ED_armature_edit_sync_selection(struct ListBase *edbo);
void ED_armature_edit_validate_active(struct bArmature *arm);
void ED_armature_edit_sync_selection(ListBase *edbo);
void ED_armature_edit_validate_active(bArmature *arm);
/**
* Update the layers_used variable after bones are moved between layer
* \note Used to be done in drawing code in 2.7, but that won't work with
* Copy-on-Write, as drawing uses evaluated copies.
*/
void ED_armature_edit_refresh_layer_used(struct bArmature *arm);
void ED_armature_edit_refresh_layer_used(bArmature *arm);
/**
* \param clear_connected: When false caller is responsible for keeping the flag in a valid state.
*/
void ED_armature_ebone_remove_ex(struct bArmature *arm,
struct EditBone *exBone,
bool clear_connected);
void ED_armature_ebone_remove(struct bArmature *arm, struct EditBone *exBone);
bool ED_armature_ebone_is_child_recursive(struct EditBone *ebone_parent,
struct EditBone *ebone_child);
void ED_armature_ebone_remove_ex(bArmature *arm, EditBone *exBone, bool clear_connected);
void ED_armature_ebone_remove(bArmature *arm, EditBone *exBone);
bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child);
/**
* Finds the first parent shared by \a ebone_child
*
@@ -234,99 +224,92 @@ bool ED_armature_ebone_is_child_recursive(struct EditBone *ebone_parent,
* \param ebone_child_tot: Size of the ebone_child array
* \return The shared parent or NULL.
*/
struct EditBone *ED_armature_ebone_find_shared_parent(struct EditBone *ebone_child[],
unsigned int ebone_child_tot);
void ED_armature_ebone_to_mat3(struct EditBone *ebone, float r_mat[3][3]);
void ED_armature_ebone_to_mat4(struct EditBone *ebone, float r_mat[4][4]);
void ED_armature_ebone_from_mat3(struct EditBone *ebone, const float mat[3][3]);
void ED_armature_ebone_from_mat4(struct EditBone *ebone, const float mat[4][4]);
EditBone *ED_armature_ebone_find_shared_parent(EditBone *ebone_child[],
unsigned int ebone_child_tot);
void ED_armature_ebone_to_mat3(EditBone *ebone, float r_mat[3][3]);
void ED_armature_ebone_to_mat4(EditBone *ebone, float r_mat[4][4]);
void ED_armature_ebone_from_mat3(EditBone *ebone, const float mat[3][3]);
void ED_armature_ebone_from_mat4(EditBone *ebone, const float mat[4][4]);
/**
* Return a pointer to the bone of the given name
*/
struct EditBone *ED_armature_ebone_find_name(const struct ListBase *edbo, const char *name);
EditBone *ED_armature_ebone_find_name(const ListBase *edbo, const char *name);
/**
* \see #BKE_pose_channel_get_mirrored (pose-mode, matching function)
*/
struct EditBone *ED_armature_ebone_get_mirrored(const struct ListBase *edbo, struct EditBone *ebo);
void ED_armature_ebone_transform_mirror_update(struct bArmature *arm,
struct EditBone *ebo,
bool check_select);
EditBone *ED_armature_ebone_get_mirrored(const ListBase *edbo, EditBone *ebo);
void ED_armature_ebone_transform_mirror_update(bArmature *arm, EditBone *ebo, bool check_select);
/**
* If edit-bone (partial) selected, copy data.
* context; edit-mode armature, with mirror editing enabled.
*/
void ED_armature_edit_transform_mirror_update(struct Object *obedit);
void ED_armature_edit_transform_mirror_update(Object *obedit);
/** Put edit-mode back in Object. */
void ED_armature_from_edit(struct Main *bmain, struct bArmature *arm);
void ED_armature_from_edit(Main *bmain, bArmature *arm);
/** Put armature in edit-mode. */
void ED_armature_to_edit(struct bArmature *arm);
void ED_armature_edit_free(struct bArmature *arm);
void ED_armature_ebone_listbase_temp_clear(struct ListBase *lb);
void ED_armature_to_edit(bArmature *arm);
void ED_armature_edit_free(bArmature *arm);
void ED_armature_ebone_listbase_temp_clear(ListBase *lb);
/**
* Free's bones and their properties.
*/
void ED_armature_ebone_listbase_free(struct ListBase *lb, bool do_id_user);
void ED_armature_ebone_listbase_copy(struct ListBase *lb_dst,
struct ListBase *lb_src,
bool do_id_user);
void ED_armature_ebone_listbase_free(ListBase *lb, bool do_id_user);
void ED_armature_ebone_listbase_copy(ListBase *lb_dst, ListBase *lb_src, bool do_id_user);
int ED_armature_ebone_selectflag_get(const struct EditBone *ebone);
void ED_armature_ebone_selectflag_set(struct EditBone *ebone, int flag);
void ED_armature_ebone_select_set(struct EditBone *ebone, bool select);
void ED_armature_ebone_selectflag_enable(struct EditBone *ebone, int flag);
void ED_armature_ebone_selectflag_disable(struct EditBone *ebone, int flag);
int ED_armature_ebone_selectflag_get(const EditBone *ebone);
void ED_armature_ebone_selectflag_set(EditBone *ebone, int flag);
void ED_armature_ebone_select_set(EditBone *ebone, bool select);
void ED_armature_ebone_selectflag_enable(EditBone *ebone, int flag);
void ED_armature_ebone_selectflag_disable(EditBone *ebone, int flag);
/* `pose_edit.cc` */
struct Object *ED_pose_object_from_context(struct bContext *C);
bool ED_object_posemode_exit_ex(struct Main *bmain, struct Object *ob);
bool ED_object_posemode_exit(struct bContext *C, struct Object *ob);
Object *ED_pose_object_from_context(bContext *C);
bool ED_object_posemode_exit_ex(Main *bmain, Object *ob);
bool ED_object_posemode_exit(bContext *C, Object *ob);
/** This function is used to process the necessary updates for. */
bool ED_object_posemode_enter_ex(struct Main *bmain, struct Object *ob);
bool ED_object_posemode_enter(struct bContext *C, struct Object *ob);
bool ED_object_posemode_enter_ex(Main *bmain, Object *ob);
bool ED_object_posemode_enter(bContext *C, Object *ob);
/** Corresponds to #eAnimvizCalcRange. */
typedef enum ePosePathCalcRange {
enum ePosePathCalcRange {
POSE_PATH_CALC_RANGE_CURRENT_FRAME,
POSE_PATH_CALC_RANGE_CHANGED,
POSE_PATH_CALC_RANGE_FULL,
} ePosePathCalcRange;
};
/**
* For the object with pose/action: update paths for those that have got them
* This should selectively update paths that exist...
*
* To be called from various tools that do incremental updates.
*/
void ED_pose_recalculate_paths(struct bContext *C,
struct Scene *scene,
struct Object *ob,
ePosePathCalcRange range);
void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob, ePosePathCalcRange range);
/* `pose_select.cc` */
/**
* \return True when pick finds an element or the selection changed.
*/
bool ED_armature_pose_select_pick_bone(const struct Scene *scene,
struct ViewLayer *view_layer,
struct View3D *v3d,
struct Object *ob,
struct Bone *bone,
const struct SelectPick_Params *params);
bool ED_armature_pose_select_pick_bone(const Scene *scene,
ViewLayer *view_layer,
View3D *v3d,
Object *ob,
Bone *bone,
const SelectPick_Params *params);
/**
* Called for mode-less pose selection.
* assumes the active object is still on old situation.
*
* \return True when pick finds an element or the selection changed.
*/
bool ED_armature_pose_select_pick_with_buffer(const struct Scene *scene,
struct ViewLayer *view_layer,
struct View3D *v3d,
struct Base *base,
const struct GPUSelectResult *buffer,
bool ED_armature_pose_select_pick_with_buffer(const Scene *scene,
ViewLayer *view_layer,
View3D *v3d,
Base *base,
const GPUSelectResult *buffer,
short hits,
const struct SelectPick_Params *params,
const SelectPick_Params *params,
bool do_nearest);
/**
* While in weight-paint mode, a single pose may be active as well.
@@ -336,36 +319,33 @@ bool ED_armature_pose_select_pick_with_buffer(const struct Scene *scene,
* It can't be set to the active object because we need
* to keep this set to the weight paint object.
*/
void ED_armature_pose_select_in_wpaint_mode(const struct Scene *scene,
struct ViewLayer *view_layer,
struct Base *base_select);
bool ED_pose_deselect_all_multi_ex(struct Base **bases,
void ED_armature_pose_select_in_wpaint_mode(const Scene *scene,
ViewLayer *view_layer,
Base *base_select);
bool ED_pose_deselect_all_multi_ex(Base **bases,
uint bases_len,
int select_mode,
bool ignore_visibility);
bool ED_pose_deselect_all_multi(struct bContext *C, int select_mode, bool ignore_visibility);
bool ED_pose_deselect_all_multi(bContext *C, int select_mode, bool ignore_visibility);
/**
* 'select_mode' is usual SEL_SELECT/SEL_DESELECT/SEL_TOGGLE/SEL_INVERT.
* When true, 'ignore_visibility' makes this func also affect invisible bones
* (hidden or on hidden layers).
*/
bool ED_pose_deselect_all(struct Object *ob, int select_mode, bool ignore_visibility);
void ED_pose_bone_select_tag_update(struct Object *ob);
bool ED_pose_deselect_all(Object *ob, int select_mode, bool ignore_visibility);
void ED_pose_bone_select_tag_update(Object *ob);
/**
* Utility method for changing the selection status of a bone.
* change_active determines whether to change the active bone of the armature when selecting pose
* channels. It is false during range selection otherwise true.
*/
void ED_pose_bone_select(struct Object *ob,
struct bPoseChannel *pchan,
bool select,
bool change_active);
void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select, bool change_active);
/* meshlaplacian.cc */
void ED_mesh_deform_bind_callback(struct Object *object,
struct MeshDeformModifierData *mmd,
struct Mesh *cagemesh,
void ED_mesh_deform_bind_callback(Object *object,
MeshDeformModifierData *mmd,
Mesh *cagemesh,
float *vertexcos,
int verts_num,
float cagemat[4][4]);

View File

@@ -14,7 +14,7 @@
/* Barely anything here. Just general editor level functions. Actual asset level code is in
* dedicated headers. */
void ED_operatortypes_asset(void);
void ED_operatortypes_asset();
#include "../asset/ED_asset_catalog.h"
#include "../asset/ED_asset_handle.h"

View File

@@ -18,17 +18,17 @@ struct PointerRNA;
*
* \return The total number of items in the array returned.
*/
int ED_buttons_tabs_list(struct SpaceProperties *sbuts, short *context_tabs_array);
bool ED_buttons_tab_has_search_result(struct SpaceProperties *sbuts, int index);
int ED_buttons_tabs_list(SpaceProperties *sbuts, short *context_tabs_array);
bool ED_buttons_tab_has_search_result(SpaceProperties *sbuts, int index);
void ED_buttons_search_string_set(struct SpaceProperties *sbuts, const char *value);
int ED_buttons_search_string_length(struct SpaceProperties *sbuts);
const char *ED_buttons_search_string_get(struct SpaceProperties *sbuts);
void ED_buttons_search_string_set(SpaceProperties *sbuts, const char *value);
int ED_buttons_search_string_length(SpaceProperties *sbuts);
const char *ED_buttons_search_string_get(SpaceProperties *sbuts);
bool ED_buttons_should_sync_with_outliner(const struct bContext *C,
const struct SpaceProperties *sbuts,
struct ScrArea *area);
void ED_buttons_set_context(const struct bContext *C,
struct SpaceProperties *sbuts,
bool ED_buttons_should_sync_with_outliner(const bContext *C,
const SpaceProperties *sbuts,
ScrArea *area);
void ED_buttons_set_context(const bContext *C,
SpaceProperties *sbuts,
PointerRNA *ptr,
int context);

View File

@@ -22,28 +22,28 @@ struct bScreen;
/* Returns true when the following conditions are met:
* - Current space is Space Clip.
* - There is a movie clip opened in it. */
bool ED_space_clip_poll(struct bContext *C);
bool ED_space_clip_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Space Clip.
* - It is set to Clip view.
*
* It is not required to have movie clip opened for editing. */
bool ED_space_clip_view_clip_poll(struct bContext *C);
bool ED_space_clip_view_clip_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Space Clip.
* - It is set to Tracking mode.
*
* It is not required to have movie clip opened for editing. */
bool ED_space_clip_tracking_poll(struct bContext *C);
bool ED_space_clip_tracking_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Space Clip.
* - It is set to Mask mode.
*
* It is not required to have mask opened for editing. */
bool ED_space_clip_maskedit_poll(struct bContext *C);
bool ED_space_clip_maskedit_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Space Clip.
@@ -51,95 +51,83 @@ bool ED_space_clip_maskedit_poll(struct bContext *C);
* - Mask has visible and editable splines.
*
* It is not required to have mask opened for editing. */
bool ED_space_clip_maskedit_visible_splines_poll(struct bContext *C);
bool ED_space_clip_maskedit_visible_splines_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Space Clip.
* - It is set to Mask mode.
* - The space has mask opened. */
bool ED_space_clip_maskedit_mask_poll(struct bContext *C);
bool ED_space_clip_maskedit_mask_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Space Clip.
* - It is set to Mask mode.
* - The space has mask opened.
* - Mask has visible and editable splines. */
bool ED_space_clip_maskedit_mask_visible_splines_poll(struct bContext *C);
bool ED_space_clip_maskedit_mask_visible_splines_poll(bContext *C);
void ED_space_clip_get_size(const struct SpaceClip *sc, int *width, int *height);
void ED_space_clip_get_size_fl(const struct SpaceClip *sc, float size[2]);
void ED_space_clip_get_zoom(const struct SpaceClip *sc,
const struct ARegion *region,
void ED_space_clip_get_size(const SpaceClip *sc, int *width, int *height);
void ED_space_clip_get_size_fl(const SpaceClip *sc, float size[2]);
void ED_space_clip_get_zoom(const SpaceClip *sc,
const ARegion *region,
float *zoomx,
float *zoomy);
void ED_space_clip_get_aspect(const struct SpaceClip *sc, float *aspx, float *aspy);
void ED_space_clip_get_aspect_dimension_aware(const struct SpaceClip *sc,
float *aspx,
float *aspy);
void ED_space_clip_get_aspect(const SpaceClip *sc, float *aspx, float *aspy);
void ED_space_clip_get_aspect_dimension_aware(const SpaceClip *sc, float *aspx, float *aspy);
/**
* Return current frame number in clip space.
*/
int ED_space_clip_get_clip_frame_number(const struct SpaceClip *sc);
int ED_space_clip_get_clip_frame_number(const SpaceClip *sc);
struct ImBuf *ED_space_clip_get_buffer(const struct SpaceClip *sc);
struct ImBuf *ED_space_clip_get_stable_buffer(const struct SpaceClip *sc,
float loc[2],
float *scale,
float *angle);
ImBuf *ED_space_clip_get_buffer(const SpaceClip *sc);
ImBuf *ED_space_clip_get_stable_buffer(const SpaceClip *sc,
float loc[2],
float *scale,
float *angle);
bool ED_space_clip_get_position(const struct SpaceClip *sc,
const struct ARegion *region,
bool ED_space_clip_get_position(const SpaceClip *sc,
const ARegion *region,
int mval[2],
float fpos[2]);
/**
* Returns color in linear space, matching #ED_space_image_color_sample().
*/
bool ED_space_clip_color_sample(const struct SpaceClip *sc,
const struct ARegion *region,
bool ED_space_clip_color_sample(const SpaceClip *sc,
const ARegion *region,
const int mval[2],
float r_col[3]);
void ED_clip_update_frame(const struct Main *mainp, int cfra);
bool ED_clip_view_selection(const struct bContext *C, const struct ARegion *region, bool fit);
void ED_clip_update_frame(const Main *mainp, int cfra);
bool ED_clip_view_selection(const bContext *C, const ARegion *region, bool fit);
void ED_clip_select_all(const struct SpaceClip *sc, int action, bool *r_has_selection);
bool ED_clip_can_select(struct bContext *C);
void ED_clip_select_all(const SpaceClip *sc, int action, bool *r_has_selection);
bool ED_clip_can_select(bContext *C);
void ED_clip_point_undistorted_pos(const struct SpaceClip *sc, const float co[2], float r_co[2]);
void ED_clip_point_stable_pos(const struct SpaceClip *sc,
const struct ARegion *region,
float x,
float y,
float *xr,
float *yr);
void ED_clip_point_undistorted_pos(const SpaceClip *sc, const float co[2], float r_co[2]);
void ED_clip_point_stable_pos(
const SpaceClip *sc, const ARegion *region, float x, float y, float *xr, float *yr);
/**
* \brief the reverse of #ED_clip_point_stable_pos(), gets the marker region coords.
* better name here? view_to_track / track_to_view or so?
*/
void ED_clip_point_stable_pos__reverse(const struct SpaceClip *sc,
const struct ARegion *region,
void ED_clip_point_stable_pos__reverse(const SpaceClip *sc,
const ARegion *region,
const float co[2],
float r_co[2]);
/**
* Takes `event->mval`.
*/
void ED_clip_mouse_pos(const struct SpaceClip *sc,
const struct ARegion *region,
const int mval[2],
float co[2]);
void ED_clip_mouse_pos(const SpaceClip *sc, const ARegion *region, const int mval[2], float co[2]);
bool ED_space_clip_check_show_trackedit(const struct SpaceClip *sc);
bool ED_space_clip_check_show_maskedit(const struct SpaceClip *sc);
bool ED_space_clip_check_show_trackedit(const SpaceClip *sc);
bool ED_space_clip_check_show_maskedit(const SpaceClip *sc);
struct MovieClip *ED_space_clip_get_clip(const struct SpaceClip *sc);
void ED_space_clip_set_clip(struct bContext *C,
struct bScreen *screen,
struct SpaceClip *sc,
struct MovieClip *clip);
MovieClip *ED_space_clip_get_clip(const SpaceClip *sc);
void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip);
struct Mask *ED_space_clip_get_mask(const struct SpaceClip *sc);
void ED_space_clip_set_mask(struct bContext *C, struct SpaceClip *sc, struct Mask *mask);
Mask *ED_space_clip_get_mask(const SpaceClip *sc);
void ED_space_clip_set_mask(bContext *C, SpaceClip *sc, Mask *mask);
/* Locked state is used to preserve current clip editor viewport upon changes. Example usage:
*
@@ -155,15 +143,14 @@ void ED_space_clip_set_mask(struct bContext *C, struct SpaceClip *sc, struct Mas
* These function are to be used from space clip editor context only. Otherwise debug builds will
* assert, release builds will crash. */
typedef struct ClipViewLockState {
struct ClipViewLockState {
float offset_x, offset_y;
float lock_offset_x, lock_offset_y;
float zoom;
} ClipViewLockState;
};
void ED_clip_view_lock_state_store(const struct bContext *C, ClipViewLockState *state);
void ED_clip_view_lock_state_restore_no_jump(const struct bContext *C,
const ClipViewLockState *state);
void ED_clip_view_lock_state_store(const bContext *C, ClipViewLockState *state);
void ED_clip_view_lock_state_restore_no_jump(const bContext *C, const ClipViewLockState *state);
/* `clip_ops.cc` */
void ED_operatormacros_clip(void);

View File

@@ -13,6 +13,7 @@ struct Base;
struct BezTriple;
struct Curve;
struct EditNurb;
struct ListBase;
struct Main;
struct Nurb;
struct Object;
@@ -26,97 +27,94 @@ struct wmOperator;
/* `curve_ops.cc` */
void ED_operatortypes_curve(void);
void ED_operatormacros_curve(void);
void ED_keymap_curve(struct wmKeyConfig *keyconf);
void ED_operatortypes_curve();
void ED_operatormacros_curve();
void ED_keymap_curve(wmKeyConfig *keyconf);
/* `editcurve.cc` */
struct ListBase *object_editcurve_get(struct Object *ob);
ListBase *object_editcurve_get(Object *ob);
/**
* Load editNurb in object.
*/
void ED_curve_editnurb_load(struct Main *bmain, struct Object *obedit);
void ED_curve_editnurb_load(Main *bmain, Object *obedit);
/**
* Make copy in `cu->editnurb`.
*/
void ED_curve_editnurb_make(struct Object *obedit);
void ED_curve_editnurb_free(struct Object *obedit);
void ED_curve_editnurb_make(Object *obedit);
void ED_curve_editnurb_free(Object *obedit);
/**
* \param dist_px: Maximum distance to pick (in pixels).
* \param vert_without_handles: When true, selecting the knot doesn't select the handles.
*/
bool ED_curve_editnurb_select_pick(struct bContext *C,
bool ED_curve_editnurb_select_pick(bContext *C,
const int mval[2],
int dist_px,
bool vert_without_handles,
const struct SelectPick_Params *params);
const SelectPick_Params *params);
struct Nurb *ED_curve_add_nurbs_primitive(
struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob);
Nurb *ED_curve_add_nurbs_primitive(
bContext *C, Object *obedit, float mat[4][4], int type, int newob);
bool ED_curve_nurb_select_check(const struct View3D *v3d, const struct Nurb *nu);
int ED_curve_nurb_select_count(const struct View3D *v3d, const struct Nurb *nu);
bool ED_curve_nurb_select_all(const struct Nurb *nu);
bool ED_curve_nurb_deselect_all(const struct Nurb *nu);
bool ED_curve_nurb_select_check(const View3D *v3d, const Nurb *nu);
int ED_curve_nurb_select_count(const View3D *v3d, const Nurb *nu);
bool ED_curve_nurb_select_all(const Nurb *nu);
bool ED_curve_nurb_deselect_all(const Nurb *nu);
/**
* This is used externally, by #OBJECT_OT_join.
* TODO: shape keys - as with meshes.
*/
int ED_curve_join_objects_exec(struct bContext *C, struct wmOperator *op);
int ED_curve_join_objects_exec(bContext *C, wmOperator *op);
/* `editcurve_select.cc` */
bool ED_curve_select_check(const struct View3D *v3d, const struct EditNurb *editnurb);
bool ED_curve_deselect_all(struct EditNurb *editnurb);
bool ED_curve_deselect_all_multi_ex(struct Base **bases, int bases_len);
bool ED_curve_deselect_all_multi(struct bContext *C);
bool ED_curve_select_all(struct EditNurb *editnurb);
bool ED_curve_select_swap(struct EditNurb *editnurb, bool hide_handles);
int ED_curve_select_count(const struct View3D *v3d, const struct EditNurb *editnurb);
bool ED_curve_select_check(const View3D *v3d, const EditNurb *editnurb);
bool ED_curve_deselect_all(EditNurb *editnurb);
bool ED_curve_deselect_all_multi_ex(Base **bases, int bases_len);
bool ED_curve_deselect_all_multi(bContext *C);
bool ED_curve_select_all(EditNurb *editnurb);
bool ED_curve_select_swap(EditNurb *editnurb, bool hide_handles);
int ED_curve_select_count(const View3D *v3d, const EditNurb *editnurb);
/* editcurve_undo.cc */
/** Export for ED_undo_sys */
void ED_curve_undosys_type(struct UndoType *ut);
void ED_curve_undosys_type(UndoType *ut);
/* `editfont.cc` */
void ED_curve_editfont_load(struct Object *obedit);
void ED_curve_editfont_make(struct Object *obedit);
void ED_curve_editfont_free(struct Object *obedit);
void ED_curve_editfont_load(Object *obedit);
void ED_curve_editfont_make(Object *obedit);
void ED_curve_editfont_free(Object *obedit);
void ED_text_to_object(struct bContext *C, const struct Text *text, bool split_lines);
void ED_text_to_object(bContext *C, const Text *text, bool split_lines);
void ED_curve_beztcpy(struct EditNurb *editnurb,
struct BezTriple *dst,
struct BezTriple *src,
int count);
void ED_curve_bpcpy(struct EditNurb *editnurb, struct BPoint *dst, struct BPoint *src, int count);
void ED_curve_beztcpy(EditNurb *editnurb, BezTriple *dst, BezTriple *src, int count);
void ED_curve_bpcpy(EditNurb *editnurb, BPoint *dst, BPoint *src, int count);
/**
* Return 0 if animation data wasn't changed, 1 otherwise.
*/
int ED_curve_updateAnimPaths(struct Main *bmain, struct Curve *cu);
int ED_curve_updateAnimPaths(Main *bmain, Curve *cu);
bool ED_curve_active_center(struct Curve *cu, float center[3]);
bool ED_curve_active_center(Curve *cu, float center[3]);
/**
* Text box selection.
*
* \return True when pick finds an element or the selection changed.
*/
bool ED_curve_editfont_select_pick(struct bContext *C,
bool ED_curve_editfont_select_pick(bContext *C,
const int mval[2],
const struct SelectPick_Params *params);
const SelectPick_Params *params);
/* `editfont_undo.cc` */
/** Export for ED_undo_sys. */
void ED_font_undosys_type(struct UndoType *ut);
void ED_font_undosys_type(UndoType *ut);
#if 0
/* debug only */

View File

@@ -8,4 +8,4 @@
#pragma once
void ED_operatortypes_sculpt_curves(void);
void ED_operatortypes_sculpt_curves();

View File

@@ -25,7 +25,7 @@ struct LinkNode;
/**
* Result code of the `read_index` callback.
*/
typedef enum eFileIndexerResult {
enum eFileIndexerResult {
/**
* File listing entries are loaded from the index. Reading entries from the blend file itself
* should be skipped.
@@ -37,36 +37,36 @@ typedef enum eFileIndexerResult {
* `update_index` must be called to update the index.
*/
FILE_INDEXER_NEEDS_UPDATE,
} eFileIndexerResult;
};
/**
* FileIndexerEntry contains all data that is required to create a file listing entry.
*/
typedef struct FileIndexerEntry {
struct BLODataBlockInfo datablock_info;
struct FileIndexerEntry {
BLODataBlockInfo datablock_info;
short idcode;
} FileIndexerEntry;
};
/**
* Contains all entries of a blend file.
*/
typedef struct FileIndexerEntries {
struct LinkNode /* FileIndexerEntry */ *entries;
} FileIndexerEntries;
struct FileIndexerEntries {
LinkNode /* FileIndexerEntry */ *entries;
};
typedef void *(*FileIndexerInitUserDataFunc)(const char *root_directory,
size_t root_directory_maxlen);
typedef void (*FileIndexerFreeUserDataFunc)(void *);
typedef void (*FileIndexerFinishedFunc)(void *);
typedef eFileIndexerResult (*FileIndexerReadIndexFunc)(const char *file_name,
FileIndexerEntries *entries,
int *r_read_entries_len,
void *user_data);
typedef void (*FileIndexerUpdateIndexFunc)(const char *file_name,
FileIndexerEntries *entries,
void *user_data);
using FileIndexerInitUserDataFunc = void *(*)(const char *root_directory,
size_t root_directory_maxlen);
using FileIndexerFreeUserDataFunc = void (*)(void *);
using FileIndexerFinishedFunc = void (*)(void *);
using FileIndexerReadIndexFunc = eFileIndexerResult (*)(const char *file_name,
FileIndexerEntries *entries,
int *r_read_entries_len,
void *user_data);
using FileIndexerUpdateIndexFunc = void (*)(const char *file_name,
FileIndexerEntries *entries,
void *user_data);
typedef struct FileIndexerType {
struct FileIndexerType {
/**
* Is called at the beginning of the file listing process. An indexer can
* setup needed data. The result of this function will be passed around as `user_data` parameter.
@@ -115,7 +115,7 @@ typedef struct FileIndexerType {
* next time that read_index is called it will read the entries from the index.
*/
FileIndexerUpdateIndexFunc update_index;
} FileIndexerType;
};
/* file_indexer.cc */
@@ -132,5 +132,5 @@ void ED_file_indexer_entries_clear(FileIndexerEntries *indexer_entries);
*/
void ED_file_indexer_entries_extend_from_datablock_infos(
FileIndexerEntries *indexer_entries,
struct LinkNode * /*BLODataBlockInfo*/ datablock_infos,
LinkNode * /*BLODataBlockInfo*/ datablock_infos,
int idcode);

View File

@@ -11,9 +11,13 @@
#include "DNA_uuid_types.h"
struct ARegion;
struct AssetLibrary;
struct FileAssetSelectParams;
struct FileDirEntry;
struct FileSelectParams;
struct FSMenu;
struct FSMenuEntry;
struct ID;
struct ScrArea;
struct SpaceFile;
struct bContext;
@@ -22,20 +26,22 @@ struct uiBlock;
struct wmOperator;
struct wmWindow;
struct wmWindowManager;
struct View2D;
struct rcti;
#define FILE_LAYOUT_HOR 1
#define FILE_LAYOUT_VER 2
typedef enum FileAttributeColumnType {
enum FileAttributeColumnType {
COLUMN_NONE = -1,
COLUMN_NAME = 0,
COLUMN_DATETIME,
COLUMN_SIZE,
ATTRIBUTE_COLUMN_MAX
} FileAttributeColumnType;
};
typedef struct FileAttributeColumn {
struct FileAttributeColumn {
/** UI name for this column */
const char *name;
@@ -45,9 +51,9 @@ typedef struct FileAttributeColumn {
/* Alignment of column texts, header text is always left aligned */
int text_align; /* eFontStyle_Align */
} FileAttributeColumn;
};
typedef struct FileLayout {
struct FileLayout {
/* view settings - XXX: move into own struct. */
int offset_top;
/* Height of the header for the different FileAttributeColumn's. */
@@ -75,29 +81,26 @@ typedef struct FileLayout {
/* When we change display size, we may have to update static strings like size of files... */
short curr_size;
} FileLayout;
};
typedef struct FileSelection {
struct FileSelection {
int first;
int last;
} FileSelection;
struct View2D;
struct rcti;
};
/**
* If needed, create and return the file select parameters for the active browse mode.
*/
struct FileSelectParams *ED_fileselect_ensure_active_params(struct SpaceFile *sfile);
FileSelectParams *ED_fileselect_ensure_active_params(SpaceFile *sfile);
/**
* Get the file select parameters for the active browse mode.
*/
struct FileSelectParams *ED_fileselect_get_active_params(const struct SpaceFile *sfile);
struct FileSelectParams *ED_fileselect_get_file_params(const struct SpaceFile *sfile);
struct FileAssetSelectParams *ED_fileselect_get_asset_params(const struct SpaceFile *sfile);
bool ED_fileselect_is_local_asset_library(const struct SpaceFile *sfile);
FileSelectParams *ED_fileselect_get_active_params(const SpaceFile *sfile);
FileSelectParams *ED_fileselect_get_file_params(const SpaceFile *sfile);
FileAssetSelectParams *ED_fileselect_get_asset_params(const SpaceFile *sfile);
bool ED_fileselect_is_local_asset_library(const SpaceFile *sfile);
void ED_fileselect_set_params_from_userdef(struct SpaceFile *sfile);
void ED_fileselect_set_params_from_userdef(SpaceFile *sfile);
/**
* Update the user-preference data for the file space. In fact, this also contains some
* non-FileSelectParams data, but we can safely ignore this.
@@ -105,47 +108,42 @@ void ED_fileselect_set_params_from_userdef(struct SpaceFile *sfile);
* \param temp_win_size: If the browser was opened in a temporary window,
* pass its size here so we can store that in the preferences. Otherwise NULL.
*/
void ED_fileselect_params_to_userdef(struct SpaceFile *sfile,
void ED_fileselect_params_to_userdef(SpaceFile *sfile,
const int temp_win_size[2],
bool is_maximized);
void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *region);
void ED_fileselect_init_layout(SpaceFile *sfile, ARegion *region);
FileLayout *ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *region);
FileLayout *ED_fileselect_get_layout(SpaceFile *sfile, ARegion *region);
int ED_fileselect_layout_numfiles(FileLayout *layout, struct ARegion *region);
int ED_fileselect_layout_numfiles(FileLayout *layout, ARegion *region);
int ED_fileselect_layout_offset(FileLayout *layout, int x, int y);
FileSelection ED_fileselect_layout_offset_rect(FileLayout *layout, const struct rcti *rect);
FileSelection ED_fileselect_layout_offset_rect(FileLayout *layout, const rcti *rect);
/**
* Get the currently visible bounds of the layout in screen space. Matches View2D.mask minus the
* top column-header row.
*/
void ED_fileselect_layout_maskrect(const FileLayout *layout,
const struct View2D *v2d,
struct rcti *r_rect);
bool ED_fileselect_layout_is_inside_pt(const FileLayout *layout,
const struct View2D *v2d,
int x,
int y);
void ED_fileselect_layout_maskrect(const FileLayout *layout, const View2D *v2d, rcti *r_rect);
bool ED_fileselect_layout_is_inside_pt(const FileLayout *layout, const View2D *v2d, int x, int y);
bool ED_fileselect_layout_isect_rect(const FileLayout *layout,
const struct View2D *v2d,
const struct rcti *rect,
struct rcti *r_dst);
const View2D *v2d,
const rcti *rect,
rcti *r_dst);
void ED_fileselect_layout_tilepos(const FileLayout *layout, int tile, int *x, int *y);
void ED_operatormacros_file(void);
void ED_fileselect_clear(struct wmWindowManager *wm, struct SpaceFile *sfile);
void ED_fileselect_clear(wmWindowManager *wm, SpaceFile *sfile);
void ED_fileselect_exit(struct wmWindowManager *wm, struct SpaceFile *sfile);
void ED_fileselect_exit(wmWindowManager *wm, SpaceFile *sfile);
bool ED_fileselect_is_file_browser(const struct SpaceFile *sfile);
bool ED_fileselect_is_asset_browser(const struct SpaceFile *sfile);
struct AssetLibrary *ED_fileselect_active_asset_library_get(const struct SpaceFile *sfile);
struct ID *ED_fileselect_active_asset_get(const struct SpaceFile *sfile);
bool ED_fileselect_is_file_browser(const SpaceFile *sfile);
bool ED_fileselect_is_asset_browser(const SpaceFile *sfile);
AssetLibrary *ED_fileselect_active_asset_library_get(const SpaceFile *sfile);
ID *ED_fileselect_active_asset_get(const SpaceFile *sfile);
void ED_fileselect_activate_asset_catalog(const struct SpaceFile *sfile, bUUID catalog_id);
void ED_fileselect_activate_asset_catalog(const SpaceFile *sfile, bUUID catalog_id);
/**
* Resolve this space's #eFileAssetImportMethod to the #eAssetImportMethod (note the different
@@ -160,65 +158,60 @@ void ED_fileselect_activate_asset_catalog(const struct SpaceFile *sfile, bUUID c
* \return -1 on error, for example when #FILE_ASSET_IMPORT_FOLLOW_PREFS was requested but the
* active asset library reference couldn't be found in the preferences.
*/
int /* #eAssetImportMethod */ ED_fileselect_asset_import_method_get(
const struct SpaceFile *sfile, const struct FileDirEntry *file);
int /* #eAssetImportMethod */ ED_fileselect_asset_import_method_get(const SpaceFile *sfile,
const FileDirEntry *file);
/**
* Activate and select the file that corresponds to the given ID.
* Pass deferred=true to wait for the next refresh before activating.
*/
void ED_fileselect_activate_by_id(struct SpaceFile *sfile, struct ID *asset_id, bool deferred);
void ED_fileselect_activate_by_id(SpaceFile *sfile, ID *asset_id, bool deferred);
void ED_fileselect_deselect_all(struct SpaceFile *sfile);
void ED_fileselect_activate_by_relpath(struct SpaceFile *sfile, const char *relative_path);
void ED_fileselect_deselect_all(SpaceFile *sfile);
void ED_fileselect_activate_by_relpath(SpaceFile *sfile, const char *relative_path);
void ED_fileselect_window_params_get(const struct wmWindow *win,
int win_size[2],
bool *is_maximized);
void ED_fileselect_window_params_get(const wmWindow *win, int win_size[2], bool *is_maximized);
/**
* Return the File Browser area in which \a file_operator is active.
*/
struct ScrArea *ED_fileselect_handler_area_find(const struct wmWindow *win,
const struct wmOperator *file_operator);
ScrArea *ED_fileselect_handler_area_find(const wmWindow *win, const wmOperator *file_operator);
/**
* Check if there is any area in \a win that acts as a modal File Browser (#SpaceFile.op is set)
* and return it.
*/
struct ScrArea *ED_fileselect_handler_area_find_any_with_op(const struct wmWindow *win);
ScrArea *ED_fileselect_handler_area_find_any_with_op(const wmWindow *win);
/**
* If filepath property is not set on the operator, sets it to
* the blend file path (or untitled if file is not saved yet) with the given extension.
*/
void ED_fileselect_ensure_default_filepath(struct bContext *C,
struct wmOperator *op,
const char *extension);
void ED_fileselect_ensure_default_filepath(bContext *C, wmOperator *op, const char *extension);
/* TODO: Maybe we should move this to BLI?
* On the other hand, it's using defines from space-file area, so not sure... */
int ED_path_extension_type(const char *path);
int ED_file_extension_icon(const char *path);
int ED_file_icon(const struct FileDirEntry *file);
int ED_file_icon(const FileDirEntry *file);
void ED_file_read_bookmarks(void);
void ED_file_read_bookmarks();
/**
* Support updating the directory even when this isn't the active space
* needed so RNA properties update function isn't context sensitive, see #70255.
*/
void ED_file_change_dir_ex(struct bContext *C, struct ScrArea *area);
void ED_file_change_dir(struct bContext *C);
void ED_file_change_dir_ex(bContext *C, ScrArea *area);
void ED_file_change_dir(bContext *C);
void ED_file_path_button(struct bScreen *screen,
const struct SpaceFile *sfile,
struct FileSelectParams *params,
struct uiBlock *block);
void ED_file_path_button(bScreen *screen,
const SpaceFile *sfile,
FileSelectParams *params,
uiBlock *block);
/* File menu stuff */
/* FSMenuEntry's without paths indicate separators */
typedef struct FSMenuEntry {
struct FSMenuEntry {
struct FSMenuEntry *next;
char *path;
@@ -226,18 +219,18 @@ typedef struct FSMenuEntry {
short save;
short valid;
int icon;
} FSMenuEntry;
};
typedef enum FSMenuCategory {
enum FSMenuCategory {
FS_CATEGORY_SYSTEM,
FS_CATEGORY_SYSTEM_BOOKMARKS,
FS_CATEGORY_BOOKMARKS,
FS_CATEGORY_RECENT,
/* For internal use, a list of known paths that are used to match paths to icons and names. */
FS_CATEGORY_OTHER,
} FSMenuCategory;
};
typedef enum FSMenuInsert {
enum FSMenuInsert {
FS_INSERT_SORTED = (1 << 0),
FS_INSERT_SAVE = (1 << 1),
/** moves the item to the front of the list when its not already there */
@@ -246,26 +239,21 @@ typedef enum FSMenuInsert {
FS_INSERT_LAST = (1 << 3),
/** Do not validate the link when inserted. */
FS_INSERT_NO_VALIDATE = (1 << 4),
} FSMenuInsert;
};
struct FSMenu;
struct FSMenuEntry;
FSMenu *ED_fsmenu_get(void);
FSMenuEntry *ED_fsmenu_get_category(FSMenu *fsmenu, FSMenuCategory category);
void ED_fsmenu_set_category(FSMenu *fsmenu, FSMenuCategory category, FSMenuEntry *fsm_head);
struct FSMenu *ED_fsmenu_get(void);
struct FSMenuEntry *ED_fsmenu_get_category(struct FSMenu *fsmenu, FSMenuCategory category);
void ED_fsmenu_set_category(struct FSMenu *fsmenu,
FSMenuCategory category,
struct FSMenuEntry *fsm_head);
int ED_fsmenu_get_nentries(FSMenu *fsmenu, FSMenuCategory category);
int ED_fsmenu_get_nentries(struct FSMenu *fsmenu, FSMenuCategory category);
FSMenuEntry *ED_fsmenu_get_entry(FSMenu *fsmenu, FSMenuCategory category, int idx);
struct FSMenuEntry *ED_fsmenu_get_entry(struct FSMenu *fsmenu, FSMenuCategory category, int idx);
char *ED_fsmenu_entry_get_path(FSMenuEntry *fsentry);
void ED_fsmenu_entry_set_path(FSMenuEntry *fsentry, const char *path);
char *ED_fsmenu_entry_get_path(struct FSMenuEntry *fsentry);
void ED_fsmenu_entry_set_path(struct FSMenuEntry *fsentry, const char *path);
char *ED_fsmenu_entry_get_name(FSMenuEntry *fsentry);
void ED_fsmenu_entry_set_name(FSMenuEntry *fsentry, const char *name);
char *ED_fsmenu_entry_get_name(struct FSMenuEntry *fsentry);
void ED_fsmenu_entry_set_name(struct FSMenuEntry *fsentry, const char *name);
int ED_fsmenu_entry_get_icon(struct FSMenuEntry *fsentry);
void ED_fsmenu_entry_set_icon(struct FSMenuEntry *fsentry, int icon);
int ED_fsmenu_entry_get_icon(FSMenuEntry *fsentry);
void ED_fsmenu_entry_set_icon(FSMenuEntry *fsentry, int icon);

View File

@@ -18,7 +18,7 @@
struct Mesh;
struct ReportList;
void ED_operatortypes_geometry(void);
void ED_operatortypes_geometry();
/**
* Convert an attribute with the given name to a new type and domain.
@@ -26,7 +26,7 @@ void ED_operatortypes_geometry(void);
*
* \note Does not support meshes in edit mode.
*/
bool ED_geometry_attribute_convert(struct Mesh *mesh,
bool ED_geometry_attribute_convert(Mesh *mesh,
const char *name,
eCustomDataType dst_type,
eAttrDomain dst_domain,

View File

@@ -14,14 +14,13 @@ struct bContext;
struct wmGizmoGroupType;
/** Wrapper function (operator name can't be guessed). */
bool ED_gizmo_poll_or_unlink_delayed_from_operator(const struct bContext *C,
struct wmGizmoGroupType *gzgt,
bool ED_gizmo_poll_or_unlink_delayed_from_operator(const bContext *C,
wmGizmoGroupType *gzgt,
const char *idname);
bool ED_gizmo_poll_or_unlink_delayed_from_tool_ex(const struct bContext *C,
struct wmGizmoGroupType *gzgt,
bool ED_gizmo_poll_or_unlink_delayed_from_tool_ex(const bContext *C,
wmGizmoGroupType *gzgt,
const char *gzgt_idname);
/** Use this as poll function directly for: #wmGizmoGroupType.poll */
bool ED_gizmo_poll_or_unlink_delayed_from_tool(const struct bContext *C,
struct wmGizmoGroupType *gzgt);
bool ED_gizmo_poll_or_unlink_delayed_from_tool(const bContext *C, wmGizmoGroupType *gzgt);

View File

@@ -46,7 +46,7 @@ struct wmOperator;
#define GPENCIL_MINIMUM_JOIN_DIST 20.0f
/* Reproject stroke modes. */
typedef enum eGP_ReprojectModes {
enum eGP_ReprojectModes {
/* Axis */
GP_REPROJECT_FRONT = 0,
GP_REPROJECT_SIDE,
@@ -59,13 +59,13 @@ typedef enum eGP_ReprojectModes {
GP_REPROJECT_CURSOR,
/* Keep equals (used in some operators) */
GP_REPROJECT_KEEP,
} eGP_ReprojectModes;
};
/* Target object modes. */
typedef enum eGP_TargetObjectMode {
enum eGP_TargetObjectMode {
GP_TARGET_OB_NEW = 0,
GP_TARGET_OB_SELECTED = 1,
} eGP_TargetObjectMode;
};
/* ------------- Grease-Pencil Runtime Data ---------------- */
@@ -73,7 +73,7 @@ typedef enum eGP_TargetObjectMode {
*
* Used as part of the 'stroke cache' used during drawing of new strokes
*/
typedef struct tGPspoint {
struct tGPspoint {
/** Coordinates x and y of cursor (in relative to area). */
float m_xy[2];
/** Pressure of tablet at this point. */
@@ -92,7 +92,7 @@ typedef struct tGPspoint {
bool rnd_dirty;
/** Point vertex color. */
float vert_color[4];
} tGPspoint;
};
/* ----------- Grease Pencil Tools/Context ------------- */
@@ -102,12 +102,12 @@ typedef struct tGPspoint {
* Get pointer to active Grease Pencil data-block,
* and an RNA-pointer to trace back to whatever owns it.
*/
struct bGPdata **ED_gpencil_data_get_pointers(const struct bContext *C, struct PointerRNA *r_ptr);
bGPdata **ED_gpencil_data_get_pointers(const bContext *C, PointerRNA *r_ptr);
/**
* Get the active Grease Pencil data-block
*/
struct bGPdata *ED_gpencil_data_get_active(const struct bContext *C);
bGPdata *ED_gpencil_data_get_active(const bContext *C);
/**
* Get the evaluated copy of the active Grease Pencil data-block (where applicable)
* - For the 3D View (i.e. "GP Objects"), this gives the evaluated copy of the GP data-block
@@ -116,7 +116,7 @@ struct bGPdata *ED_gpencil_data_get_active(const struct bContext *C);
* - For all other editors (i.e. "GP Annotations"), this just gives the active data-block
* like for #ED_gpencil_data_get_active()
*/
struct bGPdata *ED_gpencil_data_get_active_evaluated(const struct bContext *C);
bGPdata *ED_gpencil_data_get_active_evaluated(const bContext *C);
/**
* Context independent (i.e. each required part is passed in instead).
@@ -125,77 +125,70 @@ struct bGPdata *ED_gpencil_data_get_active_evaluated(const struct bContext *C);
* and an RNA-pointer to trace back to whatever owns it,
* when context info is not available.
*/
struct bGPdata **ED_gpencil_data_get_pointers_direct(struct ScrArea *area,
struct Object *ob,
struct PointerRNA *r_ptr);
bGPdata **ED_gpencil_data_get_pointers_direct(ScrArea *area, Object *ob, PointerRNA *r_ptr);
/* Get the active Grease Pencil data-block, when context is not available */
struct bGPdata *ED_gpencil_data_get_active_direct(struct ScrArea *area, struct Object *ob);
bGPdata *ED_gpencil_data_get_active_direct(ScrArea *area, Object *ob);
/**
* Get the active Grease Pencil data-block
* \note This is the original (#G.main) copy of the data-block, stored in files.
* Do not use for reading evaluated copies of GP Objects data.
*/
struct bGPdata *ED_annotation_data_get_active(const struct bContext *C);
bGPdata *ED_annotation_data_get_active(const bContext *C);
/**
* Get pointer to active Grease Pencil data-block,
* and an RNA-pointer to trace back to whatever owns it.
*/
struct bGPdata **ED_annotation_data_get_pointers(const struct bContext *C,
struct PointerRNA *r_ptr);
bGPdata **ED_annotation_data_get_pointers(const bContext *C, PointerRNA *r_ptr);
/**
* Get pointer to active Grease Pencil data-block for annotations,
* and an RNA-pointer to trace back to whatever owns it,
* when context info is not available.
*/
struct bGPdata **ED_annotation_data_get_pointers_direct(struct ID *screen_id,
struct ScrArea *area,
struct Scene *scene,
struct PointerRNA *r_ptr);
bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
ScrArea *area,
Scene *scene,
PointerRNA *r_ptr);
/**
* Get the active Grease Pencil data-block, when context is not available.
*/
struct bGPdata *ED_annotation_data_get_active_direct(struct ID *screen_id,
struct ScrArea *area,
struct Scene *scene);
bGPdata *ED_annotation_data_get_active_direct(ID *screen_id, ScrArea *area, Scene *scene);
/**
* Utility to check whether the r_ptr output of ED_gpencil_data_get_pointers()
* is for annotation usage.
*/
bool ED_gpencil_data_owner_is_annotation(struct PointerRNA *owner_ptr);
bool ED_gpencil_data_owner_is_annotation(PointerRNA *owner_ptr);
/* 3D View */
/**
* Check whether there's an active GP keyframe on the current frame.
*/
bool ED_gpencil_has_keyframe_v3d(struct Scene *scene, struct Object *ob, int cfra);
bool ED_gpencil_has_keyframe_v3d(Scene *scene, Object *ob, int cfra);
/* ----------- Stroke Editing Utilities ---------------- */
bool ED_gpencil_frame_has_selected_stroke(const struct bGPDframe *gpf);
bool ED_gpencil_layer_has_selected_stroke(const struct bGPDlayer *gpl, bool is_multiedit);
bool ED_gpencil_frame_has_selected_stroke(const bGPDframe *gpf);
bool ED_gpencil_layer_has_selected_stroke(const bGPDlayer *gpl, bool is_multiedit);
/**
* Check whether given stroke can be edited given the supplied context.
* TODO: do we need additional flags for screen-space vs data-space?.
*/
bool ED_gpencil_stroke_can_use_direct(const struct ScrArea *area, const struct bGPDstroke *gps);
bool ED_gpencil_stroke_can_use_direct(const ScrArea *area, const bGPDstroke *gps);
/* Check whether given stroke can be edited in the current context */
bool ED_gpencil_stroke_can_use(const struct bContext *C, const struct bGPDstroke *gps);
bool ED_gpencil_stroke_can_use(const bContext *C, const bGPDstroke *gps);
/* Check whether given stroke can be edited for the current color */
bool ED_gpencil_stroke_material_editable(struct Object *ob,
const struct bGPDlayer *gpl,
const struct bGPDstroke *gps);
bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const bGPDstroke *gps);
/* Check whether given stroke is visible for the current material. */
bool ED_gpencil_stroke_material_visible(struct Object *ob, const struct bGPDstroke *gps);
bool ED_gpencil_stroke_material_visible(Object *ob, const bGPDstroke *gps);
/* ----------- Grease Pencil Operators ----------------- */
void ED_keymap_gpencil_legacy(struct wmKeyConfig *keyconf);
void ED_keymap_gpencil_legacy(wmKeyConfig *keyconf);
void ED_operatortypes_gpencil_legacy(void);
void ED_operatormacros_gpencil(void);
void ED_operatortypes_gpencil_legacy();
void ED_operatormacros_gpencil();
/* ------------- Copy-Paste Buffers -------------------- */
@@ -204,7 +197,7 @@ void ED_operatormacros_gpencil(void);
/**
* Free copy/paste buffer data.
*/
void ED_gpencil_strokes_copybuf_free(void);
void ED_gpencil_strokes_copybuf_free();
/* ------------ Grease-Pencil Drawing API ------------------ */
/* `drawgpencil.cc` */
@@ -212,7 +205,7 @@ void ED_gpencil_strokes_copybuf_free(void);
/**
* Draw grease-pencil sketches to specified 2d-view that uses `ibuf` corrections.
*/
void ED_annotation_draw_2dimage(const struct bContext *C);
void ED_annotation_draw_2dimage(const bContext *C);
/**
* Draw grease-pencil sketches to specified 2d-view
* assuming that matrices are already set correctly.
@@ -220,144 +213,129 @@ void ED_annotation_draw_2dimage(const struct bContext *C);
* \note This gets called twice - first time with onlyv2d=true to draw 'canvas' strokes,
* second time with onlyv2d=false for screen-aligned strokes.
*/
void ED_annotation_draw_view2d(const struct bContext *C, bool onlyv2d);
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d);
/**
* Draw annotations sketches to specified 3d-view assuming that matrices are already set correctly.
* NOTE: this gets called twice - first time with only3d=true to draw 3d-strokes,
* second time with only3d=false for screen-aligned strokes.
*/
void ED_annotation_draw_view3d(struct Scene *scene,
struct Depsgraph *depsgraph,
struct View3D *v3d,
struct ARegion *region,
bool only3d);
void ED_annotation_draw_view3d(
Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d);
void ED_annotation_draw_ex(
struct Scene *scene, struct bGPdata *gpd, int winx, int winy, int cfra, char spacetype);
Scene *scene, bGPdata *gpd, int winx, int winy, int cfra, char spacetype);
/* ----------- Grease-Pencil AnimEdit API ------------------ */
/**
* Loops over the GP-frames for a GP-layer, and applies the given callback.
*/
bool ED_gpencil_layer_frames_looper(struct bGPDlayer *gpl,
struct Scene *scene,
bool (*gpf_cb)(struct bGPDframe *, struct Scene *));
bool ED_gpencil_layer_frames_looper(bGPDlayer *gpl,
Scene *scene,
bool (*gpf_cb)(bGPDframe *, Scene *));
/**
* Make a listing all the gp-frames in a layer as cfraelems.
*/
void ED_gpencil_layer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, bool onlysel);
void ED_gpencil_layer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlysel);
/**
* Check if one of the frames in this layer is selected.
*/
bool ED_gpencil_layer_frame_select_check(const struct bGPDlayer *gpl);
bool ED_gpencil_layer_frame_select_check(const bGPDlayer *gpl);
/**
* Set all/none/invert select.
*/
void ED_gpencil_layer_frame_select_set(struct bGPDlayer *gpl, short mode);
void ED_gpencil_layer_frame_select_set(bGPDlayer *gpl, short mode);
/**
* Select the frames in this layer that occur within the bounds specified.
*/
void ED_gpencil_layer_frames_select_box(struct bGPDlayer *gpl,
float min,
float max,
short select_mode);
void ED_gpencil_layer_frames_select_box(bGPDlayer *gpl, float min, float max, short select_mode);
/**
* Select the frames in this layer that occur within the lasso/circle region specified.
*/
void ED_gpencil_layer_frames_select_region(struct KeyframeEditData *ked,
struct bGPDlayer *gpl,
void ED_gpencil_layer_frames_select_region(KeyframeEditData *ked,
bGPDlayer *gpl,
short tool,
short select_mode);
/**
* Set all/none/invert select (like above, but with SELECT_* modes).
*/
void ED_gpencil_select_frames(struct bGPDlayer *gpl, short select_mode);
void ED_gpencil_select_frames(bGPDlayer *gpl, short select_mode);
/**
* Select the frame in this layer that occurs on this frame (there should only be one at most).
*/
void ED_gpencil_select_frame(struct bGPDlayer *gpl, int selx, short select_mode);
void ED_gpencil_select_frame(bGPDlayer *gpl, int selx, short select_mode);
/**
* Set the layer's channel as active
*/
void ED_gpencil_set_active_channel(struct bGPdata *gpd, struct bGPDlayer *gpl);
void ED_gpencil_set_active_channel(bGPdata *gpd, bGPDlayer *gpl);
/**
* Delete selected frames.
*/
bool ED_gpencil_layer_frames_delete(struct bGPDlayer *gpl);
bool ED_gpencil_layer_frames_delete(bGPDlayer *gpl);
/**
* Duplicate selected frames from given gp-layer.
*/
void ED_gpencil_layer_frames_duplicate(struct bGPDlayer *gpl);
void ED_gpencil_layer_frames_duplicate(bGPDlayer *gpl);
/**
* Merge two layers.
*/
void ED_gpencil_layer_merge(struct bGPdata *gpd,
struct bGPDlayer *gpl_src,
struct bGPDlayer *gpl_dst,
bool reverse);
void ED_gpencil_layer_merge(bGPdata *gpd, bGPDlayer *gpl_src, bGPDlayer *gpl_dst, bool reverse);
/**
* Set keyframe type for selected frames from given gp-layer
*
* \param type: The type of keyframe (#eBezTriple_KeyframeType) to set selected frames to.
*/
void ED_gpencil_layer_frames_keytype_set(struct bGPDlayer *gpl, short type);
void ED_gpencil_layer_frames_keytype_set(bGPDlayer *gpl, short type);
/**
* Snap selected frames to ....
*/
void ED_gpencil_layer_snap_frames(struct bGPDlayer *gpl, struct Scene *scene, short mode);
void ED_gpencil_layer_snap_frames(bGPDlayer *gpl, Scene *scene, short mode);
/**
* Mirror selected gp-frames on...
* TODO: mirror over a specific time.
*/
void ED_gpencil_layer_mirror_frames(struct bGPDlayer *gpl, struct Scene *scene, short mode);
void ED_gpencil_layer_mirror_frames(bGPDlayer *gpl, Scene *scene, short mode);
/**
* This function frees any MEM_calloc'ed copy/paste buffer data.
*/
void ED_gpencil_anim_copybuf_free(void);
void ED_gpencil_anim_copybuf_free();
/**
* This function adds data to the copy/paste buffer, freeing existing data first
* Only the selected GP-layers get their selected keyframes copied.
*
* Returns whether the copy operation was successful or not.
*/
bool ED_gpencil_anim_copybuf_copy(struct bAnimContext *ac);
bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac);
/**
* Pastes keyframes from buffer, and reports success.
*/
bool ED_gpencil_anim_copybuf_paste(struct bAnimContext *ac, short copy_mode);
bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, short copy_mode);
/* ------------ Grease-Pencil Undo System ------------------ */
int ED_gpencil_session_active(void);
int ED_gpencil_session_active();
/**
* \param step: eUndoStepDir.
*/
int ED_undo_gpencil_step(struct bContext *C, int step); /* eUndoStepDir. */
int ED_undo_gpencil_step(bContext *C, int step); /* eUndoStepDir. */
/* ------------ Grease-Pencil Armature ------------------ */
bool ED_gpencil_add_armature(const struct bContext *C,
struct ReportList *reports,
struct Object *ob,
struct Object *ob_arm);
bool ED_gpencil_add_armature_weights(const struct bContext *C,
struct ReportList *reports,
struct Object *ob,
struct Object *ob_arm,
int mode);
bool ED_gpencil_add_armature(const bContext *C, ReportList *reports, Object *ob, Object *ob_arm);
bool ED_gpencil_add_armature_weights(
const bContext *C, ReportList *reports, Object *ob, Object *ob_arm, int mode);
/**
* Add Lattice modifier using Parent operator.
* Parent GPencil object to Lattice.
*/
bool ED_gpencil_add_lattice_modifier(const struct bContext *C,
struct ReportList *reports,
struct Object *ob,
struct Object *ob_latt);
bool ED_gpencil_add_lattice_modifier(const bContext *C,
ReportList *reports,
Object *ob,
Object *ob_latt);
/* keep this aligned with gpencil_armature enum */
#define GP_PAR_ARMATURE_NAME 0
@@ -368,16 +346,14 @@ bool ED_gpencil_add_lattice_modifier(const struct bContext *C,
/**
* Reset parent matrix for all layers.
*/
void ED_gpencil_reset_layers_parent(struct Depsgraph *depsgraph,
struct Object *obact,
struct bGPdata *gpd);
void ED_gpencil_reset_layers_parent(Depsgraph *depsgraph, Object *obact, bGPdata *gpd);
/* Cursor utilities. */
/**
* Draw eraser cursor.
*/
void ED_gpencil_brush_draw_eraser(struct Brush *brush, int x, int y);
void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y);
/* ----------- Add Primitive Utilities -------------- */
@@ -390,7 +366,7 @@ void ED_gpencil_brush_draw_eraser(struct Brush *brush, int x, int y);
* \param totpoints: Total of points
* \param mat: 4x4 transform matrix to transform points into the right coordinate space.
*/
void ED_gpencil_stroke_init_data(struct bGPDstroke *gps,
void ED_gpencil_stroke_init_data(bGPDstroke *gps,
const float *array,
int totpoints,
const float mat[4][4]);
@@ -398,79 +374,75 @@ void ED_gpencil_stroke_init_data(struct bGPDstroke *gps,
/**
* Add a Simple empty object with one layer and one color.
*/
void ED_gpencil_create_blank(struct bContext *C, struct Object *ob, float mat[4][4]);
void ED_gpencil_create_blank(bContext *C, Object *ob, float mat[4][4]);
/**
* Add a 2D Suzanne.
*/
void ED_gpencil_create_monkey(struct bContext *C, struct Object *ob, float mat[4][4]);
void ED_gpencil_create_monkey(bContext *C, Object *ob, float mat[4][4]);
/**
* Add a Simple stroke with colors.
*/
void ED_gpencil_create_stroke(struct bContext *C, struct Object *ob, float mat[4][4]);
void ED_gpencil_create_stroke(bContext *C, Object *ob, float mat[4][4]);
/**
* Add a Simple LineArt setup.
*/
void ED_gpencil_create_lineart(struct bContext *C, struct Object *ob);
void ED_gpencil_create_lineart(bContext *C, Object *ob);
/* ------------ Object Utilities ------------ */
/**
* Helper function to create new #OB_GPENCIL_LEGACY Object.
*/
struct Object *ED_gpencil_add_object(struct bContext *C,
const float loc[3],
unsigned short local_view_bits);
Object *ED_gpencil_add_object(bContext *C, const float loc[3], unsigned short local_view_bits);
/**
* Helper function to create default colors and drawing brushes.
*/
void ED_gpencil_add_defaults(struct bContext *C, struct Object *ob);
void ED_gpencil_add_defaults(bContext *C, Object *ob);
/**
* Set object modes.
*/
void ED_gpencil_setup_modes(struct bContext *C, struct bGPdata *gpd, int newmode);
bool ED_object_gpencil_exit(struct Main *bmain, struct Object *ob);
void ED_gpencil_setup_modes(bContext *C, bGPdata *gpd, int newmode);
bool ED_object_gpencil_exit(Main *bmain, Object *ob);
/**
* Reproject all points of the stroke to a plane locked to axis to avoid stroke offset
*/
void ED_gpencil_project_stroke_to_plane(const struct Scene *scene,
const struct Object *ob,
const struct RegionView3D *rv3d,
struct bGPDlayer *gpl,
struct bGPDstroke *gps,
void ED_gpencil_project_stroke_to_plane(const Scene *scene,
const Object *ob,
const RegionView3D *rv3d,
bGPDlayer *gpl,
bGPDstroke *gps,
const float origin[3],
int axis);
/**
* Reproject given point to a plane locked to axis to avoid stroke offset
* \param pt: Point to affect (used for input & output).
*/
void ED_gpencil_project_point_to_plane(const struct Scene *scene,
const struct Object *ob,
struct bGPDlayer *gpl,
const struct RegionView3D *rv3d,
void ED_gpencil_project_point_to_plane(const Scene *scene,
const Object *ob,
bGPDlayer *gpl,
const RegionView3D *rv3d,
const float origin[3],
int axis,
struct bGPDspoint *pt);
bGPDspoint *pt);
/**
* Get drawing reference point for conversion or projection of the stroke
* \param r_vec: Reference point found
*/
void ED_gpencil_drawing_reference_get(const struct Scene *scene,
const struct Object *ob,
void ED_gpencil_drawing_reference_get(const Scene *scene,
const Object *ob,
char align_flag,
float r_vec[3]);
void ED_gpencil_project_stroke_to_view(struct bContext *C,
struct bGPDlayer *gpl,
struct bGPDstroke *gps);
void ED_gpencil_project_stroke_to_view(bContext *C, bGPDlayer *gpl, bGPDstroke *gps);
/**
* Reproject selected strokes.
*/
void ED_gpencil_stroke_reproject(struct Depsgraph *depsgraph,
const struct GP_SpaceConversion *gsc,
struct SnapObjectContext *sctx,
struct bGPDlayer *gpl,
struct bGPDframe *gpf,
struct bGPDstroke *gps,
void ED_gpencil_stroke_reproject(Depsgraph *depsgraph,
const GP_SpaceConversion *gsc,
SnapObjectContext *sctx,
bGPDlayer *gpl,
bGPDframe *gpf,
bGPDstroke *gps,
eGP_ReprojectModes mode,
bool keep_original,
const float offset);
@@ -478,47 +450,47 @@ void ED_gpencil_stroke_reproject(struct Depsgraph *depsgraph,
/**
* Turn brush cursor in on/off.
*/
void ED_gpencil_toggle_brush_cursor(struct bContext *C, bool enable, void *customdata);
void ED_gpencil_toggle_brush_cursor(bContext *C, bool enable, void *customdata);
/* vertex groups */
/**
* Assign points to vertex group.
*/
void ED_gpencil_vgroup_assign(struct bContext *C, struct Object *ob, float weight);
void ED_gpencil_vgroup_assign(bContext *C, Object *ob, float weight);
/**
* Remove points from vertex group.
*/
void ED_gpencil_vgroup_remove(struct bContext *C, struct Object *ob);
void ED_gpencil_vgroup_remove(bContext *C, Object *ob);
/**
* Select points of vertex group.
*/
void ED_gpencil_vgroup_select(struct bContext *C, struct Object *ob);
void ED_gpencil_vgroup_select(bContext *C, Object *ob);
/**
* Un-select points of vertex group.
*/
void ED_gpencil_vgroup_deselect(struct bContext *C, struct Object *ob);
void ED_gpencil_vgroup_deselect(bContext *C, Object *ob);
/* join objects */
/**
* Join objects called from OBJECT_OT_join.
*/
int ED_gpencil_join_objects_exec(struct bContext *C, struct wmOperator *op);
int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op);
/* texture coordinate utilities */
/**
* Convert 2d #tGPspoint to 3d #bGPDspoint.
*/
void ED_gpencil_tpoint_to_point(struct ARegion *region,
void ED_gpencil_tpoint_to_point(ARegion *region,
float origin[3],
const struct tGPspoint *tpt,
struct bGPDspoint *pt);
const tGPspoint *tpt,
bGPDspoint *pt);
/**
* Recalculate UV for any stroke using the material.
*/
void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat);
void ED_gpencil_update_color_uv(Main *bmain, Material *mat);
/**
* Extend selection to stroke intersections:
@@ -528,59 +500,57 @@ void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat);
* 2 - Hit in point B
* 3 - Hit in point A and B
*/
int ED_gpencil_select_stroke_segment(struct bGPdata *gpd,
struct bGPDlayer *gpl,
struct bGPDstroke *gps,
struct bGPDspoint *pt,
int ED_gpencil_select_stroke_segment(bGPdata *gpd,
bGPDlayer *gpl,
bGPDstroke *gps,
bGPDspoint *pt,
bool select,
bool insert,
float scale,
float r_hita[3],
float r_hitb[3]);
void ED_gpencil_select_toggle_all(struct bContext *C, int action);
void ED_gpencil_select_curve_toggle_all(struct bContext *C, int action);
void ED_gpencil_select_toggle_all(bContext *C, int action);
void ED_gpencil_select_curve_toggle_all(bContext *C, int action);
/**
* Ensure the #tGPspoint buffer (while drawing stroke)
* size is enough to save all points of the stroke.
*/
struct tGPspoint *ED_gpencil_sbuffer_ensure(struct tGPspoint *buffer_array,
int *buffer_size,
int *buffer_used,
bool clear);
void ED_gpencil_sbuffer_update_eval(struct bGPdata *gpd, struct Object *ob_eval);
tGPspoint *ED_gpencil_sbuffer_ensure(tGPspoint *buffer_array,
int *buffer_size,
int *buffer_used,
bool clear);
void ED_gpencil_sbuffer_update_eval(bGPdata *gpd, Object *ob_eval);
/**
* Tag all scene grease pencil object to update.
*/
void ED_gpencil_tag_scene_gpencil(struct Scene *scene);
void ED_gpencil_tag_scene_gpencil(Scene *scene);
/* Vertex color set. */
void ED_gpencil_fill_vertex_color_set(struct ToolSettings *ts,
struct Brush *brush,
struct bGPDstroke *gps);
void ED_gpencil_point_vertex_color_set(struct ToolSettings *ts,
struct Brush *brush,
struct bGPDspoint *pt,
struct tGPspoint *tpt);
void ED_gpencil_sbuffer_vertex_color_set(struct Depsgraph *depsgraph,
struct Object *ob,
struct ToolSettings *ts,
struct Brush *brush,
struct Material *material,
void ED_gpencil_fill_vertex_color_set(ToolSettings *ts, Brush *brush, bGPDstroke *gps);
void ED_gpencil_point_vertex_color_set(ToolSettings *ts,
Brush *brush,
bGPDspoint *pt,
tGPspoint *tpt);
void ED_gpencil_sbuffer_vertex_color_set(Depsgraph *depsgraph,
Object *ob,
ToolSettings *ts,
Brush *brush,
Material *material,
float random_color[3],
float pen_pressure);
void ED_gpencil_init_random_settings(struct Brush *brush,
void ED_gpencil_init_random_settings(Brush *brush,
const int mval[2],
struct GpRandomSettings *random_settings);
GpRandomSettings *random_settings);
/**
* Check if the stroke collides with brush.
*/
bool ED_gpencil_stroke_check_collision(const struct GP_SpaceConversion *gsc,
struct bGPDstroke *gps,
bool ED_gpencil_stroke_check_collision(const GP_SpaceConversion *gsc,
bGPDstroke *gps,
const float mval[2],
int radius,
const float diff_mat[4][4]);
@@ -593,56 +563,53 @@ bool ED_gpencil_stroke_check_collision(const struct GP_SpaceConversion *gsc,
* \param diff_mat: View matrix.
* \return True if the point is inside.
*/
bool ED_gpencil_stroke_point_is_inside(const struct bGPDstroke *gps,
const struct GP_SpaceConversion *gsc,
bool ED_gpencil_stroke_point_is_inside(const bGPDstroke *gps,
const GP_SpaceConversion *gsc,
const int mval[2],
const float diff_mat[4][4]);
/**
* Get the bigger 2D bound box points.
*/
void ED_gpencil_projected_2d_bound_box(const struct GP_SpaceConversion *gsc,
const struct bGPDstroke *gps,
void ED_gpencil_projected_2d_bound_box(const GP_SpaceConversion *gsc,
const bGPDstroke *gps,
const float diff_mat[4][4],
float r_min[2],
float r_max[2]);
struct bGPDstroke *ED_gpencil_stroke_nearest_to_ends(struct bContext *C,
const struct GP_SpaceConversion *gsc,
struct bGPDlayer *gpl,
struct bGPDframe *gpf,
struct bGPDstroke *gps,
const float ctrl1[2],
const float ctrl2[2],
float radius,
int *r_index);
bGPDstroke *ED_gpencil_stroke_nearest_to_ends(bContext *C,
const GP_SpaceConversion *gsc,
bGPDlayer *gpl,
bGPDframe *gpf,
bGPDstroke *gps,
const float ctrl1[2],
const float ctrl2[2],
float radius,
int *r_index);
/**
* Get extremes of stroke in 2D using current view.
*/
void ED_gpencil_stroke_extremes_to2d(const struct GP_SpaceConversion *gsc,
void ED_gpencil_stroke_extremes_to2d(const GP_SpaceConversion *gsc,
const float diff_mat[4][4],
struct bGPDstroke *gps,
bGPDstroke *gps,
float r_ctrl1[2],
float r_ctrl2[2]);
/**
* Join two stroke using a contact point index and trimming the rest.
*/
struct bGPDstroke *ED_gpencil_stroke_join_and_trim(struct bGPdata *gpd,
struct bGPDframe *gpf,
struct bGPDstroke *gps,
struct bGPDstroke *gps_dst,
int pt_index);
bGPDstroke *ED_gpencil_stroke_join_and_trim(
bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, bGPDstroke *gps_dst, int pt_index);
/**
* Close if the distance between extremes is below threshold.
*/
void ED_gpencil_stroke_close_by_distance(struct bGPDstroke *gps, float threshold);
void ED_gpencil_stroke_close_by_distance(bGPDstroke *gps, float threshold);
/**
* Calculate the brush cursor size in world space.
*/
float ED_gpencil_cursor_radius(struct bContext *C, int x, int y);
float ED_gpencil_radial_control_scale(struct bContext *C,
struct Brush *brush,
float ED_gpencil_cursor_radius(bContext *C, int x, int y);
float ED_gpencil_radial_control_scale(bContext *C,
Brush *brush,
float initial_value,
const int mval[2]);

View File

@@ -17,12 +17,9 @@
#include "ED_keyframes_edit.hh"
struct bContext;
struct Main;
struct Object;
struct KeyframeEditData;
struct wmKeyConfig;
enum {
@@ -34,17 +31,17 @@ enum {
/** \name C Wrappers
* \{ */
void ED_operatortypes_grease_pencil(void);
void ED_operatortypes_grease_pencil_draw(void);
void ED_operatortypes_grease_pencil_frames(void);
void ED_operatortypes_grease_pencil_layers(void);
void ED_operatortypes_grease_pencil_select(void);
void ED_operatortypes_grease_pencil_edit(void);
void ED_keymap_grease_pencil(struct wmKeyConfig *keyconf);
void ED_operatortypes_grease_pencil();
void ED_operatortypes_grease_pencil_draw();
void ED_operatortypes_grease_pencil_frames();
void ED_operatortypes_grease_pencil_layers();
void ED_operatortypes_grease_pencil_select();
void ED_operatortypes_grease_pencil_edit();
void ED_keymap_grease_pencil(wmKeyConfig *keyconf);
/**
* Get the selection mode for Grease Pencil selection operators: point, stroke, segment.
*/
eAttrDomain ED_grease_pencil_selection_domain_get(struct bContext *C);
eAttrDomain ED_grease_pencil_selection_domain_get(bContext *C);
/** \} */
@@ -64,7 +61,7 @@ bool select_frame_at(bke::greasepencil::Layer &layer,
void select_all_frames(bke::greasepencil::Layer &layer, const short select_mode);
void select_frames_region(struct KeyframeEditData *ked,
void select_frames_region(KeyframeEditData *ked,
bke::greasepencil::Layer &layer,
const short tool,
const short select_mode);

View File

@@ -27,8 +27,8 @@ struct wmWindowManager;
/* `image_draw.cc` */
float ED_space_image_zoom_level(const struct View2D *v2d, int grid_dimension);
void ED_space_image_grid_steps(struct SpaceImage *sima,
float ED_space_image_zoom_level(const View2D *v2d, int grid_dimension);
void ED_space_image_grid_steps(SpaceImage *sima,
float grid_steps_x[SI_GRID_STEPS_LEN],
float grid_steps_y[SI_GRID_STEPS_LEN],
int grid_dimension);
@@ -43,51 +43,42 @@ float ED_space_image_increment_snap_value(int grid_dimensions,
/* `image_edit.cc`, exported for transform. */
struct Image *ED_space_image(const struct SpaceImage *sima);
void ED_space_image_set(struct Main *bmain,
struct SpaceImage *sima,
struct Image *ima,
bool automatic);
void ED_space_image_sync(struct Main *bmain, Image *image, bool ignore_render_viewer);
void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima);
struct Mask *ED_space_image_get_mask(const struct SpaceImage *sima);
void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask);
Image *ED_space_image(const SpaceImage *sima);
void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic);
void ED_space_image_sync(Main *bmain, Image *image, bool ignore_render_viewer);
void ED_space_image_auto_set(const bContext *C, SpaceImage *sima);
Mask *ED_space_image_get_mask(const SpaceImage *sima);
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask);
/**
* Returns mouse position in image space.
*/
bool ED_space_image_get_position(struct SpaceImage *sima,
struct ARegion *region,
int mval[2],
float fpos[2]);
bool ED_space_image_get_position(SpaceImage *sima, ARegion *region, int mval[2], float fpos[2]);
/**
* Returns color in linear space, matching #ED_space_node_color_sample().
*/
bool ED_space_image_color_sample(struct SpaceImage *sima,
struct ARegion *region,
const int mval[2],
float r_col[3],
bool *r_is_data);
struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile);
bool ED_space_image_color_sample(
SpaceImage *sima, ARegion *region, const int mval[2], float r_col[3], bool *r_is_data);
ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile);
/**
* Get the #SpaceImage flag that is valid for the given ibuf.
*/
int ED_space_image_get_display_channel_mask(struct ImBuf *ibuf);
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock);
bool ED_space_image_has_buffer(struct SpaceImage *sima);
int ED_space_image_get_display_channel_mask(ImBuf *ibuf);
void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock);
bool ED_space_image_has_buffer(SpaceImage *sima);
void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height);
void ED_space_image_get_size_fl(struct SpaceImage *sima, float r_size[2]);
void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy);
void ED_space_image_get_zoom(struct SpaceImage *sima,
const struct ARegion *region,
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height);
void ED_space_image_get_size_fl(SpaceImage *sima, float r_size[2]);
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy);
void ED_space_image_get_zoom(SpaceImage *sima,
const ARegion *region,
float *r_zoomx,
float *r_zoomy);
void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy);
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy);
void ED_space_image_scopes_update(const struct bContext *C,
struct SpaceImage *sima,
struct ImBuf *ibuf,
void ED_space_image_scopes_update(const bContext *C,
SpaceImage *sima,
ImBuf *ibuf,
bool use_view_settings);
/**
@@ -96,46 +87,34 @@ void ED_space_image_scopes_update(const struct bContext *C,
* purpose is to make sure the paint cursor is shown if paint mode is enabled in the image editor.
* The paint poll will ensure that the cursor is hidden when not in paint mode.
*/
void ED_space_image_paint_update(struct Main *bmain,
struct wmWindowManager *wm,
struct Scene *scene);
void ED_space_image_paint_update(Main *bmain, wmWindowManager *wm, Scene *scene);
void ED_image_get_uv_aspect(struct Image *ima,
struct ImageUser *iuser,
float *r_aspx,
float *r_aspy);
void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy);
/** Takes `event->mval`. */
void ED_image_mouse_pos(struct SpaceImage *sima,
const struct ARegion *region,
const int mval[2],
float co[2]);
void ED_image_view_center_to_point(struct SpaceImage *sima, float x, float y);
void ED_image_point_pos(struct SpaceImage *sima,
const struct ARegion *region,
float x,
float y,
float *r_x,
float *r_y);
void ED_image_point_pos__reverse(struct SpaceImage *sima,
const struct ARegion *region,
void ED_image_mouse_pos(SpaceImage *sima, const ARegion *region, const int mval[2], float co[2]);
void ED_image_view_center_to_point(SpaceImage *sima, float x, float y);
void ED_image_point_pos(
SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y);
void ED_image_point_pos__reverse(SpaceImage *sima,
const ARegion *region,
const float co[2],
float r_co[2]);
/**
* This is more a user-level functionality, for going to `next/prev` used slot,
* Stepping onto the last unused slot too.
*/
bool ED_image_slot_cycle(struct Image *image, int direction);
bool ED_image_slot_cycle(Image *image, int direction);
bool ED_space_image_show_render(const struct SpaceImage *sima);
bool ED_space_image_show_paint(const struct SpaceImage *sima);
bool ED_space_image_show_uvedit(const struct SpaceImage *sima, struct Object *obedit);
bool ED_space_image_show_render(const SpaceImage *sima);
bool ED_space_image_show_paint(const SpaceImage *sima);
bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit);
bool ED_space_image_paint_curve(const struct bContext *C);
bool ED_space_image_paint_curve(const bContext *C);
/**
* Matches clip function.
*/
bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit);
bool ED_space_image_check_show_maskedit(SpaceImage *sima, Object *obedit);
/* Returns true when the following conditions are met:
* - Current space is Image Editor.
@@ -143,7 +122,7 @@ bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *
* - It is set to Mask mode.
*
* It is not required to have mask opened for editing. */
bool ED_space_image_maskedit_poll(struct bContext *C);
bool ED_space_image_maskedit_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Image Editor.
@@ -152,14 +131,14 @@ bool ED_space_image_maskedit_poll(struct bContext *C);
* - Mask has visible and editable splines.
*
* It is not required to have mask opened for editing. */
bool ED_space_image_maskedit_visible_splines_poll(struct bContext *C);
bool ED_space_image_maskedit_visible_splines_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Image Editor.
* - The image editor is not an UV Editor.
* - It is set to Mask mode.
* - The space has mask opened. */
bool ED_space_image_maskedit_mask_poll(struct bContext *C);
bool ED_space_image_maskedit_mask_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space is Image Editor.
@@ -167,15 +146,15 @@ bool ED_space_image_maskedit_mask_poll(struct bContext *C);
* - It is set to Mask mode.
* - The space has mask opened.
* - Mask has visible and editable splines. */
bool ED_space_image_maskedit_mask_visible_splines_poll(struct bContext *C);
bool ED_space_image_maskedit_mask_visible_splines_poll(bContext *C);
bool ED_space_image_cursor_poll(struct bContext *C);
bool ED_space_image_cursor_poll(bContext *C);
/**
* Used by node view too.
*/
void ED_image_draw_info(struct Scene *scene,
struct ARegion *region,
void ED_image_draw_info(Scene *scene,
ARegion *region,
bool color_manage,
bool use_default_view,
int channels,
@@ -185,19 +164,19 @@ void ED_image_draw_info(struct Scene *scene,
const float fp[4],
const float linearcol[4]);
bool ED_space_image_show_cache(const struct SpaceImage *sima);
bool ED_space_image_show_cache_and_mval_over(const struct SpaceImage *sima,
struct ARegion *region,
bool ED_space_image_show_cache(const SpaceImage *sima);
bool ED_space_image_show_cache_and_mval_over(const SpaceImage *sima,
ARegion *region,
const int mval[2]);
bool ED_image_should_save_modified(const struct Main *bmain);
int ED_image_save_all_modified_info(const struct Main *bmain, struct ReportList *reports);
bool ED_image_save_all_modified(const struct bContext *C, struct ReportList *reports);
bool ED_image_should_save_modified(const Main *bmain);
int ED_image_save_all_modified_info(const Main *bmain, ReportList *reports);
bool ED_image_save_all_modified(const bContext *C, ReportList *reports);
/* `image_sequence.cc` */
typedef struct ImageFrameRange {
struct ImageFrameRange *next, *prev;
struct ImageFrameRange {
ImageFrameRange *next, *prev;
/** Absolute file path of the first file in the range. */
char filepath[FILE_MAX];
@@ -210,14 +189,12 @@ typedef struct ImageFrameRange {
/* Temporary data. */
ListBase frames;
} ImageFrameRange;
};
/**
* Used for both images and volume file loading.
*/
ListBase ED_image_filesel_detect_sequences(struct Main *bmain,
struct wmOperator *op,
bool detect_udim);
ListBase ED_image_filesel_detect_sequences(Main *bmain, wmOperator *op, bool detect_udim);
bool ED_image_tools_paint_poll(struct bContext *C);
void ED_paint_cursor_start(struct Paint *p, bool (*poll)(struct bContext *C));
bool ED_image_tools_paint_poll(bContext *C);
void ED_paint_cursor_start(Paint *p, bool (*poll)(bContext *C));

View File

@@ -13,28 +13,24 @@ struct wmWindowManager;
/* `info_stats.cc` */
void ED_info_stats_clear(struct wmWindowManager *wm, struct ViewLayer *view_layer);
const char *ED_info_statusbar_string_ex(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
void ED_info_stats_clear(wmWindowManager *wm, ViewLayer *view_layer);
const char *ED_info_statusbar_string_ex(Main *bmain,
Scene *scene,
ViewLayer *view_layer,
const char statusbar_flag);
const char *ED_info_statusbar_string(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer);
const char *ED_info_statusbar_string(Main *bmain, Scene *scene, ViewLayer *view_layer);
const char *ED_info_statistics_string(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer);
const char *ED_info_statistics_string(Main *bmain, Scene *scene, ViewLayer *view_layer);
/**
* \param v3d_local: Pass this argument to calculate view-port local statistics.
* Note that this must only be used for local-view, otherwise report specific statistics
* will be written into the global scene statistics giving incorrect results.
*/
void ED_info_draw_stats(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
struct View3D *v3d_local,
void ED_info_draw_stats(Main *bmain,
Scene *scene,
ViewLayer *view_layer,
View3D *v3d_local,
int x,
int *y,
int height);

View File

@@ -27,13 +27,13 @@ struct GreasePencilLayer;
/* draw simple diamond-shape keyframe */
/* caller should set up vertex format, bind GPU_SHADER_KEYFRAME_SHAPE,
* immBegin(GPU_PRIM_POINTS, n), then call this n times */
typedef struct KeyframeShaderBindings {
struct KeyframeShaderBindings {
uint pos_id;
uint size_id;
uint color_id;
uint outline_color_id;
uint flags_id;
} KeyframeShaderBindings;
};
void draw_keyframe_shape(float x,
float y,
@@ -50,70 +50,70 @@ void draw_keyframe_shape(float x,
/* Channel Drawing ------------------ */
/* F-Curve */
void draw_fcurve_channel(struct AnimKeylistDrawList *draw_list,
struct AnimData *adt,
struct FCurve *fcu,
void draw_fcurve_channel(AnimKeylistDrawList *draw_list,
AnimData *adt,
FCurve *fcu,
float ypos,
float yscale_fac,
int saction_flag);
/* Action Group Summary */
void draw_agroup_channel(struct AnimKeylistDrawList *draw_list,
struct AnimData *adt,
struct bActionGroup *agrp,
void draw_agroup_channel(AnimKeylistDrawList *draw_list,
AnimData *adt,
bActionGroup *agrp,
float ypos,
float yscale_fac,
int saction_flag);
/* Action Summary */
void draw_action_channel(struct AnimKeylistDrawList *draw_list,
struct AnimData *adt,
struct bAction *act,
void draw_action_channel(AnimKeylistDrawList *draw_list,
AnimData *adt,
bAction *act,
float ypos,
float yscale_fac,
int saction_flag);
/* Object Summary */
void draw_object_channel(struct AnimKeylistDrawList *draw_list,
struct bDopeSheet *ads,
struct Object *ob,
void draw_object_channel(AnimKeylistDrawList *draw_list,
bDopeSheet *ads,
Object *ob,
float ypos,
float yscale_fac,
int saction_flag);
/* Scene Summary */
void draw_scene_channel(struct AnimKeylistDrawList *draw_list,
struct bDopeSheet *ads,
struct Scene *sce,
void draw_scene_channel(AnimKeylistDrawList *draw_list,
bDopeSheet *ads,
Scene *sce,
float ypos,
float yscale_fac,
int saction_flag);
/* DopeSheet Summary */
void draw_summary_channel(struct AnimKeylistDrawList *draw_list,
struct bAnimContext *ac,
void draw_summary_channel(AnimKeylistDrawList *draw_list,
bAnimContext *ac,
float ypos,
float yscale_fac,
int saction_flag);
/* Grease Pencil cels channels */
void draw_grease_pencil_cels_channel(struct AnimKeylistDrawList *draw_list,
struct bDopeSheet *ads,
struct GreasePencilLayer *layer,
void draw_grease_pencil_cels_channel(AnimKeylistDrawList *draw_list,
bDopeSheet *ads,
GreasePencilLayer *layer,
float ypos,
float yscale_fac,
int saction_flag);
/* Grease Pencil Layer */
void draw_gpl_channel(struct AnimKeylistDrawList *draw_list,
struct bDopeSheet *ads,
struct bGPDlayer *gpl,
void draw_gpl_channel(AnimKeylistDrawList *draw_list,
bDopeSheet *ads,
bGPDlayer *gpl,
float ypos,
float yscale_fac,
int saction_flag);
/* Mask Layer */
void draw_masklay_channel(struct AnimKeylistDrawList *draw_list,
struct bDopeSheet *ads,
struct MaskLayer *masklay,
void draw_masklay_channel(AnimKeylistDrawList *draw_list,
bDopeSheet *ads,
MaskLayer *masklay,
float ypos,
float yscale_fac,
int saction_flag);
struct AnimKeylistDrawList *ED_keylist_draw_list_create(void);
void ED_keylist_draw_list_flush(struct AnimKeylistDrawList *draw_list, struct View2D *v2d);
void ED_keylist_draw_list_free(struct AnimKeylistDrawList *draw_list);
AnimKeylistDrawList *ED_keylist_draw_list_create(void);
void ED_keylist_draw_list_flush(AnimKeylistDrawList *draw_list, View2D *v2d);
void ED_keylist_draw_list_free(AnimKeylistDrawList *draw_list);

View File

@@ -26,7 +26,7 @@ struct bDopeSheet;
* \{ */
/* bezt validation */
typedef enum eEditKeyframes_Validate {
enum eEditKeyframes_Validate {
/* Frame range */
BEZT_OK_FRAME = 1,
BEZT_OK_FRAMERANGE,
@@ -42,12 +42,12 @@ typedef enum eEditKeyframes_Validate {
/* Only for keyframes a certain Dopesheet channel */
BEZT_OK_CHANNEL_LASSO,
BEZT_OK_CHANNEL_CIRCLE,
} eEditKeyframes_Validate;
};
/** \} */
/* select modes */
typedef enum eEditKeyframes_Select {
enum eEditKeyframes_Select {
/* SELECT_SUBTRACT for all, followed by SELECT_ADD for some */
SELECT_REPLACE = (1 << 0),
/* add ok keyframes to selection */
@@ -57,16 +57,16 @@ typedef enum eEditKeyframes_Select {
/* flip ok status of keyframes based on key status */
SELECT_INVERT = (1 << 3),
SELECT_EXTEND_RANGE = (1 << 4),
} eEditKeyframes_Select;
};
/* "selection map" building modes */
typedef enum eEditKeyframes_SelMap {
enum eEditKeyframes_SelMap {
SELMAP_MORE = 0,
SELMAP_LESS,
} eEditKeyframes_SelMap;
};
/* snapping tools */
typedef enum eEditKeyframes_Snap {
enum eEditKeyframes_Snap {
SNAP_KEYS_CURFRAME = 1,
SNAP_KEYS_NEARFRAME,
SNAP_KEYS_NEARSEC,
@@ -74,40 +74,40 @@ typedef enum eEditKeyframes_Snap {
SNAP_KEYS_HORIZONTAL,
SNAP_KEYS_VALUE,
SNAP_KEYS_TIME,
} eEditKeyframes_Snap;
};
/* equalizing tools */
typedef enum eEditKeyframes_Equalize {
enum eEditKeyframes_Equalize {
EQUALIZE_HANDLES_LEFT = (1 << 0),
EQUALIZE_HANDLES_RIGHT = (1 << 1),
EQUALIZE_HANDLES_BOTH = (EQUALIZE_HANDLES_LEFT | EQUALIZE_HANDLES_RIGHT),
} eEditKeyframes_Equalize;
};
/* mirroring tools */
typedef enum eEditKeyframes_Mirror {
enum eEditKeyframes_Mirror {
MIRROR_KEYS_CURFRAME = 1,
MIRROR_KEYS_YAXIS,
MIRROR_KEYS_XAXIS,
MIRROR_KEYS_MARKER,
MIRROR_KEYS_VALUE,
MIRROR_KEYS_TIME,
} eEditKeyframes_Mirror;
};
/* use with BEZT_OK_REGION_LASSO */
typedef struct KeyframeEdit_LassoData {
struct KeyframeEdit_LassoData {
rctf *rectf_scaled;
const rctf *rectf_view;
const int (*mcoords)[2];
int mcoords_len;
} KeyframeEdit_LassoData;
};
/* use with BEZT_OK_REGION_CIRCLE */
typedef struct KeyframeEdit_CircleData {
struct KeyframeEdit_CircleData {
rctf *rectf_scaled;
const rctf *rectf_view;
float mval[2];
float radius_squared;
} KeyframeEdit_CircleData;
};
/* ************************************************ */
/* Non-Destructive Editing API (keyframes_edit.cc) */
@@ -117,7 +117,7 @@ typedef struct KeyframeEdit_CircleData {
* \{ */
/* which verts of a keyframe is active (after polling) */
typedef enum eKeyframeVertOk {
enum eKeyframeVertOk {
KEYFRAME_NONE = 0,
/* 'key' itself is ok */
KEYFRAME_OK_KEY = (1 << 0),
@@ -127,10 +127,10 @@ typedef enum eKeyframeVertOk {
KEYFRAME_OK_H2 = (1 << 2),
/* all flags */
KEYFRAME_OK_ALL = (KEYFRAME_OK_KEY | KEYFRAME_OK_H1 | KEYFRAME_OK_H2),
} eKeyframeVertOk;
};
/* Flags for use during iteration */
typedef enum eKeyframeIterFlags {
enum eKeyframeIterFlags {
/* consider handles in addition to key itself */
KEYFRAME_ITER_INCL_HANDLES = (1 << 0),
@@ -147,7 +147,7 @@ typedef enum eKeyframeIterFlags {
* or their control point is selected. The selection state will have to be checked in the
* iterator callbacks then. */
KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE = (1 << 3),
} eKeyframeIterFlags;
};
ENUM_OPERATORS(eKeyframeIterFlags, KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE)
/** \} */
@@ -160,13 +160,13 @@ ENUM_OPERATORS(eKeyframeIterFlags, KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE)
* Temporary struct used to store frame time and selection status.
* Used for example by `columnselect_action_keys` to select all keyframes in a column.
*/
typedef struct CfraElem {
struct CfraElem {
struct CfraElem *next, *prev;
float cfra;
int sel;
} CfraElem;
};
typedef struct KeyframeEditData {
struct KeyframeEditData {
/* generic properties/data access */
/** temp list for storing custom list of data to check */
ListBase list;
@@ -192,7 +192,7 @@ typedef struct KeyframeEditData {
eKeyframeVertOk curflags;
/** settings for iteration process */
eKeyframeIterFlags iterflags;
} KeyframeEditData;
};
/** \} */
@@ -201,9 +201,9 @@ typedef struct KeyframeEditData {
* \{ */
/* callback function that refreshes the F-Curve after use */
typedef void (*FcuEditFunc)(struct FCurve *fcu);
using FcuEditFunc = void (*)(struct FCurve *fcu);
/* callback function that operates on the given BezTriple */
typedef short (*KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt);
using KeyframeEditFunc = short (*)(KeyframeEditData *ked, struct BezTriple *bezt);
/** \} */
@@ -212,13 +212,13 @@ typedef short (*KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt)
* \{ */
/* Custom data for remapping one range to another in a fixed way */
typedef struct KeyframeEditCD_Remap {
struct KeyframeEditCD_Remap {
float oldMin, oldMax; /* old range */
float newMin, newMax; /* new range */
} KeyframeEditCD_Remap;
};
/* Paste options */
typedef enum eKeyPasteOffset {
enum eKeyPasteOffset {
/* paste keys starting at current frame */
KEYFRAME_PASTE_OFFSET_CFRA_START,
/* paste keys ending at current frame */
@@ -227,9 +227,9 @@ typedef enum eKeyPasteOffset {
KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE,
/* paste keys from original time */
KEYFRAME_PASTE_OFFSET_NONE,
} eKeyPasteOffset;
};
typedef enum eKeyPasteValueOffset {
enum eKeyPasteValueOffset {
/* Paste keys with the first key matching the key left of the cursor. */
KEYFRAME_PASTE_VALUE_OFFSET_LEFT_KEY,
/* Paste keys with the last key matching the key right of the cursor. */
@@ -240,9 +240,9 @@ typedef enum eKeyPasteValueOffset {
KEYFRAME_PASTE_VALUE_OFFSET_CURSOR,
/* Paste keys with the exact copied value. */
KEYFRAME_PASTE_VALUE_OFFSET_NONE,
} eKeyPasteValueOffset;
};
typedef enum eKeyMergeMode {
enum eKeyMergeMode {
/* overlay existing with new keys */
KEYFRAME_PASTE_MERGE_MIX,
/* replace entire fcurve */
@@ -251,17 +251,17 @@ typedef enum eKeyMergeMode {
KEYFRAME_PASTE_MERGE_OVER_RANGE,
/* overwrite keys in pasted range (use all keyframe start & end for range) */
KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL,
} eKeyMergeMode;
};
/* Possible errors occurring while pasting keys. */
typedef enum eKeyPasteError {
enum eKeyPasteError {
/* No errors occurred */
KEYFRAME_PASTE_OK,
/* Nothing was copied */
KEYFRAME_PASTE_NOTHING_TO_PASTE,
/* No F-curves was selected to paste into. */
KEYFRAME_PASTE_NOWHERE_TO_PASTE
} eKeyPasteError;
};
/** \} */
@@ -279,7 +279,7 @@ typedef enum eKeyPasteError {
* (i.e. when filters have been chosen to explicitly use this).
*/
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked,
struct FCurve *fcu,
FCurve *fcu,
KeyframeEditFunc key_ok,
KeyframeEditFunc key_cb,
FcuEditFunc fcu_cb);
@@ -290,7 +290,7 @@ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked,
* \param flatten: Makes the keyframes' handles the same value as the keyframe,
* flattening the curve at that point.
*/
void ANIM_fcurve_equalize_keyframes_loop(struct FCurve *fcu,
void ANIM_fcurve_equalize_keyframes_loop(FCurve *fcu,
eEditKeyframes_Equalize mode,
float handle_length,
bool flatten);
@@ -299,8 +299,8 @@ void ANIM_fcurve_equalize_keyframes_loop(struct FCurve *fcu,
* Function for working with any type (i.e. one of the known types) of animation channel.
*/
short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked,
struct bDopeSheet *ads,
struct bAnimListElem *ale,
bDopeSheet *ads,
bAnimListElem *ale,
KeyframeEditFunc key_ok,
KeyframeEditFunc key_cb,
FcuEditFunc fcu_cb);
@@ -309,7 +309,7 @@ short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked,
* \param keytype: is #eAnim_KeyType.
*/
short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked,
struct bDopeSheet *ads,
bDopeSheet *ads,
void *data,
int keytype,
KeyframeEditFunc key_ok,
@@ -320,14 +320,14 @@ short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked,
* Calls callback_fn() for each keyframe in each fcurve in the filtered animation context.
* Assumes the callback updates keys.
*/
void ANIM_animdata_keyframe_callback(struct bAnimContext *ac,
void ANIM_animdata_keyframe_callback(bAnimContext *ac,
eAnimFilter_Flags filter,
KeyframeEditFunc callback_fn);
/**
* Functions for making sure all keyframes are in good order.
*/
void ANIM_editkeyframes_refresh(struct bAnimContext *ac);
void ANIM_editkeyframes_refresh(bAnimContext *ac);
/** \} */
@@ -372,7 +372,7 @@ KeyframeEditFunc ANIM_editkeyframes_buildselmap(short mode);
* Change the selection status of the keyframe based on the map entry for this vert
* requires: `ked->custom = char[]` of length `fcurve->totvert`.
*/
short bezt_selmap_flush(KeyframeEditData *ked, struct BezTriple *bezt);
short bezt_selmap_flush(KeyframeEditData *ked, BezTriple *bezt);
/** \} */
@@ -383,18 +383,18 @@ short bezt_selmap_flush(KeyframeEditData *ked, struct BezTriple *bezt);
/**
* Used to calculate the average location of all relevant BezTriples by summing their locations.
*/
short bezt_calc_average(KeyframeEditData *ked, struct BezTriple *bezt);
short bezt_calc_average(KeyframeEditData *ked, BezTriple *bezt);
/**
* Used to extract a set of cfra-elems from the keyframes.
*/
short bezt_to_cfraelem(KeyframeEditData *ked, struct BezTriple *bezt);
short bezt_to_cfraelem(KeyframeEditData *ked, BezTriple *bezt);
/**
* Used to remap times from one range to another.
* requires: `ked->custom = KeyframeEditCD_Remap`.
*/
void bezt_remap_times(KeyframeEditData *ked, struct BezTriple *bezt);
void bezt_remap_times(KeyframeEditData *ked, BezTriple *bezt);
/** \} */
@@ -412,13 +412,13 @@ bool keyframe_region_circle_test(const KeyframeEdit_CircleData *data_circle, con
/* ************************************************ */
/* Destructive Editing API `keyframes_general.cc`. */
bool duplicate_fcurve_keys(struct FCurve *fcu);
float get_default_rna_value(struct FCurve *fcu, struct PropertyRNA *prop, struct PointerRNA *ptr);
bool duplicate_fcurve_keys(FCurve *fcu);
float get_default_rna_value(FCurve *fcu, PropertyRNA *prop, PointerRNA *ptr);
typedef struct FCurveSegment {
struct FCurveSegment *next, *prev;
struct FCurveSegment {
FCurveSegment *next, *prev;
int start_index, length;
} FCurveSegment;
};
/**
* Return a list of #FCurveSegment with a start index and a length.
@@ -426,15 +426,10 @@ typedef struct FCurveSegment {
* Keys that have BEZT_FLAG_IGNORE_TAG set are treated as unselected.
* The caller is responsible for freeing the memory.
*/
ListBase find_fcurve_segments(struct FCurve *fcu);
void clean_fcurve(struct bAnimContext *ac,
struct bAnimListElem *ale,
float thresh,
bool cleardefault);
void blend_to_neighbor_fcurve_segment(struct FCurve *fcu,
struct FCurveSegment *segment,
float factor);
void breakdown_fcurve_segment(struct FCurve *fcu, struct FCurveSegment *segment, float factor);
ListBase find_fcurve_segments(FCurve *fcu);
void clean_fcurve(bAnimContext *ac, bAnimListElem *ale, float thresh, bool cleardefault);
void blend_to_neighbor_fcurve_segment(FCurve *fcu, FCurveSegment *segment, float factor);
void breakdown_fcurve_segment(FCurve *fcu, FCurveSegment *segment, float factor);
/**
* Get a 1D gauss kernel. Since the kernel is symmetrical, only calculates the positive side.
@@ -443,48 +438,48 @@ void breakdown_fcurve_segment(struct FCurve *fcu, struct FCurveSegment *segment,
*/
void ED_ANIM_get_1d_gauss_kernel(const float sigma, int kernel_size, double *r_kernel);
struct ButterworthCoefficients *ED_anim_allocate_butterworth_coefficients(const int filter_order);
void ED_anim_free_butterworth_coefficients(struct ButterworthCoefficients *bw_coeff);
ButterworthCoefficients *ED_anim_allocate_butterworth_coefficients(const int filter_order);
void ED_anim_free_butterworth_coefficients(ButterworthCoefficients *bw_coeff);
void ED_anim_calculate_butterworth_coefficients(float cutoff,
float sampling_frequency,
struct ButterworthCoefficients *bw_coeff);
void butterworth_smooth_fcurve_segment(struct FCurve *fcu,
struct FCurveSegment *segment,
ButterworthCoefficients *bw_coeff);
void butterworth_smooth_fcurve_segment(FCurve *fcu,
FCurveSegment *segment,
float *samples,
int sample_count,
float factor,
int blend_in_out,
int sample_rate,
struct ButterworthCoefficients *bw_coeff);
void smooth_fcurve_segment(struct FCurve *fcu,
struct FCurveSegment *segment,
ButterworthCoefficients *bw_coeff);
void smooth_fcurve_segment(FCurve *fcu,
FCurveSegment *segment,
float *samples,
float factor,
int kernel_size,
double *kernel);
void ease_fcurve_segment(struct FCurve *fcu, struct FCurveSegment *segment, float factor);
bool decimate_fcurve(struct bAnimListElem *ale, float remove_ratio, float error_sq_max);
void ease_fcurve_segment(FCurve *fcu, FCurveSegment *segment, float factor);
bool decimate_fcurve(bAnimListElem *ale, float remove_ratio, float error_sq_max);
/**
* Blends the selected keyframes to the default value of the property the F-curve drives.
*/
void blend_to_default_fcurve(struct PointerRNA *id_ptr, struct FCurve *fcu, float factor);
void blend_to_default_fcurve(PointerRNA *id_ptr, FCurve *fcu, float factor);
/**
* Use a weighted moving-means method to reduce intensity of fluctuations.
*/
void smooth_fcurve(struct FCurve *fcu);
void sample_fcurve(struct FCurve *fcu);
void smooth_fcurve(FCurve *fcu);
void sample_fcurve(FCurve *fcu);
/**
* \param sample_rate: indicates how many samples per frame should be generated.
*/
void sample_fcurve_segment(
struct FCurve *fcu, float start_frame, int sample_rate, float *r_samples, int sample_count);
FCurve *fcu, float start_frame, int sample_rate, float *r_samples, int sample_count);
/* ----------- */
void ANIM_fcurves_copybuf_free(void);
short copy_animedit_keys(struct bAnimContext *ac, ListBase *anim_data);
eKeyPasteError paste_animedit_keys(struct bAnimContext *ac,
void ANIM_fcurves_copybuf_free();
short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data);
eKeyPasteError paste_animedit_keys(bAnimContext *ac,
ListBase *anim_data,
eKeyPasteOffset offset_mode,
eKeyPasteValueOffset value_offset_mode,

View File

@@ -26,7 +26,7 @@ struct GreasePencilLayer;
struct AnimKeylist;
/* Information about the stretch of time from current to the next column */
typedef struct ActKeyBlockInfo {
struct ActKeyBlockInfo {
/* Combination of flags from all curves. */
short flag;
/* Mask of flags that differ between curves. */
@@ -34,18 +34,18 @@ typedef struct ActKeyBlockInfo {
/* Selection flag. */
char sel;
} ActKeyBlockInfo;
};
/* Keyframe Column Struct */
typedef struct ActKeyColumn {
struct ActKeyColumn {
/* ListBase linkage */
struct ActKeyColumn *next, *prev;
ActKeyColumn *next, *prev;
/* sorting-tree linkage */
/** 'children' of this node, less than and greater than it (respectively) */
struct ActKeyColumn *left, *right;
ActKeyColumn *left, *right;
/** parent of this node in the tree */
struct ActKeyColumn *parent;
ActKeyColumn *parent;
/** DLRB_BLACK or DLRB_RED */
char tree_col;
@@ -64,10 +64,10 @@ typedef struct ActKeyColumn {
/* number of curves and keys in this column */
short totcurve, totkey, totblock;
} ActKeyColumn;
};
/* ActKeyBlockInfo - Flag */
typedef enum eActKeyBlock_Hold {
enum eActKeyBlock_Hold {
/* Key block represents a moving hold */
ACTKEYBLOCK_FLAG_MOVING_HOLD = (1 << 0),
/* Key block represents a static hold */
@@ -78,22 +78,22 @@ typedef enum eActKeyBlock_Hold {
ACTKEYBLOCK_FLAG_NON_BEZIER = (1 << 3),
/* The block is grease pencil */
ACTKEYBLOCK_FLAG_GPENCIL = (1 << 4),
} eActKeyBlock_Flag;
};
/* *********************** Keyframe Drawing ****************************** */
/* options for keyframe shape drawing */
typedef enum eKeyframeShapeDrawOpts {
enum eKeyframeShapeDrawOpts {
/* only the border */
KEYFRAME_SHAPE_FRAME = 0,
/* only the inside filling */
KEYFRAME_SHAPE_INSIDE,
/* the whole thing */
KEYFRAME_SHAPE_BOTH,
} eKeyframeShapeDrawOpts;
};
/* Handle type. */
typedef enum eKeyframeHandleDrawOpts {
enum eKeyframeHandleDrawOpts {
/* Don't draw */
KEYFRAME_HANDLE_NONE = 0,
/* Various marks in order of increasing display priority. */
@@ -102,10 +102,10 @@ typedef enum eKeyframeHandleDrawOpts {
KEYFRAME_HANDLE_VECTOR,
KEYFRAME_HANDLE_ALIGNED,
KEYFRAME_HANDLE_FREE,
} eKeyframeHandleDrawOpts;
};
/* Extreme type. */
typedef enum eKeyframeExtremeDrawOpts {
enum eKeyframeExtremeDrawOpts {
KEYFRAME_EXTREME_NONE = 0,
/* Minimum/maximum present. */
KEYFRAME_EXTREME_MIN = (1 << 0),
@@ -114,80 +114,59 @@ typedef enum eKeyframeExtremeDrawOpts {
KEYFRAME_EXTREME_MIXED = (1 << 2),
/* Both neighbors are equal to this key. */
KEYFRAME_EXTREME_FLAT = (1 << 3),
} eKeyframeExtremeDrawOpts;
};
/* ******************************* Methods ****************************** */
struct AnimKeylist *ED_keylist_create(void);
void ED_keylist_free(struct AnimKeylist *keylist);
void ED_keylist_prepare_for_direct_access(struct AnimKeylist *keylist);
const struct ActKeyColumn *ED_keylist_find_exact(const struct AnimKeylist *keylist, float cfra);
const struct ActKeyColumn *ED_keylist_find_next(const struct AnimKeylist *keylist, float cfra);
const struct ActKeyColumn *ED_keylist_find_prev(const struct AnimKeylist *keylist, float cfra);
const struct ActKeyColumn *ED_keylist_find_any_between(const struct AnimKeylist *keylist,
const Range2f frame_range);
bool ED_keylist_is_empty(const struct AnimKeylist *keylist);
const struct ListBase /* ActKeyColumn */ *ED_keylist_listbase(const struct AnimKeylist *keylist);
bool ED_keylist_all_keys_frame_range(const struct AnimKeylist *keylist, Range2f *r_frame_range);
AnimKeylist *ED_keylist_create();
void ED_keylist_free(AnimKeylist *keylist);
void ED_keylist_prepare_for_direct_access(AnimKeylist *keylist);
const ActKeyColumn *ED_keylist_find_exact(const AnimKeylist *keylist, float cfra);
const ActKeyColumn *ED_keylist_find_next(const AnimKeylist *keylist, float cfra);
const ActKeyColumn *ED_keylist_find_prev(const AnimKeylist *keylist, float cfra);
const ActKeyColumn *ED_keylist_find_any_between(const AnimKeylist *keylist,
const Range2f frame_range);
bool ED_keylist_is_empty(const AnimKeylist *keylist);
const ListBase /* ActKeyColumn */ *ED_keylist_listbase(const AnimKeylist *keylist);
bool ED_keylist_all_keys_frame_range(const AnimKeylist *keylist, Range2f *r_frame_range);
/* Return the selected keyframe's range. If none are selected, return False and
* do not affect the frame range. */
bool ED_keylist_selected_keys_frame_range(const struct AnimKeylist *keylist,
Range2f *r_frame_range);
const ActKeyColumn *ED_keylist_array(const struct AnimKeylist *keylist);
int64_t ED_keylist_array_len(const struct AnimKeylist *keylist);
bool ED_keylist_selected_keys_frame_range(const AnimKeylist *keylist, Range2f *r_frame_range);
const ActKeyColumn *ED_keylist_array(const AnimKeylist *keylist);
int64_t ED_keylist_array_len(const AnimKeylist *keylist);
/* Key-data Generation --------------- */
/* F-Curve */
void fcurve_to_keylist(struct AnimData *adt,
struct FCurve *fcu,
struct AnimKeylist *keylist,
int saction_flag);
void fcurve_to_keylist(AnimData *adt, FCurve *fcu, AnimKeylist *keylist, int saction_flag);
/* Action Group */
void agroup_to_keylist(struct AnimData *adt,
struct bActionGroup *agrp,
struct AnimKeylist *keylist,
int saction_flag);
void agroup_to_keylist(AnimData *adt, bActionGroup *agrp, AnimKeylist *keylist, int saction_flag);
/* Action */
void action_to_keylist(struct AnimData *adt,
struct bAction *act,
struct AnimKeylist *keylist,
int saction_flag);
void action_to_keylist(AnimData *adt, bAction *act, AnimKeylist *keylist, int saction_flag);
/* Object */
void ob_to_keylist(struct bDopeSheet *ads,
struct Object *ob,
struct AnimKeylist *keylist,
int saction_flag);
void ob_to_keylist(bDopeSheet *ads, Object *ob, AnimKeylist *keylist, int saction_flag);
/* Cache File */
void cachefile_to_keylist(struct bDopeSheet *ads,
struct CacheFile *cache_file,
struct AnimKeylist *keylist,
void cachefile_to_keylist(bDopeSheet *ads,
CacheFile *cache_file,
AnimKeylist *keylist,
int saction_flag);
/* Scene */
void scene_to_keylist(struct bDopeSheet *ads,
struct Scene *sce,
struct AnimKeylist *keylist,
int saction_flag);
void scene_to_keylist(bDopeSheet *ads, Scene *sce, AnimKeylist *keylist, int saction_flag);
/* DopeSheet Summary */
void summary_to_keylist(struct bAnimContext *ac, struct AnimKeylist *keylist, int saction_flag);
void summary_to_keylist(bAnimContext *ac, AnimKeylist *keylist, int saction_flag);
/* Grease Pencil datablock summary */
void gpencil_to_keylist(struct bDopeSheet *ads,
struct bGPdata *gpd,
struct AnimKeylist *keylist,
bool active);
void gpencil_to_keylist(bDopeSheet *ads, bGPdata *gpd, AnimKeylist *keylist, bool active);
/* Grease Pencil Cels */
void grease_pencil_cels_to_keylist(struct AnimData *adt,
struct GreasePencilLayer *layer,
struct AnimKeylist *keylist,
void grease_pencil_cels_to_keylist(AnimData *adt,
GreasePencilLayer *layer,
AnimKeylist *keylist,
int saction_flag);
/* Grease Pencil Layer */
void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct AnimKeylist *keylist);
void gpl_to_keylist(bDopeSheet *ads, bGPDlayer *gpl, AnimKeylist *keylist);
/* Mask */
void mask_to_keylist(struct bDopeSheet *ads,
struct MaskLayer *masklay,
struct AnimKeylist *keylist);
void mask_to_keylist(bDopeSheet *ads, MaskLayer *masklay, AnimKeylist *keylist);
/* ActKeyColumn API ---------------- */

View File

@@ -43,7 +43,7 @@ struct NlaKeyframingContext;
* \param use_autokey_mode: include settings from key-framing mode in the result
* (i.e. replace only).
*/
eInsertKeyFlags ANIM_get_keyframing_flags(struct Scene *scene, bool use_autokey_mode);
eInsertKeyFlags ANIM_get_keyframing_flags(Scene *scene, bool use_autokey_mode);
/* -------- */
@@ -51,24 +51,24 @@ eInsertKeyFlags ANIM_get_keyframing_flags(struct Scene *scene, bool use_autokey_
* Get (or add relevant data to be able to do so) the Active Action for the given
* Animation Data block, given an ID block where the Animation Data should reside.
*/
struct bAction *ED_id_action_ensure(struct Main *bmain, struct ID *id);
bAction *ED_id_action_ensure(Main *bmain, ID *id);
/**
* Get (or add relevant data to be able to do so) F-Curve from the Active Action,
* for the given Animation Data block. This assumes that all the destinations are valid.
*/
struct FCurve *ED_action_fcurve_ensure(struct Main *bmain,
struct bAction *act,
const char group[],
struct PointerRNA *ptr,
const char rna_path[],
int array_index);
FCurve *ED_action_fcurve_ensure(Main *bmain,
bAction *act,
const char group[],
PointerRNA *ptr,
const char rna_path[],
int array_index);
/**
* Find the F-Curve from the Active Action,
* for the given Animation Data block. This assumes that all the destinations are valid.
*/
struct FCurve *ED_action_fcurve_find(struct bAction *act, const char rna_path[], int array_index);
FCurve *ED_action_fcurve_find(bAction *act, const char rna_path[], int array_index);
/* -------- */
@@ -78,10 +78,7 @@ struct FCurve *ED_action_fcurve_find(struct bAction *act, const char rna_path[],
* Update integer/discrete flags of the FCurve (used when creating/inserting keyframes,
* but also through RNA when editing an ID prop, see #37103).
*/
void update_autoflags_fcurve(struct FCurve *fcu,
struct bContext *C,
struct ReportList *reports,
struct PointerRNA *ptr);
void update_autoflags_fcurve(FCurve *fcu, bContext *C, ReportList *reports, PointerRNA *ptr);
/* -------- */
@@ -97,7 +94,7 @@ void update_autoflags_fcurve(struct FCurve *fcu,
*
* \note any recalculate of the F-Curve that needs to be done will need to be done by the caller.
*/
int insert_bezt_fcurve(struct FCurve *fcu, const struct BezTriple *bezt, eInsertKeyFlags flag);
int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag);
/**
* \brief Main Key-framing API call.
@@ -114,11 +111,8 @@ int insert_bezt_fcurve(struct FCurve *fcu, const struct BezTriple *bezt, eInsert
* \param flag: Optional flags (#eInsertKeyFlags) for controlling how keys get added
* and/or whether updates get done.
*/
int insert_vert_fcurve(struct FCurve *fcu,
float x,
float y,
eBezTriple_KeyframeType keyframe_type,
eInsertKeyFlags flag);
int insert_vert_fcurve(
FCurve *fcu, float x, float y, eBezTriple_KeyframeType keyframe_type, eInsertKeyFlags flag);
/**
* Add the given number of keyframes to the FCurve. Their coordinates are
@@ -129,7 +123,7 @@ int insert_vert_fcurve(struct FCurve *fcu,
* This can be used to allocate all the keys at once, and then update them
* afterwards.
*/
void ED_keyframes_add(struct FCurve *fcu, int num_keys_to_add);
void ED_keyframes_add(FCurve *fcu, int num_keys_to_add);
/* -------- */
@@ -149,13 +143,13 @@ void ED_keyframes_add(struct FCurve *fcu, int num_keys_to_add);
* and extra keyframe filtering.
* \return Success.
*/
bool insert_keyframe_direct(struct ReportList *reports,
struct PointerRNA ptr,
struct PropertyRNA *prop,
struct FCurve *fcu,
const struct AnimationEvalContext *anim_eval_context,
bool insert_keyframe_direct(ReportList *reports,
PointerRNA ptr,
PropertyRNA *prop,
FCurve *fcu,
const AnimationEvalContext *anim_eval_context,
eBezTriple_KeyframeType keytype,
struct NlaKeyframingContext *nla,
NlaKeyframingContext *nla,
eInsertKeyFlags flag);
/* -------- */
@@ -172,16 +166,16 @@ bool insert_keyframe_direct(struct ReportList *reports,
* \param array_index: The index to key or -1 keys all array indices.
* \return The number of key-frames inserted.
*/
int insert_keyframe(struct Main *bmain,
struct ReportList *reports,
struct ID *id,
struct bAction *act,
int insert_keyframe(Main *bmain,
ReportList *reports,
ID *id,
bAction *act,
const char group[],
const char rna_path[],
int array_index,
const struct AnimationEvalContext *anim_eval_context,
const AnimationEvalContext *anim_eval_context,
eBezTriple_KeyframeType keytype,
struct ListBase *nla_cache,
ListBase *nla_cache,
eInsertKeyFlags flag);
/**
@@ -191,10 +185,10 @@ int insert_keyframe(struct Main *bmain,
* Will perform checks just in case.
* \return The number of key-frames deleted.
*/
int delete_keyframe(struct Main *bmain,
struct ReportList *reports,
struct ID *id,
struct bAction *act,
int delete_keyframe(Main *bmain,
ReportList *reports,
ID *id,
bAction *act,
const char rna_path[],
int array_index,
float cfra);
@@ -210,20 +204,18 @@ struct ExtensionRNA;
struct KeyingSetInfo;
/* Polling Callback for KeyingSets */
typedef bool (*cbKeyingSet_Poll)(struct KeyingSetInfo *ksi, struct bContext *C);
using cbKeyingSet_Poll = bool (*)(KeyingSetInfo *ksi, bContext *C);
/* Context Iterator Callback for KeyingSets */
typedef void (*cbKeyingSet_Iterator)(struct KeyingSetInfo *ksi,
struct bContext *C,
struct KeyingSet *ks);
using cbKeyingSet_Iterator = void (*)(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks);
/* Property Specifier Callback for KeyingSets (called from iterators) */
typedef void (*cbKeyingSet_Generate)(struct KeyingSetInfo *ksi,
struct bContext *C,
struct KeyingSet *ks,
struct PointerRNA *ptr);
using cbKeyingSet_Generate = void (*)(KeyingSetInfo *ksi,
bContext *C,
KeyingSet *ks,
PointerRNA *ptr);
/* Callback info for 'Procedural' KeyingSets to use */
typedef struct KeyingSetInfo {
struct KeyingSetInfo *next, *prev;
struct KeyingSetInfo {
KeyingSetInfo *next, *prev;
/* info */
/* identifier used for class name, which KeyingSet instances reference as "Typeinfo Name" */
@@ -249,18 +241,15 @@ typedef struct KeyingSetInfo {
cbKeyingSet_Generate generate;
/* RNA integration */
struct ExtensionRNA rna_ext;
} KeyingSetInfo;
ExtensionRNA rna_ext;
};
/* -------- */
/**
* Add another data source for Relative Keying Sets to be evaluated with.
*/
void ANIM_relative_keyingset_add_source(ListBase *dsources,
struct ID *id,
struct StructRNA *srna,
void *data);
void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *srna, void *data);
/* mode for modify_keyframes */
typedef enum eModifyKey_Modes {
@@ -284,9 +273,7 @@ typedef enum eModifyKey_Returns {
*
* \return 0 if succeeded, otherwise an error code: #eModifyKey_Returns.
*/
eModifyKey_Returns ANIM_validate_keyingset(struct bContext *C,
ListBase *dsources,
struct KeyingSet *ks);
eModifyKey_Returns ANIM_validate_keyingset(bContext *C, ListBase *dsources, KeyingSet *ks);
/**
* Use the specified #KeyingSet and context info (if required)
@@ -298,12 +285,8 @@ eModifyKey_Returns ANIM_validate_keyingset(struct bContext *C,
* \returns the number of channels that key-frames were added or
* an #eModifyKey_Returns value (always a negative number).
*/
int ANIM_apply_keyingset(struct bContext *C,
ListBase *dsources,
struct bAction *act,
struct KeyingSet *ks,
short mode,
float cfra);
int ANIM_apply_keyingset(
bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra);
/* -------- */
@@ -313,7 +296,7 @@ int ANIM_apply_keyingset(struct bContext *C,
* \return The first builtin #KeyingSet with the given name, which occurs after the given one
* (or start of list if none given).
*/
struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, const char name[]);
KeyingSet *ANIM_builtin_keyingset_get_named(KeyingSet *prevKS, const char name[]);
/**
* Find KeyingSet type info given a name.
@@ -323,7 +306,7 @@ KeyingSetInfo *ANIM_keyingset_info_find_name(const char name[]);
/**
* Check if the ID appears in the paths specified by the #KeyingSet.
*/
bool ANIM_keyingset_find_id(struct KeyingSet *ks, ID *id);
bool ANIM_keyingset_find_id(KeyingSet *ks, ID *id);
/**
* Add the given KeyingSetInfo to the list of type infos,
@@ -334,7 +317,7 @@ void ANIM_keyingset_info_register(KeyingSetInfo *ksi);
* Remove the given #KeyingSetInfo from the list of type infos,
* and also remove the builtin set if appropriate.
*/
void ANIM_keyingset_info_unregister(struct Main *bmain, KeyingSetInfo *ksi);
void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *ksi);
/* cleanup on exit */
/* --------------- */
@@ -346,39 +329,38 @@ void ANIM_keyingset_infos_exit(void);
/**
* Get the active Keying Set for the given scene.
*/
struct KeyingSet *ANIM_scene_get_active_keyingset(const struct Scene *scene);
KeyingSet *ANIM_scene_get_active_keyingset(const Scene *scene);
/**
* Get the index of the Keying Set provided, for the given Scene.
*/
int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks);
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *ks);
/**
* Get Keying Set to use for Auto-Key-Framing some transforms.
*/
struct KeyingSet *ANIM_get_keyingset_for_autokeying(const struct Scene *scene,
const char *transformKSName);
KeyingSet *ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName);
void ANIM_keyingset_visit_for_search(const struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
void ANIM_keyingset_visit_for_search(const bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
const char *edit_text,
StringPropertySearchVisitFunc visit_fn,
void *visit_user_data);
void ANIM_keyingset_visit_for_search_no_poll(const struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
void ANIM_keyingset_visit_for_search_no_poll(const bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
const char *edit_text,
StringPropertySearchVisitFunc visit_fn,
void *visit_user_data);
/**
* Dynamically populate an enum of Keying Sets.
*/
const struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
bool *r_free);
const EnumPropertyItem *ANIM_keying_sets_enum_itemf(bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
bool *r_free);
/**
* Get the keying set from enum values generated in #ANIM_keying_sets_enum_itemf.
@@ -389,13 +371,13 @@ const struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C,
* - > 0: use a user-defined Keying Set from the active scene.
* - < 0: use a builtin Keying Set.
*/
KeyingSet *ANIM_keyingset_get_from_enum_type(struct Scene *scene, int type);
KeyingSet *ANIM_keyingset_get_from_idname(struct Scene *scene, const char *idname);
KeyingSet *ANIM_keyingset_get_from_enum_type(Scene *scene, int type);
KeyingSet *ANIM_keyingset_get_from_idname(Scene *scene, const char *idname);
/**
* Check if #KeyingSet can be used in the current context.
*/
bool ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks);
bool ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *ks);
/** \} */
@@ -404,15 +386,15 @@ bool ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks);
* \{ */
/* Flags for use by driver creation calls */
typedef enum eCreateDriverFlags {
enum eCreateDriverFlags {
/** create drivers with a default variable for nicer UI */
CREATEDRIVER_WITH_DEFAULT_DVAR = (1 << 0),
/** create drivers with Generator FModifier (for backwards compat) */
CREATEDRIVER_WITH_FMODIFIER = (1 << 1),
} eCreateDriverFlags;
};
/* Heuristic to use for connecting target properties to driven ones */
typedef enum eCreateDriver_MappingTypes {
enum eCreateDriver_MappingTypes {
/** 1 to Many - Use the specified index, and drive all elements with it */
CREATEDRIVER_MAPPING_1_N = 0,
/** 1 to 1 - Only for the specified index on each side */
@@ -426,7 +408,7 @@ typedef enum eCreateDriver_MappingTypes {
/** None (All Properties):
* Do not create driver with any targets; these will get added later instead */
CREATEDRIVER_MAPPING_NONE_ALL = 4,
} eCreateDriver_MappingTypes;
};
/**
* Mapping Types enum for operators.
@@ -450,14 +432,14 @@ typedef enum eDriverFCurveCreationMode {
* \note This low-level function shouldn't be used directly for most tools,
* although there are special cases where this approach is preferable.
*/
struct FCurve *verify_driver_fcurve(struct ID *id,
const char rna_path[],
int array_index,
eDriverFCurveCreationMode creation_mode);
FCurve *verify_driver_fcurve(ID *id,
const char rna_path[],
int array_index,
eDriverFCurveCreationMode creation_mode);
struct FCurve *alloc_driver_fcurve(const char rna_path[],
int array_index,
eDriverFCurveCreationMode creation_mode);
FCurve *alloc_driver_fcurve(const char rna_path[],
int array_index,
eDriverFCurveCreationMode creation_mode);
/* -------- */
@@ -474,11 +456,11 @@ struct FCurve *alloc_driver_fcurve(const char rna_path[],
* \param driver_type: eDriver_Types
* \param mapping_type: eCreateDriver_MappingTypes
*/
int ANIM_add_driver_with_target(struct ReportList *reports,
struct ID *dst_id,
int ANIM_add_driver_with_target(ReportList *reports,
ID *dst_id,
const char dst_path[],
int dst_index,
struct ID *src_id,
ID *src_id,
const char src_path[],
int src_index,
short flag,
@@ -492,12 +474,8 @@ int ANIM_add_driver_with_target(struct ReportList *reports,
*
* Add a new driver for the specified property on the given ID block
*/
int ANIM_add_driver(struct ReportList *reports,
struct ID *id,
const char rna_path[],
int array_index,
short flag,
int type);
int ANIM_add_driver(
ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type);
/**
* \brief Main Driver Management API calls.
@@ -505,7 +483,7 @@ int ANIM_add_driver(struct ReportList *reports,
* Remove the driver for the specified property on the given ID block (if available).
*/
bool ANIM_remove_driver(
struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag);
ReportList *reports, ID *id, const char rna_path[], int array_index, short flag);
/* -------- */
@@ -534,7 +512,7 @@ bool ANIM_driver_can_paste(void);
* Make a copy of the driver for the specified property on the given ID block.
*/
bool ANIM_copy_driver(
struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag);
ReportList *reports, ID *id, const char rna_path[], int array_index, short flag);
/**
* \brief Main Driver Management API calls.
@@ -543,7 +521,7 @@ bool ANIM_copy_driver(
* with the driver + driver-curve data from the buffer.
*/
bool ANIM_paste_driver(
struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag);
ReportList *reports, ID *id, const char rna_path[], int array_index, short flag);
/* -------- */
@@ -555,12 +533,12 @@ bool ANIM_driver_vars_can_paste(void);
/**
* Copy the given driver's variables to the buffer.
*/
bool ANIM_driver_vars_copy(struct ReportList *reports, struct FCurve *fcu);
bool ANIM_driver_vars_copy(ReportList *reports, FCurve *fcu);
/**
* Paste the variables in the buffer to the given FCurve.
*/
bool ANIM_driver_vars_paste(struct ReportList *reports, struct FCurve *fcu, bool replace);
bool ANIM_driver_vars_paste(ReportList *reports, FCurve *fcu, bool replace);
/* -------- */
@@ -568,7 +546,7 @@ bool ANIM_driver_vars_paste(struct ReportList *reports, struct FCurve *fcu, bool
* Create a driver & variable that reads the specified property,
* and store it in the buffers for Paste Driver and Paste Variables.
*/
void ANIM_copy_as_driver(struct ID *target_id, const char *target_path, const char *var_name);
void ANIM_copy_as_driver(ID *target_id, const char *target_path, const char *var_name);
/** \} */
@@ -601,7 +579,7 @@ void ANIM_copy_as_driver(struct ID *target_id, const char *target_path, const ch
/**
* Auto-keyframing feature - checks for whether anything should be done for the current frame.
*/
bool autokeyframe_cfra_can_key(const struct Scene *scene, struct ID *id);
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id);
/** \} */
@@ -615,7 +593,7 @@ bool autokeyframe_cfra_can_key(const struct Scene *scene, struct ID *id);
* Checks if some F-Curve has a keyframe for a given frame.
* \note Used for the buttons to check for keyframes.
*/
bool fcurve_frame_has_keyframe(const struct FCurve *fcu, float frame);
bool fcurve_frame_has_keyframe(const FCurve *fcu, float frame);
/**
* \brief Lesser Keyframe Checking API call.
@@ -623,10 +601,10 @@ bool fcurve_frame_has_keyframe(const struct FCurve *fcu, float frame);
* - Returns whether the current value of a given property differs from the interpolated value.
* - Used for button drawing.
*/
bool fcurve_is_changed(struct PointerRNA ptr,
struct PropertyRNA *prop,
struct FCurve *fcu,
const struct AnimationEvalContext *anim_eval_context);
bool fcurve_is_changed(PointerRNA ptr,
PropertyRNA *prop,
FCurve *fcu,
const AnimationEvalContext *anim_eval_context);
/**
* \brief Main Keyframe Checking API call.
@@ -636,19 +614,13 @@ bool fcurve_is_changed(struct PointerRNA ptr,
* in case some detail of the implementation changes...
* \param frame: The value of this is quite often result of #BKE_scene_ctime_get()
*/
bool id_frame_has_keyframe(struct ID *id, float frame);
bool id_frame_has_keyframe(ID *id, float frame);
/* Utility functions for auto key-frame. */
bool ED_autokeyframe_object(struct bContext *C,
struct Scene *scene,
struct Object *ob,
struct KeyingSet *ks);
bool ED_autokeyframe_pchan(struct bContext *C,
struct Scene *scene,
struct Object *ob,
struct bPoseChannel *pchan,
struct KeyingSet *ks);
bool ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks);
bool ED_autokeyframe_pchan(
bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks);
/**
* Use for auto-key-framing
@@ -656,8 +628,8 @@ bool ED_autokeyframe_pchan(struct bContext *C,
* properties. This is by design when using buttons. For other callers such as gizmos or VSE
* preview transform, creating new animation/keyframes also on non-keyed properties is desired.
*/
bool ED_autokeyframe_property(struct bContext *C,
struct Scene *scene,
bool ED_autokeyframe_property(bContext *C,
Scene *scene,
PointerRNA *ptr,
PropertyRNA *prop,
int rnaindex,

View File

@@ -8,10 +8,6 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
struct Base;
struct Object;
struct SelectPick_Params;
@@ -20,27 +16,21 @@ struct wmKeyConfig;
/* `lattice_ops.cc` */
void ED_operatortypes_lattice(void);
void ED_keymap_lattice(struct wmKeyConfig *keyconf);
void ED_operatortypes_lattice();
void ED_keymap_lattice(wmKeyConfig *keyconf);
/* `editlattice_select.cc` */
bool ED_lattice_flags_set(struct Object *obedit, int flag);
bool ED_lattice_flags_set(Object *obedit, int flag);
/**
* \return True when pick finds an element or the selection changed.
*/
bool ED_lattice_select_pick(struct bContext *C,
const int mval[2],
const struct SelectPick_Params *params);
bool ED_lattice_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params);
bool ED_lattice_deselect_all_multi_ex(struct Base **bases, uint bases_len);
bool ED_lattice_deselect_all_multi(struct bContext *C);
bool ED_lattice_deselect_all_multi_ex(Base **bases, uint bases_len);
bool ED_lattice_deselect_all_multi(bContext *C);
/* `editlattice_undo.cc` */
/** Export for ED_undo_sys. */
void ED_lattice_undosys_type(struct UndoType *ut);
#ifdef __cplusplus
}
#endif
void ED_lattice_undosys_type(UndoType *ut);

View File

@@ -26,7 +26,7 @@ enum {
};
/* Draw Scene-Markers in time window */
void ED_markers_draw(const struct bContext *C, int flag);
void ED_markers_draw(const bContext *C, int flag);
/** \} */
@@ -37,11 +37,11 @@ void ED_markers_draw(const struct bContext *C, int flag);
/**
* Public API for getting markers from context.
*/
ListBase *ED_context_get_markers(const struct bContext *C);
ListBase *ED_context_get_markers(const bContext *C);
/**
* Public API for getting markers from "animation" context.
*/
ListBase *ED_animcontext_get_markers(const struct bAnimContext *ac);
ListBase *ED_animcontext_get_markers(const bAnimContext *ac);
/**
* Apply some transformation to markers after the fact
@@ -55,13 +55,13 @@ ListBase *ED_animcontext_get_markers(const struct bAnimContext *ac);
* \param side: (B/L/R) for 'extend' functionality, which side of current frame to use
*/
int ED_markers_post_apply_transform(
ListBase *markers, struct Scene *scene, int mode, float value, char side);
ListBase *markers, Scene *scene, int mode, float value, char side);
/**
* Get the marker that is closest to this point.
* XXX: for select, the min_dist should be small.
*/
struct TimeMarker *ED_markers_find_nearest_marker(ListBase *markers, float x);
TimeMarker *ED_markers_find_nearest_marker(ListBase *markers, float x);
/**
* Return the time of the marker that occurs on a frame closest to the given time.
*/
@@ -81,7 +81,7 @@ void ED_markers_deselect_all(ListBase *markers, int action);
/**
* Get the first selected marker.
*/
struct TimeMarker *ED_markers_get_first_selected(ListBase *markers);
TimeMarker *ED_markers_get_first_selected(ListBase *markers);
/** \} */
@@ -92,15 +92,15 @@ struct TimeMarker *ED_markers_get_first_selected(ListBase *markers);
/**
* Called in `screen_ops.cc`, #ED_operatortypes_screen().
*/
void ED_operatortypes_marker(void);
void ED_operatortypes_marker();
/**
* Called in `screen_ops.cc`, #ED_keymap_screen().
*/
void ED_keymap_marker(struct wmKeyConfig *keyconf);
void ED_keymap_marker(wmKeyConfig *keyconf);
/**
* Debugging only: print debugging prints of list of markers.
*/
void debug_markers_print_list(struct ListBase *markers);
void debug_markers_print_list(ListBase *markers);
/** \} */

View File

@@ -24,7 +24,7 @@ struct wmKeyConfig;
* - The space is configured to interact with mask.
*
* It is not required to have mask opened for editing. */
bool ED_maskedit_poll(struct bContext *C);
bool ED_maskedit_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space supports mask editing.
@@ -32,56 +32,49 @@ bool ED_maskedit_poll(struct bContext *C);
* - Mask has visible and editable splines.
*
* It is not required to have mask opened for editing. */
bool ED_maskedit_visible_splines_poll(struct bContext *C);
bool ED_maskedit_visible_splines_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space supports mask editing.
* - The space is configured to interact with mask.
* - The space has mask open for editing. */
bool ED_maskedit_mask_poll(struct bContext *C);
bool ED_maskedit_mask_poll(bContext *C);
/* Returns true when the following conditions are met:
* - Current space supports mask editing.
* - The space is configured to interact with mask.
* - The space has mask opened.
* - Mask has visible and editable splines. */
bool ED_maskedit_mask_visible_splines_poll(struct bContext *C);
bool ED_maskedit_mask_visible_splines_poll(bContext *C);
void ED_mask_deselect_all(const struct bContext *C);
void ED_mask_deselect_all(const bContext *C);
void ED_operatortypes_mask(void);
void ED_keymap_mask(struct wmKeyConfig *keyconf);
void ED_keymap_mask(wmKeyConfig *keyconf);
void ED_operatormacros_mask(void);
/* `mask_query.cc` */
void ED_mask_get_size(struct ScrArea *area, int *width, int *height);
void ED_mask_zoom(struct ScrArea *area, struct ARegion *region, float *zoomx, float *zoomy);
void ED_mask_get_aspect(struct ScrArea *area, struct ARegion *region, float *aspx, float *aspy);
void ED_mask_get_size(ScrArea *area, int *width, int *height);
void ED_mask_zoom(ScrArea *area, ARegion *region, float *zoomx, float *zoomy);
void ED_mask_get_aspect(ScrArea *area, ARegion *region, float *aspx, float *aspy);
void ED_mask_pixelspace_factor(struct ScrArea *area,
struct ARegion *region,
float *scalex,
float *scaley);
void ED_mask_pixelspace_factor(ScrArea *area, ARegion *region, float *scalex, float *scaley);
/**
* Takes `event->mval`.
*/
void ED_mask_mouse_pos(struct ScrArea *area,
struct ARegion *region,
const int mval[2],
float co[2]);
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float co[2]);
/**
* \param x/y: input, mval space.
* \param xr/yr: output, mask point space.
*/
void ED_mask_point_pos(
struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr);
void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr);
void ED_mask_point_pos__reverse(
struct ScrArea *area, struct ARegion *region, float x, float y, float *xr, float *yr);
ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr);
void ED_mask_cursor_location_get(struct ScrArea *area, float cursor[2]);
bool ED_mask_selected_minmax(const struct bContext *C,
void ED_mask_cursor_location_get(ScrArea *area, float cursor[2]);
bool ED_mask_selected_minmax(const bContext *C,
float min[2],
float max[2],
bool handles_as_control_point);
@@ -92,9 +85,9 @@ bool ED_mask_selected_minmax(const struct bContext *C,
* Sets up the opengl context.
* width, height are to match the values from #ED_mask_get_size().
*/
void ED_mask_draw_region(struct Depsgraph *depsgraph,
struct Mask *mask,
struct ARegion *region,
void ED_mask_draw_region(Depsgraph *depsgraph,
Mask *mask,
ARegion *region,
char draw_flag,
char draw_type,
eMaskOverlayMode overlay_mode,
@@ -106,80 +99,78 @@ void ED_mask_draw_region(struct Depsgraph *depsgraph,
bool do_scale_applied,
bool do_draw_cb,
float stabmat[4][4],
const struct bContext *C);
const bContext *C);
void ED_mask_draw_frames(struct Mask *mask, struct ARegion *region, int cfra, int sfra, int efra);
void ED_mask_draw_frames(Mask *mask, ARegion *region, int cfra, int sfra, int efra);
/* `mask_shapekey.cc` */
void ED_mask_layer_shape_auto_key(struct MaskLayer *mask_layer, int frame);
bool ED_mask_layer_shape_auto_key_all(struct Mask *mask, int frame);
bool ED_mask_layer_shape_auto_key_select(struct Mask *mask, int frame);
void ED_mask_layer_shape_auto_key(MaskLayer *mask_layer, int frame);
bool ED_mask_layer_shape_auto_key_all(Mask *mask, int frame);
bool ED_mask_layer_shape_auto_key_select(Mask *mask, int frame);
/* ----------- Mask AnimEdit API ------------------ */
/**
* Loops over the mask-frames for a mask-layer, and applies the given callback.
*/
bool ED_masklayer_frames_looper(struct MaskLayer *mask_layer,
struct Scene *scene,
bool (*mask_layer_shape_cb)(struct MaskLayerShape *,
struct Scene *));
bool ED_masklayer_frames_looper(MaskLayer *mask_layer,
Scene *scene,
bool (*mask_layer_shape_cb)(MaskLayerShape *, Scene *));
/**
* Make a listing all the mask-frames in a layer as cfraelems.
*/
void ED_masklayer_make_cfra_list(struct MaskLayer *mask_layer, ListBase *elems, bool onlysel);
void ED_masklayer_make_cfra_list(MaskLayer *mask_layer, ListBase *elems, bool onlysel);
/**
* Check if one of the frames in this layer is selected.
*/
bool ED_masklayer_frame_select_check(const struct MaskLayer *mask_layer);
bool ED_masklayer_frame_select_check(const MaskLayer *mask_layer);
/**
* Set all/none/invert select.
*/
void ED_masklayer_frame_select_set(struct MaskLayer *mask_layer, short mode);
void ED_masklayer_frame_select_set(MaskLayer *mask_layer, short mode);
/**
* Select the frames in this layer that occur within the bounds specified.
*/
void ED_masklayer_frames_select_box(struct MaskLayer *mask_layer,
void ED_masklayer_frames_select_box(MaskLayer *mask_layer,
float min,
float max,
short select_mode);
/**
* Select the frames in this layer that occur within the lasso/circle region specified.
*/
void ED_masklayer_frames_select_region(struct KeyframeEditData *ked,
struct MaskLayer *mask_layer,
void ED_masklayer_frames_select_region(KeyframeEditData *ked,
MaskLayer *mask_layer,
short tool,
short select_mode);
/**
* Set all/none/invert select (like above, but with SELECT_* modes).
*/
void ED_mask_select_frames(struct MaskLayer *mask_layer, short select_mode);
void ED_mask_select_frames(MaskLayer *mask_layer, short select_mode);
/**
* Select the frame in this layer that occurs on this frame (there should only be one at most).
*/
void ED_mask_select_frame(struct MaskLayer *mask_layer, int selx, short select_mode);
void ED_mask_select_frame(MaskLayer *mask_layer, int selx, short select_mode);
/**
* Delete selected frames.
*/
bool ED_masklayer_frames_delete(struct MaskLayer *mask_layer);
bool ED_masklayer_frames_delete(MaskLayer *mask_layer);
/**
* Duplicate selected frames from given mask-layer.
*/
void ED_masklayer_frames_duplicate(struct MaskLayer *mask_layer);
void ED_masklayer_frames_duplicate(MaskLayer *mask_layer);
/**
* Snap selected frames to ...
*/
void ED_masklayer_snap_frames(struct MaskLayer *mask_layer, struct Scene *scene, short mode);
void ED_masklayer_snap_frames(MaskLayer *mask_layer, Scene *scene, short mode);
#if 0
void free_gpcopybuf(void);
void copy_gpdata(void);
void paste_gpdata(void);
void mirror_masklayer_frames(struct MaskLayer *mask_layer, short mode);
void mirror_masklayer_frames( MaskLayer *mask_layer, short mode);
#endif

View File

@@ -8,7 +8,6 @@
#pragma once
struct Base;
struct MetaElem;
struct Object;
@@ -17,57 +16,50 @@ struct UndoType;
struct bContext;
struct wmKeyConfig;
void ED_operatortypes_metaball(void);
void ED_operatormacros_metaball(void);
void ED_keymap_metaball(struct wmKeyConfig *keyconf);
void ED_operatortypes_metaball();
void ED_operatormacros_metaball();
void ED_keymap_metaball(wmKeyConfig *keyconf);
/**
* Add meta-element primitive to meta-ball object (which is in edit mode).
*/
struct MetaElem *ED_mball_add_primitive(struct bContext *C,
struct Object *obedit,
bool obedit_is_new,
float mat[4][4],
float dia,
int type);
MetaElem *ED_mball_add_primitive(
bContext *C, Object *obedit, bool obedit_is_new, float mat[4][4], float dia, int type);
struct Base *ED_mball_base_and_elem_from_select_buffer(struct Base **bases,
uint bases_len,
const uint select_id,
struct MetaElem **r_ml);
Base *ED_mball_base_and_elem_from_select_buffer(Base **bases,
uint bases_len,
const uint select_id,
MetaElem **r_ml);
/**
* Select meta-element with mouse click (user can select radius circle or stiffness circle).
*
* \return True when pick finds an element or the selection changed.
*/
bool ED_mball_select_pick(struct bContext *C,
const int mval[2],
const struct SelectPick_Params *params);
bool ED_mball_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params);
bool ED_mball_deselect_all_multi_ex(struct Base **bases, uint bases_len);
bool ED_mball_deselect_all_multi(struct bContext *C);
bool ED_mball_deselect_all_multi_ex(Base **bases, uint bases_len);
bool ED_mball_deselect_all_multi(bContext *C);
/**
* This function is used to free all MetaElems from MetaBall.
*/
void ED_mball_editmball_free(struct Object *obedit);
void ED_mball_editmball_free(Object *obedit);
/**
* This function is called, when MetaBall Object is switched from object mode to edit mode.
*/
void ED_mball_editmball_make(struct Object *obedit);
void ED_mball_editmball_make(Object *obedit);
/**
* This function is called, when MetaBall Object switched from edit mode to object mode.
* List of MetaElements is copied from object->data->edit_elems to object->data->elems.
*/
void ED_mball_editmball_load(struct Object *obedit);
void ED_mball_editmball_load(Object *obedit);
/* `editmball_undo.cc` */
/** Export for ED_undo_sys. */
void ED_mball_undosys_type(struct UndoType *ut);
void ED_mball_undosys_type(UndoType *ut);
#define MBALLSEL_STIFF (1u << 30)
#define MBALLSEL_RADIUS (1u << 31)
#define MBALLSEL_ANY (MBALLSEL_STIFF | MBALLSEL_RADIUS)

View File

@@ -8,7 +8,6 @@
#pragma once
#include "BLI_compiler_attrs.h"
struct ARegion;
@@ -39,6 +38,8 @@ struct bContext;
struct bDeformGroup;
struct wmKeyConfig;
struct wmOperator;
struct UvElement;
struct UvElementMap;
/* editmesh_utils.cc */
@@ -52,7 +53,7 @@ struct wmOperator;
* \param r_index: Optional array to write into, as an alternative to a custom-data layer
* (length of total verts).
*/
void EDBM_verts_mirror_cache_begin_ex(struct BMEditMesh *em,
void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em,
int axis,
bool use_self,
bool use_select,
@@ -60,37 +61,32 @@ void EDBM_verts_mirror_cache_begin_ex(struct BMEditMesh *em,
bool use_topology,
float maxdist,
int *r_index);
void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em,
int axis,
bool use_self,
bool use_select,
bool respecthide,
bool use_topology);
void EDBM_verts_mirror_apply(struct BMEditMesh *em, int sel_from, int sel_to);
struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v);
struct BMEdge *EDBM_verts_mirror_get_edge(struct BMEditMesh *em, struct BMEdge *e);
struct BMFace *EDBM_verts_mirror_get_face(struct BMEditMesh *em, struct BMFace *f);
void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v);
void EDBM_verts_mirror_cache_end(struct BMEditMesh *em);
void EDBM_verts_mirror_cache_begin(
BMEditMesh *em, int axis, bool use_self, bool use_select, bool respecthide, bool use_topology);
void EDBM_verts_mirror_apply(BMEditMesh *em, int sel_from, int sel_to);
BMVert *EDBM_verts_mirror_get(BMEditMesh *em, BMVert *v);
BMEdge *EDBM_verts_mirror_get_edge(BMEditMesh *em, BMEdge *e);
BMFace *EDBM_verts_mirror_get_face(BMEditMesh *em, BMFace *f);
void EDBM_verts_mirror_cache_clear(BMEditMesh *em, BMVert *v);
void EDBM_verts_mirror_cache_end(BMEditMesh *em);
void EDBM_mesh_normals_update_ex(struct BMEditMesh *em,
const struct BMeshNormalsUpdate_Params *params);
void EDBM_mesh_normals_update(struct BMEditMesh *em);
void EDBM_mesh_clear(struct BMEditMesh *em);
void EDBM_mesh_normals_update_ex(BMEditMesh *em, const BMeshNormalsUpdate_Params *params);
void EDBM_mesh_normals_update(BMEditMesh *em);
void EDBM_mesh_clear(BMEditMesh *em);
void EDBM_selectmode_to_scene(struct bContext *C);
void EDBM_mesh_make(struct Object *ob, int select_mode, bool add_key_index);
void EDBM_selectmode_to_scene(bContext *C);
void EDBM_mesh_make(Object *ob, int select_mode, bool add_key_index);
/**
* Should only be called on the active edit-mesh, otherwise call #BKE_editmesh_free_data.
*/
void EDBM_mesh_free_data(struct BMEditMesh *em);
void EDBM_mesh_free_data(BMEditMesh *em);
/**
* \warning This can invalidate the #Mesh runtime cache of other objects (for linked duplicates).
* Most callers should run #DEG_id_tag_update on `ob->data`, see: #46738, #46913.
* This ensures #BKE_object_free_derived_caches runs on all objects that use this mesh.
*/
void EDBM_mesh_load_ex(struct Main *bmain, struct Object *ob, bool free_data);
void EDBM_mesh_load(struct Main *bmain, struct Object *ob);
void EDBM_mesh_load_ex(Main *bmain, Object *ob, bool free_data);
void EDBM_mesh_load(Main *bmain, Object *ob);
/**
* flushes based on the current select mode. If in vertex select mode,
@@ -98,22 +94,22 @@ void EDBM_mesh_load(struct Main *bmain, struct Object *ob);
* edges select/deselect faces and vertices, and in face select mode faces select/deselect
* edges and vertices.
*/
void EDBM_select_more(struct BMEditMesh *em, bool use_face_step);
void EDBM_select_less(struct BMEditMesh *em, bool use_face_step);
void EDBM_select_more(BMEditMesh *em, bool use_face_step);
void EDBM_select_less(BMEditMesh *em, bool use_face_step);
void EDBM_selectmode_flush_ex(struct BMEditMesh *em, short selectmode);
void EDBM_selectmode_flush(struct BMEditMesh *em);
void EDBM_selectmode_flush_ex(BMEditMesh *em, short selectmode);
void EDBM_selectmode_flush(BMEditMesh *em);
void EDBM_deselect_flush(struct BMEditMesh *em);
void EDBM_select_flush(struct BMEditMesh *em);
void EDBM_deselect_flush(BMEditMesh *em);
void EDBM_select_flush(BMEditMesh *em);
bool EDBM_vert_color_check(struct BMEditMesh *em);
bool EDBM_vert_color_check(BMEditMesh *em);
/**
* Swap is 0 or 1, if 1 it hides not selected.
*/
bool EDBM_mesh_hide(struct BMEditMesh *em, bool swap);
bool EDBM_mesh_reveal(struct BMEditMesh *em, bool select);
bool EDBM_mesh_hide(BMEditMesh *em, bool swap);
bool EDBM_mesh_reveal(BMEditMesh *em, bool select);
struct EDBMUpdate_Params {
uint calc_looptri : 1;
@@ -124,22 +120,22 @@ struct EDBMUpdate_Params {
/**
* So many tools call these that we better make it a generic function.
*/
void EDBM_update(struct Mesh *me, const struct EDBMUpdate_Params *params);
void EDBM_update(Mesh *me, const EDBMUpdate_Params *params);
/**
* Bad level call from Python API.
*/
void EDBM_update_extern(struct Mesh *me, bool do_tessellation, bool is_destructive);
void EDBM_update_extern(Mesh *me, bool do_tessellation, bool is_destructive);
/**
* A specialized vert map used by stitch operator.
*/
struct UvElementMap *BM_uv_element_map_create(struct BMesh *bm,
const struct Scene *scene,
bool uv_selected,
bool use_winding,
bool use_seams,
bool do_islands);
void BM_uv_element_map_free(struct UvElementMap *element_map);
UvElementMap *BM_uv_element_map_create(BMesh *bm,
const Scene *scene,
bool uv_selected,
bool use_winding,
bool use_seams,
bool do_islands);
void BM_uv_element_map_free(UvElementMap *element_map);
/**
* Return the #UvElement associated with a given #BMLoop, or NULL if no association exists.
@@ -148,71 +144,58 @@ void BM_uv_element_map_free(struct UvElementMap *element_map);
* \param l: The loop to search for.
* \return The #UvElement associated with #l, or NULL if not found. (e.g. the vertex is hidden.)
*/
struct UvElement *BM_uv_element_get(const struct UvElementMap *element_map,
const struct BMLoop *l);
struct UvElement *BM_uv_element_get_head(struct UvElementMap *element_map,
struct UvElement *child);
int BM_uv_element_get_unique_index(struct UvElementMap *element_map, struct UvElement *child);
UvElement *BM_uv_element_get(const UvElementMap *element_map, const BMLoop *l);
UvElement *BM_uv_element_get_head(UvElementMap *element_map, UvElement *child);
int BM_uv_element_get_unique_index(UvElementMap *element_map, UvElement *child);
struct UvElement **BM_uv_element_map_ensure_head_table(struct UvElementMap *element_map);
int *BM_uv_element_map_ensure_unique_index(struct UvElementMap *element_map);
UvElement **BM_uv_element_map_ensure_head_table(UvElementMap *element_map);
int *BM_uv_element_map_ensure_unique_index(UvElementMap *element_map);
/**
* Can we edit UVs for this mesh?
*/
bool EDBM_uv_check(struct BMEditMesh *em);
bool EDBM_uv_check(BMEditMesh *em);
/**
* last_sel, use em->act_face otherwise get the last selected face in the editselections
* at the moment, last_sel is mainly useful for making sure the space image doesn't flicker.
*/
struct BMFace *EDBM_uv_active_face_get(struct BMEditMesh *em, bool sloppy, bool selected);
BMFace *EDBM_uv_active_face_get(BMEditMesh *em, bool sloppy, bool selected);
void BM_uv_vert_map_free(struct UvVertMap *vmap);
struct UvMapVert *BM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int v);
void BM_uv_vert_map_free(UvVertMap *vmap);
UvMapVert *BM_uv_vert_map_at_index(UvVertMap *vmap, unsigned int v);
/**
* Return a new #UvVertMap from the edit-mesh.
*/
struct UvVertMap *BM_uv_vert_map_create(struct BMesh *bm, bool use_select);
UvVertMap *BM_uv_vert_map_create(BMesh *bm, bool use_select);
void EDBM_flag_enable_all(struct BMEditMesh *em, char hflag);
void EDBM_flag_disable_all(struct BMEditMesh *em, char hflag);
void EDBM_flag_enable_all(BMEditMesh *em, char hflag);
void EDBM_flag_disable_all(BMEditMesh *em, char hflag);
bool BMBVH_EdgeVisible(struct BMBVHTree *tree,
struct BMEdge *e,
struct Depsgraph *depsgraph,
struct ARegion *region,
struct View3D *v3d,
struct Object *obedit);
bool BMBVH_EdgeVisible(BMBVHTree *tree,
BMEdge *e,
Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
Object *obedit);
void EDBM_project_snap_verts(struct bContext *C,
struct Depsgraph *depsgraph,
struct ARegion *region,
struct Object *obedit,
struct BMEditMesh *em);
void EDBM_project_snap_verts(
bContext *C, Depsgraph *depsgraph, ARegion *region, Object *obedit, BMEditMesh *em);
/* `editmesh_automerge.cc` */
void EDBM_automerge(struct Object *obedit, bool update, char hflag, float dist);
void EDBM_automerge_and_split(struct Object *obedit,
bool split_edges,
bool split_faces,
bool update,
char hflag,
float dist);
void EDBM_automerge(Object *obedit, bool update, char hflag, float dist);
void EDBM_automerge_and_split(
Object *obedit, bool split_edges, bool split_faces, bool update, char hflag, float dist);
/* editmesh_undo.cc */
/** Export for ED_undo_sys. */
void ED_mesh_undosys_type(struct UndoType *ut);
void ED_mesh_undosys_type(UndoType *ut);
/* editmesh_select.cc */
void EDBM_select_mirrored(struct BMEditMesh *em,
const struct Mesh *me,
int axis,
bool extend,
int *r_totmirr,
int *r_totfail);
void EDBM_select_mirrored(
BMEditMesh *em, const Mesh *me, int axis, bool extend, int *r_totmirr, int *r_totfail);
/**
* Nearest vertex under the cursor.
@@ -225,25 +208,25 @@ void EDBM_select_mirrored(struct BMEditMesh *em,
* - When false, unselected vertices are given the bias.
* \param use_cycle: Cycle over elements within #FIND_NEAR_CYCLE_THRESHOLD_MIN in order of index.
*/
struct BMVert *EDBM_vert_find_nearest_ex(struct ViewContext *vc,
float *dist_px_manhattan_p,
bool use_select_bias,
bool use_cycle,
struct Base **bases,
uint bases_len,
uint *r_base_index);
struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p);
BMVert *EDBM_vert_find_nearest_ex(ViewContext *vc,
float *dist_px_manhattan_p,
bool use_select_bias,
bool use_cycle,
Base **bases,
uint bases_len,
uint *r_base_index);
BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *dist_px_manhattan_p);
struct BMEdge *EDBM_edge_find_nearest_ex(struct ViewContext *vc,
float *dist_px_manhattan,
float *r_dist_center,
bool use_select_bias,
bool use_cycle,
struct BMEdge **r_eed_zbuf,
struct Base **bases,
uint bases_len,
uint *r_base_index);
struct BMEdge *EDBM_edge_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p);
BMEdge *EDBM_edge_find_nearest_ex(ViewContext *vc,
float *dist_px_manhattan,
float *r_dist_center,
bool use_select_bias,
bool use_cycle,
BMEdge **r_eed_zbuf,
Base **bases,
uint bases_len,
uint *r_base_index);
BMEdge *EDBM_edge_find_nearest(ViewContext *vc, float *dist_px_manhattan_p);
/**
* \param use_zbuf_single_px: Special case, when using the back-buffer selection,
@@ -252,47 +235,45 @@ struct BMEdge *EDBM_edge_find_nearest(struct ViewContext *vc, float *dist_px_man
* it's reasonable that some callers might want to expand the region too. So add an argument to do
* this,
*/
struct BMFace *EDBM_face_find_nearest_ex(struct ViewContext *vc,
float *dist_px_manhattan,
float *r_dist_center,
bool use_zbuf_single_px,
bool use_select_bias,
bool use_cycle,
struct BMFace **r_efa_zbuf,
struct Base **bases,
uint bases_len,
uint *r_base_index);
struct BMFace *EDBM_face_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p);
BMFace *EDBM_face_find_nearest_ex(ViewContext *vc,
float *dist_px_manhattan,
float *r_dist_center,
bool use_zbuf_single_px,
bool use_select_bias,
bool use_cycle,
BMFace **r_efa_zbuf,
Base **bases,
uint bases_len,
uint *r_base_index);
BMFace *EDBM_face_find_nearest(ViewContext *vc, float *dist_px_manhattan_p);
bool EDBM_unified_findnearest(struct ViewContext *vc,
struct Base **bases,
bool EDBM_unified_findnearest(ViewContext *vc,
Base **bases,
uint bases_len,
int *r_base_index,
struct BMVert **r_eve,
struct BMEdge **r_eed,
struct BMFace **r_efa);
BMVert **r_eve,
BMEdge **r_eed,
BMFace **r_efa);
bool EDBM_unified_findnearest_from_raycast(struct ViewContext *vc,
struct Base **bases,
bool EDBM_unified_findnearest_from_raycast(ViewContext *vc,
Base **bases,
uint bases_len,
bool use_boundary_vertices,
bool use_boundary_edges,
int *r_base_index_vert,
int *r_base_index_edge,
int *r_base_index_face,
struct BMVert **r_eve,
struct BMEdge **r_eed,
struct BMFace **r_efa);
BMVert **r_eve,
BMEdge **r_eed,
BMFace **r_efa);
bool EDBM_select_pick(struct bContext *C,
const int mval[2],
const struct SelectPick_Params *params);
bool EDBM_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params);
/**
* When switching select mode, makes sure selection is consistent for editing
* also for paranoia checks to make sure edge or face mode works.
*/
void EDBM_selectmode_set(struct BMEditMesh *em);
void EDBM_selectmode_set(BMEditMesh *em);
/**
* Expand & Contract the Selection
* (used when changing modes and Ctrl key held)
@@ -307,17 +288,17 @@ void EDBM_selectmode_set(struct BMEditMesh *em);
* - face -> vert
* - edge -> vert
*/
void EDBM_selectmode_convert(struct BMEditMesh *em, short selectmode_old, short selectmode_new);
void EDBM_selectmode_convert(BMEditMesh *em, short selectmode_old, short selectmode_new);
/**
* User access this.
*/
bool EDBM_selectmode_set_multi(struct bContext *C, short selectmode);
bool EDBM_selectmode_set_multi(bContext *C, short selectmode);
/**
* User facing function, does notification.
*/
bool EDBM_selectmode_toggle_multi(
struct bContext *C, short selectmode_new, int action, bool use_extend, bool use_expand);
bContext *C, short selectmode_new, int action, bool use_extend, bool use_expand);
/**
* Use to disable a select-mode if its enabled, Using another mode as a fallback
@@ -325,79 +306,75 @@ bool EDBM_selectmode_toggle_multi(
*
* \return true if the mode is changed.
*/
bool EDBM_selectmode_disable(struct Scene *scene,
struct BMEditMesh *em,
bool EDBM_selectmode_disable(Scene *scene,
BMEditMesh *em,
short selectmode_disable,
short selectmode_fallback);
bool EDBM_deselect_by_material(struct BMEditMesh *em, short index, bool select);
bool EDBM_deselect_by_material(BMEditMesh *em, short index, bool select);
void EDBM_select_toggle_all(struct BMEditMesh *em);
void EDBM_select_toggle_all(BMEditMesh *em);
void EDBM_select_swap(struct BMEditMesh *em); /* exported for UV */
bool EDBM_select_interior_faces(struct BMEditMesh *em);
void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc); /* rename? */
void EDBM_select_swap(BMEditMesh *em); /* exported for UV */
bool EDBM_select_interior_faces(BMEditMesh *em);
void em_setup_viewcontext(bContext *C, ViewContext *vc); /* rename? */
bool EDBM_mesh_deselect_all_multi_ex(struct Base **bases, uint bases_len);
bool EDBM_mesh_deselect_all_multi(struct bContext *C);
bool EDBM_selectmode_disable_multi_ex(struct Scene *scene,
struct Base **bases,
bool EDBM_mesh_deselect_all_multi_ex(Base **bases, uint bases_len);
bool EDBM_mesh_deselect_all_multi(bContext *C);
bool EDBM_selectmode_disable_multi_ex(Scene *scene,
Base **bases,
uint bases_len,
short selectmode_disable,
short selectmode_fallback);
bool EDBM_selectmode_disable_multi(struct bContext *C,
bool EDBM_selectmode_disable_multi(bContext *C,
short selectmode_disable,
short selectmode_fallback);
/* `editmesh_preselect_edgering.cc` */
struct EditMesh_PreSelEdgeRing;
struct EditMesh_PreSelEdgeRing *EDBM_preselect_edgering_create(void);
void EDBM_preselect_edgering_destroy(struct EditMesh_PreSelEdgeRing *psel);
void EDBM_preselect_edgering_clear(struct EditMesh_PreSelEdgeRing *psel);
void EDBM_preselect_edgering_draw(struct EditMesh_PreSelEdgeRing *psel, const float matrix[4][4]);
void EDBM_preselect_edgering_update_from_edge(struct EditMesh_PreSelEdgeRing *psel,
struct BMesh *bm,
struct BMEdge *eed_start,
struct EditMesh_PreSelEdgeRing *EDBM_preselect_edgering_create();
void EDBM_preselect_edgering_destroy(EditMesh_PreSelEdgeRing *psel);
void EDBM_preselect_edgering_clear(EditMesh_PreSelEdgeRing *psel);
void EDBM_preselect_edgering_draw(EditMesh_PreSelEdgeRing *psel, const float matrix[4][4]);
void EDBM_preselect_edgering_update_from_edge(EditMesh_PreSelEdgeRing *psel,
BMesh *bm,
BMEdge *eed_start,
int previewlines,
const float (*coords)[3]);
/* `editmesh_preselect_elem.cc` */
struct EditMesh_PreSelElem;
typedef enum eEditMesh_PreSelPreviewAction {
enum eEditMesh_PreSelPreviewAction {
PRESELECT_ACTION_TRANSFORM = 1,
PRESELECT_ACTION_CREATE = 2,
PRESELECT_ACTION_DELETE = 3,
} eEditMesh_PreSelPreviewAction;
};
struct EditMesh_PreSelElem *EDBM_preselect_elem_create(void);
void EDBM_preselect_elem_destroy(struct EditMesh_PreSelElem *psel);
void EDBM_preselect_elem_clear(struct EditMesh_PreSelElem *psel);
void EDBM_preselect_preview_clear(struct EditMesh_PreSelElem *psel);
void EDBM_preselect_elem_draw(struct EditMesh_PreSelElem *psel, const float matrix[4][4]);
void EDBM_preselect_elem_update_from_single(struct EditMesh_PreSelElem *psel,
struct BMesh *bm,
struct BMElem *ele,
EditMesh_PreSelElem *EDBM_preselect_elem_create();
void EDBM_preselect_elem_destroy(EditMesh_PreSelElem *psel);
void EDBM_preselect_elem_clear(EditMesh_PreSelElem *psel);
void EDBM_preselect_preview_clear(EditMesh_PreSelElem *psel);
void EDBM_preselect_elem_draw(EditMesh_PreSelElem *psel, const float matrix[4][4]);
void EDBM_preselect_elem_update_from_single(EditMesh_PreSelElem *psel,
BMesh *bm,
BMElem *ele,
const float (*coords)[3]);
void EDBM_preselect_elem_update_preview(struct EditMesh_PreSelElem *psel,
struct ViewContext *vc,
struct BMesh *bm,
struct BMElem *ele,
const int mval[2]);
void EDBM_preselect_action_set(struct EditMesh_PreSelElem *psel,
eEditMesh_PreSelPreviewAction action);
eEditMesh_PreSelPreviewAction EDBM_preselect_action_get(struct EditMesh_PreSelElem *psel);
void EDBM_preselect_elem_update_preview(
EditMesh_PreSelElem *psel, ViewContext *vc, BMesh *bm, BMElem *ele, const int mval[2]);
void EDBM_preselect_action_set(EditMesh_PreSelElem *psel, eEditMesh_PreSelPreviewAction action);
eEditMesh_PreSelPreviewAction EDBM_preselect_action_get(EditMesh_PreSelElem *psel);
/* `mesh_ops.cc` */
void ED_operatortypes_mesh(void);
void ED_operatormacros_mesh(void);
void ED_operatortypes_mesh();
void ED_operatormacros_mesh();
/**
* Note mesh keymap also for other space?
*/
void ED_keymap_mesh(struct wmKeyConfig *keyconf);
void ED_keymap_mesh(wmKeyConfig *keyconf);
/* editface.cc */
@@ -405,76 +382,65 @@ void ED_keymap_mesh(struct wmKeyConfig *keyconf);
* Copy the face flags, most importantly selection from the mesh to the final derived mesh,
* use in object mode when selecting faces (while painting).
*/
void paintface_flush_flags(struct bContext *C,
struct Object *ob,
bool flush_selection,
bool flush_hidden);
void paintface_flush_flags(bContext *C, Object *ob, bool flush_selection, bool flush_hidden);
/**
* \return True when pick finds an element or the selection changed.
*/
bool paintface_mouse_select(struct bContext *C,
bool paintface_mouse_select(bContext *C,
const int mval[2],
const struct SelectPick_Params *params,
struct Object *ob);
bool paintface_deselect_all_visible(struct bContext *C,
struct Object *ob,
int action,
bool flush_flags);
void paintface_select_linked(struct bContext *C,
struct Object *ob,
const int mval[2],
bool select);
const SelectPick_Params *params,
Object *ob);
bool paintface_deselect_all_visible(bContext *C, Object *ob, int action, bool flush_flags);
void paintface_select_linked(bContext *C, Object *ob, const int mval[2], bool select);
void paintface_select_loop(struct bContext *C, struct Object *ob, const int mval[2], bool select);
void paintface_select_loop(bContext *C, Object *ob, const int mval[2], bool select);
/**
* Grow the selection of faces.
* \param face_step: If true will also select faces that only touch on the corner.
*/
void paintface_select_more(struct Mesh *mesh, bool face_step);
void paintface_select_less(struct Mesh *mesh, bool face_step);
bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]);
void paintface_select_more(Mesh *mesh, bool face_step);
void paintface_select_less(Mesh *mesh, bool face_step);
bool paintface_minmax(Object *ob, float r_min[3], float r_max[3]);
void paintface_hide(struct bContext *C, struct Object *ob, bool unselected);
void paintface_reveal(struct bContext *C, struct Object *ob, bool select);
void paintface_hide(bContext *C, Object *ob, bool unselected);
void paintface_reveal(bContext *C, Object *ob, bool select);
/**
* \note if the caller passes false to flush_flags,
* then they will need to run #paintvert_flush_flags(ob) themselves.
*/
bool paintvert_deselect_all_visible(struct Object *ob, int action, bool flush_flags);
void paintvert_select_ungrouped(struct Object *ob, bool extend, bool flush_flags);
bool paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags);
void paintvert_select_ungrouped(Object *ob, bool extend, bool flush_flags);
/**
* (similar to void `paintface_flush_flags(Object *ob)`)
* copy the vertex flags, most importantly selection from the mesh to the final derived mesh,
* use in object mode when selecting vertices (while painting).
*/
void paintvert_flush_flags(struct Object *ob);
void paintvert_tag_select_update(struct bContext *C, struct Object *ob);
void paintvert_flush_flags(Object *ob);
void paintvert_tag_select_update(bContext *C, Object *ob);
/* Select vertices that are connected to already selected vertices. */
void paintvert_select_linked(struct bContext *C, struct Object *ob);
void paintvert_select_linked(bContext *C, Object *ob);
/* Select vertices that are linked to the vertex under the given region space coordinates. */
void paintvert_select_linked_pick(struct bContext *C,
struct Object *ob,
void paintvert_select_linked_pick(bContext *C,
Object *ob,
const int region_coordinates[2],
bool select);
void paintvert_select_more(struct Mesh *mesh, bool face_step);
void paintvert_select_less(struct Mesh *mesh, bool face_step);
void paintvert_hide(struct bContext *C, struct Object *ob, bool unselected);
void paintvert_reveal(struct bContext *C, struct Object *ob, bool select);
void paintvert_select_more(Mesh *mesh, bool face_step);
void paintvert_select_less(Mesh *mesh, bool face_step);
void paintvert_hide(bContext *C, Object *ob, bool unselected);
void paintvert_reveal(bContext *C, Object *ob, bool select);
/* mirrtopo */
typedef struct MirrTopoStore_t {
struct MirrTopoStore_t {
intptr_t *index_lookup;
int prev_vert_tot;
int prev_edge_tot;
bool prev_is_editmode;
} MirrTopoStore_t;
};
bool ED_mesh_mirrtopo_recalc_check(struct BMEditMesh *em,
struct Mesh *me,
MirrTopoStore_t *mesh_topo_store);
void ED_mesh_mirrtopo_init(struct BMEditMesh *em,
struct Mesh *me,
bool ED_mesh_mirrtopo_recalc_check(BMEditMesh *em, Mesh *me, MirrTopoStore_t *mesh_topo_store);
void ED_mesh_mirrtopo_init(BMEditMesh *em,
Mesh *me,
MirrTopoStore_t *mesh_topo_store,
bool skip_em_vert_array_init);
void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
@@ -485,20 +451,17 @@ void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
#define WEIGHT_ADD 2
#define WEIGHT_SUBTRACT 3
bool ED_vgroup_sync_from_pose(struct Object *ob);
void ED_vgroup_select_by_name(struct Object *ob, const char *name);
bool ED_vgroup_sync_from_pose(Object *ob);
void ED_vgroup_select_by_name(Object *ob, const char *name);
/**
* Removes out of range #MDeformWeights
*/
void ED_vgroup_data_clamp_range(struct ID *id, int total);
void ED_vgroup_data_clamp_range(ID *id, int total);
/**
* Matching index only.
*/
bool ED_vgroup_array_copy(struct Object *ob, struct Object *ob_from);
bool ED_vgroup_parray_alloc(struct ID *id,
struct MDeformVert ***dvert_arr,
int *dvert_tot,
bool use_vert_sel);
bool ED_vgroup_array_copy(Object *ob, Object *ob_from);
bool ED_vgroup_parray_alloc(ID *id, MDeformVert ***dvert_arr, int *dvert_tot, bool use_vert_sel);
/**
* For use with tools that use ED_vgroup_parray_alloc with \a use_vert_sel == true.
* This finds the unselected mirror deform verts and copies the weights to them from the selected.
@@ -506,8 +469,8 @@ bool ED_vgroup_parray_alloc(struct ID *id,
* \note \a dvert_array has mirrored weights filled in,
* in case cleanup operations are needed on both.
*/
void ED_vgroup_parray_mirror_sync(struct Object *ob,
struct MDeformVert **dvert_array,
void ED_vgroup_parray_mirror_sync(Object *ob,
MDeformVert **dvert_array,
int dvert_tot,
const bool *vgroup_validmap,
int vgroup_tot);
@@ -516,25 +479,23 @@ void ED_vgroup_parray_mirror_sync(struct Object *ob,
*
* similar to #ED_vgroup_parray_mirror_sync but only fill in mirror points.
*/
void ED_vgroup_parray_mirror_assign(struct Object *ob,
struct MDeformVert **dvert_array,
int dvert_tot);
void ED_vgroup_parray_remove_zero(struct MDeformVert **dvert_array,
void ED_vgroup_parray_mirror_assign(Object *ob, MDeformVert **dvert_array, int dvert_tot);
void ED_vgroup_parray_remove_zero(MDeformVert **dvert_array,
int dvert_tot,
const bool *vgroup_validmap,
int vgroup_tot,
float epsilon,
bool keep_single);
void ED_vgroup_parray_to_weight_array(const struct MDeformVert **dvert_array,
void ED_vgroup_parray_to_weight_array(const MDeformVert **dvert_array,
int dvert_tot,
float *dvert_weights,
int def_nr);
void ED_vgroup_parray_from_weight_array(struct MDeformVert **dvert_array,
void ED_vgroup_parray_from_weight_array(MDeformVert **dvert_array,
int dvert_tot,
const float *dvert_weights,
int def_nr,
bool remove_zero);
void ED_vgroup_mirror(struct Object *ob,
void ED_vgroup_mirror(Object *ob,
bool mirror_weights,
bool flip_vgroups,
bool all_vgroups,
@@ -545,103 +506,98 @@ void ED_vgroup_mirror(struct Object *ob,
/**
* Called while not in editmode.
*/
void ED_vgroup_vert_add(
struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode);
void ED_vgroup_vert_add(Object *ob, bDeformGroup *dg, int vertnum, float weight, int assignmode);
/**
* Mesh object mode, lattice can be in edit-mode.
*/
void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum);
float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum);
void ED_vgroup_vert_remove(Object *ob, bDeformGroup *dg, int vertnum);
float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum);
/**
* Use when adjusting the active vertex weight and apply to mirror vertices.
*/
void ED_vgroup_vert_active_mirror(struct Object *ob, int def_nr);
void ED_vgroup_vert_active_mirror(Object *ob, int def_nr);
/* mesh_data.cc */
void ED_mesh_verts_add(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_loops_add(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_faces_add(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_verts_add(Mesh *mesh, ReportList *reports, int count);
void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count);
void ED_mesh_loops_add(Mesh *mesh, ReportList *reports, int count);
void ED_mesh_faces_add(Mesh *mesh, ReportList *reports, int count);
void ED_mesh_verts_remove(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_edges_remove(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_loops_remove(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_faces_remove(struct Mesh *mesh, struct ReportList *reports, int count);
void ED_mesh_verts_remove(Mesh *mesh, ReportList *reports, int count);
void ED_mesh_edges_remove(Mesh *mesh, ReportList *reports, int count);
void ED_mesh_loops_remove(Mesh *mesh, ReportList *reports, int count);
void ED_mesh_faces_remove(Mesh *mesh, ReportList *reports, int count);
void ED_mesh_geometry_clear(struct Mesh *mesh);
void ED_mesh_geometry_clear(Mesh *mesh);
bool *ED_mesh_uv_map_vert_select_layer_ensure(struct Mesh *mesh, int uv_map_index);
bool *ED_mesh_uv_map_edge_select_layer_ensure(struct Mesh *mesh, int uv_map_index);
bool *ED_mesh_uv_map_pin_layer_ensure(struct Mesh *mesh, int uv_map_index);
const bool *ED_mesh_uv_map_vert_select_layer_get(const struct Mesh *mesh, int uv_map_index);
const bool *ED_mesh_uv_map_edge_select_layer_get(const struct Mesh *mesh, int uv_map_index);
const bool *ED_mesh_uv_map_pin_layer_get(const struct Mesh *mesh, int uv_map_index);
bool *ED_mesh_uv_map_vert_select_layer_ensure(Mesh *mesh, int uv_map_index);
bool *ED_mesh_uv_map_edge_select_layer_ensure(Mesh *mesh, int uv_map_index);
bool *ED_mesh_uv_map_pin_layer_ensure(Mesh *mesh, int uv_map_index);
const bool *ED_mesh_uv_map_vert_select_layer_get(const Mesh *mesh, int uv_map_index);
const bool *ED_mesh_uv_map_edge_select_layer_get(const Mesh *mesh, int uv_map_index);
const bool *ED_mesh_uv_map_pin_layer_get(const Mesh *mesh, int uv_map_index);
void ED_mesh_uv_ensure(struct Mesh *me, const char *name);
int ED_mesh_uv_add(
struct Mesh *me, const char *name, bool active_set, bool do_init, struct ReportList *reports);
void ED_mesh_uv_ensure(Mesh *me, const char *name);
int ED_mesh_uv_add(Mesh *me, const char *name, bool active_set, bool do_init, ReportList *reports);
void ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me);
void ED_mesh_uv_loop_reset(bContext *C, Mesh *me);
/**
* Without a #bContext, called when UV-editing.
*/
void ED_mesh_uv_loop_reset_ex(struct Mesh *me, int layernum);
bool ED_mesh_color_ensure(struct Mesh *me, const char *name);
void ED_mesh_uv_loop_reset_ex(Mesh *me, int layernum);
bool ED_mesh_color_ensure(Mesh *me, const char *name);
int ED_mesh_color_add(
struct Mesh *me, const char *name, bool active_set, bool do_init, struct ReportList *reports);
Mesh *me, const char *name, bool active_set, bool do_init, ReportList *reports);
void ED_mesh_report_mirror(struct wmOperator *op, int totmirr, int totfail);
void ED_mesh_report_mirror_ex(struct wmOperator *op, int totmirr, int totfail, char selectmode);
void ED_mesh_report_mirror(wmOperator *op, int totmirr, int totfail);
void ED_mesh_report_mirror_ex(wmOperator *op, int totmirr, int totfail, char selectmode);
/**
* Returns the pinned mesh, the mesh from the pinned object, or the mesh from the active object.
*/
struct Mesh *ED_mesh_context(struct bContext *C);
Mesh *ED_mesh_context(bContext *C);
/**
* Split all edges that would appear sharp based on face and edge sharpness tags and the
* auto smooth angle.
*/
void ED_mesh_split_faces(struct Mesh *mesh);
void ED_mesh_split_faces(Mesh *mesh);
/* mesh backup */
typedef struct BMBackup {
struct BMesh *bmcopy;
} BMBackup;
struct BMBackup {
BMesh *bmcopy;
};
/**
* Save a copy of the #BMesh for restoring later.
*/
struct BMBackup EDBM_redo_state_store(struct BMEditMesh *em);
BMBackup EDBM_redo_state_store(BMEditMesh *em);
/**
* Restore a BMesh from backup.
*/
void EDBM_redo_state_restore(struct BMBackup *backup, struct BMEditMesh *em, bool recalc_looptri)
void EDBM_redo_state_restore(BMBackup *backup, BMEditMesh *em, bool recalc_looptri)
ATTR_NONNULL(1, 2);
/**
* Delete the backup, flushing it to an edit-mesh.
*/
void EDBM_redo_state_restore_and_free(struct BMBackup *backup,
struct BMEditMesh *em,
bool recalc_looptri) ATTR_NONNULL(1, 2);
void EDBM_redo_state_free(struct BMBackup *backup) ATTR_NONNULL(1);
void EDBM_redo_state_restore_and_free(BMBackup *backup, BMEditMesh *em, bool recalc_looptri)
ATTR_NONNULL(1, 2);
void EDBM_redo_state_free(BMBackup *backup) ATTR_NONNULL(1);
/* *** meshtools.cc *** */
int ED_mesh_join_objects_exec(struct bContext *C, struct wmOperator *op);
int ED_mesh_shapes_join_objects_exec(struct bContext *C, struct wmOperator *op);
int ED_mesh_join_objects_exec(bContext *C, wmOperator *op);
int ED_mesh_shapes_join_objects_exec(bContext *C, wmOperator *op);
/* mirror lookup api */
/* Spatial Mirror */
void ED_mesh_mirror_spatial_table_begin(struct Object *ob,
struct BMEditMesh *em,
struct Mesh *me_eval);
void ED_mesh_mirror_spatial_table_end(struct Object *ob);
int ED_mesh_mirror_spatial_table_lookup(struct Object *ob,
struct BMEditMesh *em,
struct Mesh *me_eval,
void ED_mesh_mirror_spatial_table_begin(Object *ob, BMEditMesh *em, Mesh *me_eval);
void ED_mesh_mirror_spatial_table_end(Object *ob);
int ED_mesh_mirror_spatial_table_lookup(Object *ob,
BMEditMesh *em,
Mesh *me_eval,
const float co[3]);
/* Topology Mirror */
@@ -651,65 +607,52 @@ int ED_mesh_mirror_spatial_table_lookup(struct Object *ob,
* \note This is supposed return -1 on error,
* which callers are currently checking for, but is not used so far.
*/
void ED_mesh_mirror_topo_table_begin(struct Object *ob, struct Mesh *me_eval);
void ED_mesh_mirror_topo_table_end(struct Object *ob);
void ED_mesh_mirror_topo_table_begin(Object *ob, Mesh *me_eval);
void ED_mesh_mirror_topo_table_end(Object *ob);
/**
* Retrieves mirrored cache vert, or NULL if there isn't one.
* \note calling this without ensuring the mirror cache state is bad.
*/
int mesh_get_x_mirror_vert(struct Object *ob, struct Mesh *me_eval, int index, bool use_topology);
struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob,
struct BMEditMesh *em,
struct BMVert *eve,
const float co[3],
int index,
bool use_topology);
int mesh_get_x_mirror_vert(Object *ob, Mesh *me_eval, int index, bool use_topology);
BMVert *editbmesh_get_x_mirror_vert(
Object *ob, BMEditMesh *em, BMVert *eve, const float co[3], int index, bool use_topology);
/**
* This is a Mesh-based copy of #mesh_get_x_mirror_faces().
*/
int *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em, struct Mesh *me_eval);
int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em, Mesh *me_eval);
/**
* Wrapper for object-mode/edit-mode.
*
* call #BM_mesh_elem_table_ensure first for edit-mesh.
*/
int ED_mesh_mirror_get_vert(struct Object *ob, int index);
int ED_mesh_mirror_get_vert(Object *ob, int index);
bool ED_mesh_pick_vert(struct bContext *C,
struct Object *ob,
const int mval[2],
uint dist_px,
bool use_zbuf,
uint *r_index);
bool ED_mesh_pick_vert(
bContext *C, Object *ob, const int mval[2], uint dist_px, bool use_zbuf, uint *r_index);
/**
* Face selection in object mode,
* currently only weight-paint and vertex-paint use this.
*
* \return boolean true == Found
*/
bool ED_mesh_pick_face(
struct bContext *C, struct Object *ob, const int mval[2], uint dist_px, uint *r_index);
bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], uint dist_px, uint *r_index);
/**
* Use when the back buffer stores face index values. but we want a vert.
* This gets the face then finds the closest vertex to mval.
*/
bool ED_mesh_pick_face_vert(
struct bContext *C, struct Object *ob, const int mval[2], uint dist_px, uint *r_index);
bContext *C, Object *ob, const int mval[2], uint dist_px, uint *r_index);
struct MDeformVert *ED_mesh_active_dvert_get_em(struct Object *ob, struct BMVert **r_eve);
struct MDeformVert *ED_mesh_active_dvert_get_ob(struct Object *ob, int *r_index);
struct MDeformVert *ED_mesh_active_dvert_get_only(struct Object *ob);
MDeformVert *ED_mesh_active_dvert_get_em(Object *ob, BMVert **r_eve);
MDeformVert *ED_mesh_active_dvert_get_ob(Object *ob, int *r_index);
MDeformVert *ED_mesh_active_dvert_get_only(Object *ob);
void EDBM_mesh_stats_multi(struct Object **objects,
uint objects_len,
int totelem[3],
int totelem_sel[3]);
void EDBM_mesh_elem_index_ensure_multi(struct Object **objects, uint objects_len, char htype);
void EDBM_mesh_stats_multi(Object **objects, uint objects_len, int totelem[3], int totelem_sel[3]);
void EDBM_mesh_elem_index_ensure_multi(Object **objects, uint objects_len, char htype);
#define ED_MESH_PICK_DEFAULT_VERT_DIST 25
#define ED_MESH_PICK_DEFAULT_FACE_DIST 1
#define USE_LOOPSLIDE_HACK

View File

@@ -8,6 +8,7 @@
#pragma once
struct ARegion;
struct ID;
struct Main;
struct Scene;
@@ -39,79 +40,73 @@ ENUM_OPERATORS(NodeBorder, NODE_RIGHT)
/* clipboard.cc */
void ED_node_clipboard_free(void);
void ED_node_clipboard_free();
/* space_node.cc */
void ED_node_cursor_location_get(const struct SpaceNode *snode, float value[2]);
void ED_node_cursor_location_set(struct SpaceNode *snode, const float value[2]);
void ED_node_cursor_location_get(const SpaceNode *snode, float value[2]);
void ED_node_cursor_location_set(SpaceNode *snode, const float value[2]);
int ED_node_tree_path_length(struct SpaceNode *snode);
int ED_node_tree_path_length(SpaceNode *snode);
/**
* \param value: The path output at least the size of `ED_node_tree_path_length(snode) + 1`.
*/
void ED_node_tree_path_get(struct SpaceNode *snode, char *value);
void ED_node_tree_path_get(SpaceNode *snode, char *value);
void ED_node_tree_start(struct SpaceNode *snode,
struct bNodeTree *ntree,
struct ID *id,
struct ID *from);
void ED_node_tree_push(struct SpaceNode *snode, struct bNodeTree *ntree, struct bNode *gnode);
void ED_node_tree_pop(struct SpaceNode *snode);
int ED_node_tree_depth(struct SpaceNode *snode);
struct bNodeTree *ED_node_tree_get(struct SpaceNode *snode, int level);
void ED_node_tree_start(SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from);
void ED_node_tree_push(SpaceNode *snode, bNodeTree *ntree, bNode *gnode);
void ED_node_tree_pop(SpaceNode *snode);
int ED_node_tree_depth(SpaceNode *snode);
bNodeTree *ED_node_tree_get(SpaceNode *snode, int level);
void ED_node_set_active_viewer_key(struct SpaceNode *snode);
void ED_node_set_active_viewer_key(SpaceNode *snode);
/* drawnode.cc */
void ED_node_init_butfuncs(void);
void ED_init_custom_node_type(struct bNodeType *ntype);
void ED_init_custom_node_socket_type(struct bNodeSocketType *stype);
void ED_init_standard_node_socket_type(struct bNodeSocketType *stype);
void ED_init_node_socket_type_virtual(struct bNodeSocketType *stype);
void ED_node_init_butfuncs();
void ED_init_custom_node_type(bNodeType *ntype);
void ED_init_custom_node_socket_type(bNodeSocketType *stype);
void ED_init_standard_node_socket_type(bNodeSocketType *stype);
void ED_init_node_socket_type_virtual(bNodeSocketType *stype);
void ED_node_sample_set(const float col[4]);
void ED_node_draw_snap(
struct View2D *v2d, const float cent[2], float size, NodeBorder border, unsigned int pos);
View2D *v2d, const float cent[2], float size, NodeBorder border, unsigned int pos);
void ED_node_type_draw_color(const char *idname, float *r_color);
/* node_draw.cc */
void ED_node_tree_update(const struct bContext *C);
void ED_node_tag_update_id(struct ID *id);
void ED_node_tree_update(const bContext *C);
void ED_node_tag_update_id(ID *id);
float ED_node_grid_size(void);
float ED_node_grid_size();
/* node_edit.cc */
void ED_node_set_tree_type(struct SpaceNode *snode, struct bNodeTreeType *typeinfo);
bool ED_node_is_compositor(struct SpaceNode *snode);
bool ED_node_is_shader(struct SpaceNode *snode);
bool ED_node_is_texture(struct SpaceNode *snode);
bool ED_node_is_geometry(struct SpaceNode *snode);
bool ED_node_supports_preview(struct SpaceNode *snode);
void ED_node_set_tree_type(SpaceNode *snode, bNodeTreeType *typeinfo);
bool ED_node_is_compositor(SpaceNode *snode);
bool ED_node_is_shader(SpaceNode *snode);
bool ED_node_is_texture(SpaceNode *snode);
bool ED_node_is_geometry(SpaceNode *snode);
bool ED_node_supports_preview(SpaceNode *snode);
/**
* Assumes nothing being done in ntree yet, sets the default in/out node.
* Called from shading buttons or header.
*/
void ED_node_shader_default(const struct bContext *C, struct ID *id);
void ED_node_shader_default(const bContext *C, ID *id);
/**
* Assumes nothing being done in ntree yet, sets the default in/out node.
* Called from shading buttons or header.
*/
void ED_node_composit_default(const struct bContext *C, struct Scene *scene);
void ED_node_composit_default(const bContext *C, Scene *scene);
/**
* Assumes nothing being done in ntree yet, sets the default in/out node.
* Called from shading buttons or header.
*/
void ED_node_texture_default(const struct bContext *C, struct Tex *tex);
void ED_node_post_apply_transform(struct bContext *C, struct bNodeTree *ntree);
void ED_node_set_active(struct Main *bmain,
struct SpaceNode *snode,
struct bNodeTree *ntree,
struct bNode *node,
bool *r_active_texture_changed);
void ED_node_texture_default(const bContext *C, Tex *tex);
void ED_node_post_apply_transform(bContext *C, bNodeTree *ntree);
void ED_node_set_active(
Main *bmain, SpaceNode *snode, bNodeTree *ntree, bNode *node, bool *r_active_texture_changed);
/**
* Call after one or more node trees have been changed and tagged accordingly.
@@ -129,9 +124,7 @@ void ED_node_set_active(struct Main *bmain,
* for other things that have to be changed. It may still scan #bmain if the interface of the
* node tree has changed.
*/
void ED_node_tree_propagate_change(const struct bContext *C,
struct Main *bmain,
struct bNodeTree *ntree);
void ED_node_tree_propagate_change(const bContext *C, Main *bmain, bNodeTree *ntree);
/**
* \param scene_owner: is the owner of the job,
@@ -140,30 +133,22 @@ void ED_node_tree_propagate_change(const struct bContext *C,
*
* \note only call from spaces `refresh` callbacks, not direct! - use with care.
*/
void ED_node_composite_job(const struct bContext *C,
struct bNodeTree *nodetree,
struct Scene *scene_owner);
void ED_node_composite_job(const bContext *C, bNodeTree *nodetree, Scene *scene_owner);
/* node_ops.cc */
void ED_operatormacros_node(void);
void ED_operatormacros_node();
/* node_view.cc */
/**
* Returns mouse position in image space.
*/
bool ED_space_node_get_position(struct Main *bmain,
struct SpaceNode *snode,
struct ARegion *region,
const int mval[2],
float fpos[2]);
bool ED_space_node_get_position(
Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float fpos[2]);
/**
* Returns color in linear space, matching #ED_space_image_color_sample().
* And here we've got recursion in the comments tips...
*/
bool ED_space_node_color_sample(struct Main *bmain,
struct SpaceNode *snode,
struct ARegion *region,
const int mval[2],
float r_col[3]);
bool ED_space_node_color_sample(
Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float r_col[3]);

View File

@@ -12,8 +12,9 @@
#define NUM_MAX_ELEMENTS 3
struct wmEvent;
struct UnitSettings;
typedef struct NumInput {
struct NumInput {
/** idx_max < NUM_MAX_ELEMENTS */
short idx_max;
int unit_sys;
@@ -39,7 +40,7 @@ typedef struct NumInput {
/** Current position of cursor in edited value str
* (first byte of "current" letter, so 0 for an empty str) */
int str_cur;
} NumInput;
};
/** #NumInput.flag */
enum {
@@ -57,8 +58,6 @@ enum {
/* (1 << 9) and above are reserved for internal flags! */
};
struct UnitSettings;
/* -------------------------------------------------------------------- */
/** \name NumInput
* \{ */
@@ -81,13 +80,13 @@ void initNumInput(NumInput *n);
/**
* \param str: Must be NUM_STR_REP_LEN * (idx_max + 1) length.
*/
void outputNumInput(NumInput *n, char *str, struct UnitSettings *unit_settings);
void outputNumInput(NumInput *n, char *str, UnitSettings *unit_settings);
bool hasNumInput(const NumInput *n);
/**
* \warning \a vec must be set beforehand otherwise we risk uninitialized vars.
*/
bool applyNumInput(NumInput *n, float *vec);
bool handleNumInput(struct bContext *C, NumInput *n, const struct wmEvent *event);
bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event);
/** Share with `TFM_MODAL_CANCEL` in `transform.h`. */
#define NUM_MODAL_INCREMENT_UP 18
@@ -95,7 +94,7 @@ bool handleNumInput(struct bContext *C, NumInput *n, const struct wmEvent *event
bool user_string_to_number(bContext *C,
const char *str,
const struct UnitSettings *unit,
const UnitSettings *unit,
int type,
double *r_value,
bool use_single_line_error,

View File

@@ -17,6 +17,7 @@ struct Base;
struct Depsgraph;
struct EnumPropertyItem;
struct ID;
struct GpencilModifierData;
struct Main;
struct ModifierData;
struct Object;
@@ -39,13 +40,13 @@ struct wmOperatorType;
/* object_edit.cc */
/** `context.object` */
struct Object *ED_object_context(const struct bContext *C);
Object *ED_object_context(const bContext *C);
/**
* Find the correct active object per context (`context.object` or `context.active_object`)
* \note context can be NULL when called from a enum with #PROP_ENUM_NO_CONTEXT.
*/
struct Object *ED_object_active_context(const struct bContext *C);
void ED_collection_hide_menu_draw(const struct bContext *C, struct uiLayout *layout);
Object *ED_object_active_context(const bContext *C);
void ED_collection_hide_menu_draw(const bContext *C, uiLayout *layout);
/**
* Return an array of objects:
@@ -55,35 +56,31 @@ void ED_collection_hide_menu_draw(const struct bContext *C, struct uiLayout *lay
* the callers \a filter_fn needs to check of they are editable
* (assuming they need to be modified).
*/
Object **ED_object_array_in_mode_or_selected(struct bContext *C,
bool (*filter_fn)(const struct Object *ob,
void *user_data),
Object **ED_object_array_in_mode_or_selected(bContext *C,
bool (*filter_fn)(const Object *ob, void *user_data),
void *filter_user_data,
uint *r_objects_len);
/* `object_utils.cc` */
bool ED_object_calc_active_center_for_editmode(struct Object *obedit,
bool ED_object_calc_active_center_for_editmode(Object *obedit,
bool select_only,
float r_center[3]);
bool ED_object_calc_active_center_for_posemode(struct Object *ob,
bool select_only,
float r_center[3]);
bool ED_object_calc_active_center(struct Object *ob, bool select_only, float r_center[3]);
bool ED_object_calc_active_center_for_posemode(Object *ob, bool select_only, float r_center[3]);
bool ED_object_calc_active_center(Object *ob, bool select_only, float r_center[3]);
/* Object Data Container helper API. */
struct XFormObjectData_Container;
struct XFormObjectData_Container *ED_object_data_xform_container_create(void);
void ED_object_data_xform_container_destroy(struct XFormObjectData_Container *xds);
XFormObjectData_Container *ED_object_data_xform_container_create();
void ED_object_data_xform_container_destroy(XFormObjectData_Container *xds);
/**
* This may be called multiple times with the same data.
* Each time, the original transformations are re-applied, instead of accumulating the changes.
*/
void ED_object_data_xform_container_update_all(struct XFormObjectData_Container *xds,
struct Main *bmain,
struct Depsgraph *depsgraph);
void ED_object_data_xform_container_item_ensure(struct XFormObjectData_Container *xds,
struct Object *ob);
void ED_object_data_xform_container_update_all(XFormObjectData_Container *xds,
Main *bmain,
Depsgraph *depsgraph);
void ED_object_data_xform_container_item_ensure(XFormObjectData_Container *xds, Object *ob);
/* Object Skip-Child Container helper API. */
enum {
@@ -105,33 +102,33 @@ enum {
XFORM_OB_SKIP_CHILD_PARENT_APPLY = 2,
};
struct XFormObjectSkipChild_Container;
struct XFormObjectSkipChild_Container *ED_object_xform_skip_child_container_create(void);
XFormObjectSkipChild_Container *ED_object_xform_skip_child_container_create();
void ED_object_xform_skip_child_container_item_ensure_from_array(
struct XFormObjectSkipChild_Container *xcs,
const struct Scene *scene,
struct ViewLayer *view_layer,
struct Object **objects,
XFormObjectSkipChild_Container *xcs,
const Scene *scene,
ViewLayer *view_layer,
Object **objects,
uint objects_len);
void ED_object_xform_skip_child_container_destroy(struct XFormObjectSkipChild_Container *xcs);
void ED_object_xform_skip_child_container_update_all(struct XFormObjectSkipChild_Container *xcs,
struct Main *bmain,
struct Depsgraph *depsgraph);
void ED_object_xform_skip_child_container_item_ensure(struct XFormObjectSkipChild_Container *xcs,
struct Object *ob,
struct Object *ob_parent_recurse,
void ED_object_xform_skip_child_container_destroy(XFormObjectSkipChild_Container *xcs);
void ED_object_xform_skip_child_container_update_all(XFormObjectSkipChild_Container *xcs,
Main *bmain,
Depsgraph *depsgraph);
void ED_object_xform_skip_child_container_item_ensure(XFormObjectSkipChild_Container *xcs,
Object *ob,
Object *ob_parent_recurse,
int mode);
void ED_object_xform_array_m4(struct Object **objects, uint objects_len, const float matrix[4][4]);
void ED_object_xform_array_m4(Object **objects, uint objects_len, const float matrix[4][4]);
/* `object_ops.cc` */
void ED_operatortypes_object(void);
void ED_operatormacros_object(void);
void ED_keymap_object(struct wmKeyConfig *keyconf);
void ED_operatortypes_object();
void ED_operatormacros_object();
void ED_keymap_object(wmKeyConfig *keyconf);
/* `object_relations.cc` */
typedef enum eParentType {
enum eParentType {
PAR_OBJECT,
PAR_ARMATURE,
PAR_ARMATURE_NAME,
@@ -145,40 +142,40 @@ typedef enum eParentType {
PAR_LATTICE,
PAR_VERTEX,
PAR_VERTEX_TRI,
} eParentType;
};
typedef enum eObjectSelect_Mode {
enum eObjectSelect_Mode {
BA_DESELECT = 0,
BA_SELECT = 1,
BA_INVERT = 2,
} eObjectSelect_Mode;
};
typedef enum eObClearParentTypes {
enum eObClearParentTypes {
CLEAR_PARENT_ALL = 0,
CLEAR_PARENT_KEEP_TRANSFORM,
CLEAR_PARENT_INVERSE,
} eObClearParentTypes;
};
#ifdef __RNA_TYPES_H__
/** Operator Property: `OBJECT_OT_parent_clear`. */
extern struct EnumPropertyItem prop_clear_parent_types[];
extern EnumPropertyItem prop_clear_parent_types[];
/** Operator Property: `OBJECT_OT_parent_set`. */
extern struct EnumPropertyItem prop_make_parent_types[];
extern EnumPropertyItem prop_make_parent_types[];
#endif
/**
* Set the object's parent, return true if successful.
*/
bool ED_object_parent_set(struct ReportList *reports,
const struct bContext *C,
struct Scene *scene,
struct Object *const ob,
struct Object *const par,
bool ED_object_parent_set(ReportList *reports,
const bContext *C,
Scene *scene,
Object *const ob,
Object *const par,
int partype,
bool xmirror,
bool keep_transform,
const int vert_par[3]);
void ED_object_parent_clear(struct Object *ob, int type);
void ED_object_parent_clear(Object *ob, int type);
/**
* Simple API for object selection, rather than just using the flag
@@ -188,38 +185,31 @@ void ED_object_parent_clear(struct Object *ob, int type);
* \note Caller must send a `NC_SCENE | ND_OB_SELECT` notifier
* (or a `NC_SCENE | ND_OB_VISIBLE` in case of visibility toggling).
*/
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode);
void ED_object_base_select(Base *base, eObjectSelect_Mode mode);
/**
* Change active base, it includes the notifier
*/
void ED_object_base_activate(struct bContext *C, struct Base *base);
void ED_object_base_activate_with_mode_exit_if_needed(struct bContext *C, struct Base *base);
void ED_object_base_activate(bContext *C, Base *base);
void ED_object_base_activate_with_mode_exit_if_needed(bContext *C, Base *base);
/**
* Call when the active base has changed.
*/
void ED_object_base_active_refresh(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer);
void ED_object_base_active_refresh(Main *bmain, Scene *scene, ViewLayer *view_layer);
/**
* Remove base from a specific scene.
* \note now unlinks constraints as well.
*/
void ED_object_base_free_and_unlink(struct Main *bmain, struct Scene *scene, struct Object *ob);
void ED_object_base_free_and_unlink(Main *bmain, Scene *scene, Object *ob);
/**
* Remove base from a specific scene.
* `ob` must not be indirectly used.
*/
void ED_object_base_free_and_unlink_no_indirect_check(struct Main *bmain,
struct Scene *scene,
struct Object *ob);
bool ED_object_base_deselect_all_ex(const struct Scene *scene,
struct ViewLayer *view_layer,
struct View3D *v3d,
int action,
bool *r_any_visible);
bool ED_object_base_deselect_all(const struct Scene *scene,
struct ViewLayer *view_layer,
struct View3D *v3d,
void ED_object_base_free_and_unlink_no_indirect_check(Main *bmain, Scene *scene, Object *ob);
bool ED_object_base_deselect_all_ex(
const Scene *scene, ViewLayer *view_layer, View3D *v3d, int action, bool *r_any_visible);
bool ED_object_base_deselect_all(const Scene *scene,
ViewLayer *view_layer,
View3D *v3d,
int action);
/**
@@ -229,18 +219,13 @@ bool ED_object_base_deselect_all(const struct Scene *scene,
* \note caller must do `DAG_relations_tag_update(bmain);`
* this is not done automatic since we may duplicate many objects in a batch.
*/
struct Base *ED_object_add_duplicate(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
struct Base *base,
eDupli_ID_Flags dupflag);
Base *ED_object_add_duplicate(
Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base, eDupli_ID_Flags dupflag);
void ED_object_parent(struct Object *ob, struct Object *parent, int type, const char *substr);
char *ED_object_ot_drop_named_material_tooltip(struct bContext *C,
const char *name,
const int mval[2]);
char *ED_object_ot_drop_geometry_nodes_tooltip(struct bContext *C,
struct PointerRNA *properties,
void ED_object_parent(Object *ob, Object *parent, int type, const char *substr);
char *ED_object_ot_drop_named_material_tooltip(bContext *C, const char *name, const int mval[2]);
char *ED_object_ot_drop_geometry_nodes_tooltip(bContext *C,
PointerRNA *properties,
const int mval[2]);
/* bitflags for enter/exit editmode */
@@ -252,93 +237,69 @@ enum {
* \param flag:
* - If #EM_FREEDATA isn't in the flag, use ED_object_editmode_load directly.
*/
bool ED_object_editmode_exit_ex(struct Main *bmain,
struct Scene *scene,
struct Object *obedit,
int flag);
bool ED_object_editmode_exit(struct bContext *C, int flag);
bool ED_object_editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int flag);
bool ED_object_editmode_exit(bContext *C, int flag);
/**
* Support freeing edit-mode data without flushing it back to the object.
*
* \return true if data was freed.
*/
bool ED_object_editmode_free_ex(struct Main *bmain, struct Object *obedit);
bool ED_object_editmode_free_ex(Main *bmain, Object *obedit);
bool ED_object_editmode_exit_multi_ex(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
int flag);
bool ED_object_editmode_exit_multi(struct bContext *C, int flag);
bool ED_object_editmode_exit_multi_ex(Main *bmain, Scene *scene, ViewLayer *view_layer, int flag);
bool ED_object_editmode_exit_multi(bContext *C, int flag);
bool ED_object_editmode_enter_ex(struct Main *bmain,
struct Scene *scene,
struct Object *ob,
int flag);
bool ED_object_editmode_enter(struct bContext *C, int flag);
bool ED_object_editmode_load(struct Main *bmain, struct Object *obedit);
bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag);
bool ED_object_editmode_enter(bContext *C, int flag);
bool ED_object_editmode_load(Main *bmain, Object *obedit);
void ED_object_vpaintmode_enter_ex(struct Main *bmain,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void ED_object_vpaintmode_enter(struct bContext *C, struct Depsgraph *depsgraph);
void ED_object_wpaintmode_enter_ex(struct Main *bmain,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void ED_object_wpaintmode_enter(struct bContext *C, struct Depsgraph *depsgraph);
void ED_object_vpaintmode_enter_ex(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob);
void ED_object_vpaintmode_enter(bContext *C, Depsgraph *depsgraph);
void ED_object_wpaintmode_enter_ex(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob);
void ED_object_wpaintmode_enter(bContext *C, Depsgraph *depsgraph);
void ED_object_vpaintmode_exit_ex(struct Object *ob);
void ED_object_vpaintmode_exit(struct bContext *C);
void ED_object_wpaintmode_exit_ex(struct Object *ob);
void ED_object_wpaintmode_exit(struct bContext *C);
void ED_object_vpaintmode_exit_ex(Object *ob);
void ED_object_vpaintmode_exit(bContext *C);
void ED_object_wpaintmode_exit_ex(Object *ob);
void ED_object_wpaintmode_exit(bContext *C);
void ED_object_texture_paint_mode_enter_ex(struct Main *bmain,
struct Scene *scene,
struct Depsgraph *depsgraph,
void ED_object_texture_paint_mode_enter_ex(Main *bmain,
Scene *scene,
Depsgraph *depsgraph,
Object *ob);
void ED_object_texture_paint_mode_enter(struct bContext *C);
void ED_object_texture_paint_mode_enter(bContext *C);
void ED_object_texture_paint_mode_exit_ex(struct Main *bmain, struct Scene *scene, Object *ob);
void ED_object_texture_paint_mode_exit(struct bContext *C);
void ED_object_texture_paint_mode_exit_ex(Main *bmain, Scene *scene, Object *ob);
void ED_object_texture_paint_mode_exit(bContext *C);
bool ED_object_particle_edit_mode_supported(const Object *ob);
void ED_object_particle_edit_mode_enter_ex(struct Depsgraph *depsgraph,
struct Scene *scene,
Object *ob);
void ED_object_particle_edit_mode_enter(struct bContext *C);
void ED_object_particle_edit_mode_enter_ex(Depsgraph *depsgraph, Scene *scene, Object *ob);
void ED_object_particle_edit_mode_enter(bContext *C);
void ED_object_particle_edit_mode_exit_ex(struct Scene *scene, Object *ob);
void ED_object_particle_edit_mode_exit(struct bContext *C);
void ED_object_particle_edit_mode_exit_ex(Scene *scene, Object *ob);
void ED_object_particle_edit_mode_exit(bContext *C);
void ED_object_sculptmode_enter_ex(struct Main *bmain,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
void ED_object_sculptmode_enter_ex(Main *bmain,
Depsgraph *depsgraph,
Scene *scene,
Object *ob,
bool force_dyntopo,
struct ReportList *reports);
void ED_object_sculptmode_enter(struct bContext *C,
struct Depsgraph *depsgraph,
struct ReportList *reports);
void ED_object_sculptmode_exit_ex(struct Main *bmain,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void ED_object_sculptmode_exit(struct bContext *C, struct Depsgraph *depsgraph);
ReportList *reports);
void ED_object_sculptmode_enter(bContext *C, Depsgraph *depsgraph, ReportList *reports);
void ED_object_sculptmode_exit_ex(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob);
void ED_object_sculptmode_exit(bContext *C, Depsgraph *depsgraph);
void ED_object_location_from_view(struct bContext *C, float loc[3]);
void ED_object_location_from_view(bContext *C, float loc[3]);
void ED_object_rotation_from_quat(float rot[3], const float quat[4], char align_axis);
void ED_object_rotation_from_view(struct bContext *C, float rot[3], char align_axis);
void ED_object_base_init_transform_on_add(struct Object *object,
const float loc[3],
const float rot[3]);
void ED_object_rotation_from_view(bContext *C, float rot[3], char align_axis);
void ED_object_base_init_transform_on_add(Object *object, const float loc[3], const float rot[3]);
/**
* Uses context to figure out transform for primitive.
* Returns standard diameter.
*/
float ED_object_new_primitive_matrix(struct bContext *C,
struct Object *obedit,
float ED_object_new_primitive_matrix(bContext *C,
Object *obedit,
const float loc[3],
const float rot[3],
const float scale[3],
@@ -349,13 +310,13 @@ float ED_object_new_primitive_matrix(struct bContext *C,
*/
#define OBJECT_ADD_SIZE_MAXF 1.0e12f
void ED_object_add_unit_props_size(struct wmOperatorType *ot);
void ED_object_add_unit_props_radius_ex(struct wmOperatorType *ot, float default_value);
void ED_object_add_unit_props_radius(struct wmOperatorType *ot);
void ED_object_add_generic_props(struct wmOperatorType *ot, bool do_editmode);
void ED_object_add_mesh_props(struct wmOperatorType *ot);
bool ED_object_add_generic_get_opts(struct bContext *C,
struct wmOperator *op,
void ED_object_add_unit_props_size(wmOperatorType *ot);
void ED_object_add_unit_props_radius_ex(wmOperatorType *ot, float default_value);
void ED_object_add_unit_props_radius(wmOperatorType *ot);
void ED_object_add_generic_props(wmOperatorType *ot, bool do_editmode);
void ED_object_add_mesh_props(wmOperatorType *ot);
bool ED_object_add_generic_get_opts(bContext *C,
wmOperator *op,
char view_align_axis,
float r_loc[3],
float r_rot[3],
@@ -370,43 +331,42 @@ bool ED_object_add_generic_get_opts(struct bContext *C,
*
* \note Do not call undo push in this function (users of this function have to).
*/
struct Object *ED_object_add_type_with_obdata(struct bContext *C,
int type,
const char *name,
const float loc[3],
const float rot[3],
bool enter_editmode,
ushort local_view_bits,
struct ID *obdata);
struct Object *ED_object_add_type(struct bContext *C,
int type,
const char *name,
const float loc[3],
const float rot[3],
bool enter_editmode,
unsigned short local_view_bits)
ATTR_NONNULL(1) ATTR_RETURNS_NONNULL;
Object *ED_object_add_type_with_obdata(bContext *C,
int type,
const char *name,
const float loc[3],
const float rot[3],
bool enter_editmode,
ushort local_view_bits,
ID *obdata);
Object *ED_object_add_type(bContext *C,
int type,
const char *name,
const float loc[3],
const float rot[3],
bool enter_editmode,
unsigned short local_view_bits) ATTR_NONNULL(1) ATTR_RETURNS_NONNULL;
/**
* Not an especially efficient function, only added so the single user button can be functional.
*/
void ED_object_single_user(struct Main *bmain, struct Scene *scene, struct Object *ob);
void ED_object_single_user(Main *bmain, Scene *scene, Object *ob);
void ED_object_single_obdata_user(struct Main *bmain, struct Scene *scene, struct Object *ob);
void ED_object_single_obdata_user(Main *bmain, Scene *scene, Object *ob);
/* object motion paths */
/**
* Clear motion paths for all objects.
*/
void ED_objects_clear_paths(struct bContext *C, bool only_selected);
void ED_objects_clear_paths(bContext *C, bool only_selected);
/* Corresponds to eAnimvizCalcRange. */
typedef enum eObjectPathCalcRange {
enum eObjectPathCalcRange {
OBJECT_PATH_CALC_RANGE_CURRENT_FRAME,
OBJECT_PATH_CALC_RANGE_CHANGED,
OBJECT_PATH_CALC_RANGE_FULL,
} eObjectPathCalcRange;
};
/**
* For the objects with animation: update paths for those that have got them
@@ -414,67 +374,54 @@ typedef enum eObjectPathCalcRange {
*
* To be called from various tools that do incremental updates
*/
void ED_objects_recalculate_paths(struct bContext *C,
struct Scene *scene,
void ED_objects_recalculate_paths(bContext *C,
Scene *scene,
eObjectPathCalcRange range,
struct ListBase *ld_objects);
ListBase *ld_objects);
void ED_objects_recalculate_paths_selected(struct bContext *C,
struct Scene *scene,
eObjectPathCalcRange range);
void ED_objects_recalculate_paths_selected(bContext *C, Scene *scene, eObjectPathCalcRange range);
void ED_objects_recalculate_paths_visible(struct bContext *C,
struct Scene *scene,
eObjectPathCalcRange range);
void ED_objects_recalculate_paths_visible(bContext *C, Scene *scene, eObjectPathCalcRange range);
/* constraints */
/**
* If object is in pose-mode, return active bone constraints, else object constraints.
* No constraints are returned for a bone on an inactive bone-layer.
*/
struct ListBase *ED_object_constraint_active_list(struct Object *ob);
ListBase *ED_object_constraint_active_list(Object *ob);
/**
* Get the constraints for the active pose bone. Bone may be on an inactive bone-layer
* (unlike #ED_object_constraint_active_list, such constraints are not excluded here).
*/
struct ListBase *ED_object_pose_constraint_list(const struct bContext *C);
ListBase *ED_object_pose_constraint_list(const bContext *C);
/**
* Find the list that a given constraint belongs to,
* and/or also get the posechannel this is from (if applicable).
*/
struct ListBase *ED_object_constraint_list_from_constraint(struct Object *ob,
struct bConstraint *con,
struct bPoseChannel **r_pchan);
ListBase *ED_object_constraint_list_from_constraint(Object *ob,
bConstraint *con,
bPoseChannel **r_pchan);
/**
* Single constraint.
*/
struct bConstraint *ED_object_constraint_active_get(struct Object *ob);
bConstraint *ED_object_constraint_active_get(Object *ob);
void object_test_constraints(struct Main *bmain, struct Object *ob);
void object_test_constraints(Main *bmain, Object *ob);
void ED_object_constraint_active_set(struct Object *ob, struct bConstraint *con);
void ED_object_constraint_update(struct Main *bmain, struct Object *ob);
void ED_object_constraint_dependency_update(struct Main *bmain, struct Object *ob);
void ED_object_constraint_active_set(Object *ob, bConstraint *con);
void ED_object_constraint_update(Main *bmain, Object *ob);
void ED_object_constraint_dependency_update(Main *bmain, Object *ob);
void ED_object_constraint_tag_update(struct Main *bmain,
struct Object *ob,
struct bConstraint *con);
void ED_object_constraint_dependency_tag_update(struct Main *bmain,
struct Object *ob,
struct bConstraint *con);
void ED_object_constraint_tag_update(Main *bmain, Object *ob, bConstraint *con);
void ED_object_constraint_dependency_tag_update(Main *bmain, Object *ob, bConstraint *con);
bool ED_object_constraint_move_to_index(struct Object *ob, struct bConstraint *con, int index);
void ED_object_constraint_link(struct Main *bmain,
struct Object *ob_dst,
struct ListBase *dst,
struct ListBase *src);
void ED_object_constraint_copy_for_object(struct Main *bmain,
struct Object *ob_dst,
struct bConstraint *con);
void ED_object_constraint_copy_for_pose(struct Main *bmain,
struct Object *ob_dst,
struct bPoseChannel *pchan,
struct bConstraint *con);
bool ED_object_constraint_move_to_index(Object *ob, bConstraint *con, int index);
void ED_object_constraint_link(Main *bmain, Object *ob_dst, ListBase *dst, ListBase *src);
void ED_object_constraint_copy_for_object(Main *bmain, Object *ob_dst, bConstraint *con);
void ED_object_constraint_copy_for_pose(Main *bmain,
Object *ob_dst,
bPoseChannel *pchan,
bConstraint *con);
/* object_modes.cc */
@@ -482,31 +429,22 @@ void ED_object_constraint_copy_for_pose(struct Main *bmain,
* Checks the mode to be set is compatible with the object
* should be made into a generic function
*/
bool ED_object_mode_compat_test(const struct Object *ob, eObjectMode mode);
bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode);
/**
* Sets the mode to a compatible state (use before entering the mode).
*
* This is so each mode's exec function can call
*/
bool ED_object_mode_compat_set(struct bContext *C,
struct Object *ob,
eObjectMode mode,
struct ReportList *reports);
bool ED_object_mode_set_ex(struct bContext *C,
eObjectMode mode,
bool use_undo,
struct ReportList *reports);
bool ED_object_mode_set(struct bContext *C, eObjectMode mode);
bool ED_object_mode_compat_set(bContext *C, Object *ob, eObjectMode mode, ReportList *reports);
bool ED_object_mode_set_ex(bContext *C, eObjectMode mode, bool use_undo, ReportList *reports);
bool ED_object_mode_set(bContext *C, eObjectMode mode);
void ED_object_mode_generic_exit(struct Main *bmain,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, const struct Object *ob);
void ED_object_mode_generic_exit(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob);
bool ED_object_mode_generic_has_data(Depsgraph *depsgraph, const Object *ob);
void ED_object_posemode_set_for_weight_paint(struct bContext *C,
struct Main *bmain,
struct Object *ob,
void ED_object_posemode_set_for_weight_paint(bContext *C,
Main *bmain,
Object *ob,
bool is_mode_set);
/**
@@ -521,16 +459,16 @@ void ED_object_posemode_set_for_weight_paint(struct bContext *C,
*
* \note The active object is always index 0.
*/
int ED_object_in_mode_to_index(const struct Scene *scene,
struct ViewLayer *view_layer,
int ED_object_in_mode_to_index(const Scene *scene,
ViewLayer *view_layer,
eObjectMode mode,
const struct Object *ob);
const Object *ob);
/**
* Access the object from the index returned by #ED_object_in_mode_to_index.
*/
Object *ED_object_in_mode_from_index(const struct Scene *scene,
struct ViewLayer *view_layer,
Object *ED_object_in_mode_from_index(const Scene *scene,
ViewLayer *view_layer,
eObjectMode mode,
int index);
@@ -547,58 +485,48 @@ enum {
*
* \param scene: is only used to set current frame in some cases, and may be NULL.
*/
struct ModifierData *ED_object_modifier_add(struct ReportList *reports,
struct Main *bmain,
struct Scene *scene,
struct Object *ob,
const char *name,
int type);
bool ED_object_modifier_remove(struct ReportList *reports,
struct Main *bmain,
struct Scene *scene,
struct Object *ob,
struct ModifierData *md);
void ED_object_modifier_clear(struct Main *bmain, struct Scene *scene, struct Object *ob);
bool ED_object_modifier_move_down(struct ReportList *reports,
ModifierData *ED_object_modifier_add(
ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type);
bool ED_object_modifier_remove(
ReportList *reports, Main *bmain, Scene *scene, Object *ob, ModifierData *md);
void ED_object_modifier_clear(Main *bmain, Scene *scene, Object *ob);
bool ED_object_modifier_move_down(ReportList *reports,
eReportType error_type,
struct Object *ob,
struct ModifierData *md);
bool ED_object_modifier_move_up(struct ReportList *reports,
Object *ob,
ModifierData *md);
bool ED_object_modifier_move_up(ReportList *reports,
eReportType error_type,
struct Object *ob,
struct ModifierData *md);
bool ED_object_modifier_move_to_index(struct ReportList *reports,
Object *ob,
ModifierData *md);
bool ED_object_modifier_move_to_index(ReportList *reports,
eReportType error_type,
struct Object *ob,
struct ModifierData *md,
Object *ob,
ModifierData *md,
int index,
bool allow_partial);
bool ED_object_modifier_convert_psys_to_mesh(struct ReportList *reports,
struct Main *bmain,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct ViewLayer *view_layer,
struct Object *ob,
struct ModifierData *md);
bool ED_object_modifier_apply(struct Main *bmain,
struct ReportList *reports,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
struct ModifierData *md,
bool ED_object_modifier_convert_psys_to_mesh(ReportList *reports,
Main *bmain,
Depsgraph *depsgraph,
Scene *scene,
ViewLayer *view_layer,
Object *ob,
ModifierData *md);
bool ED_object_modifier_apply(Main *bmain,
ReportList *reports,
Depsgraph *depsgraph,
Scene *scene,
Object *ob,
ModifierData *md,
int mode,
bool keep_modifier);
bool ED_object_modifier_copy(struct ReportList *reports,
struct Main *bmain,
struct Scene *scene,
struct Object *ob,
struct ModifierData *md);
void ED_object_modifier_link(struct bContext *C, struct Object *ob_dst, struct Object *ob_src);
void ED_object_modifier_copy_to_object(struct bContext *C,
struct Object *ob_dst,
struct Object *ob_src,
struct ModifierData *md);
bool ED_object_modifier_copy(
ReportList *reports, Main *bmain, Scene *scene, Object *ob, ModifierData *md);
void ED_object_modifier_link(bContext *C, Object *ob_dst, Object *ob_src);
void ED_object_modifier_copy_to_object(bContext *C,
Object *ob_dst,
Object *ob_src,
ModifierData *md);
/**
* If the object data of 'orig_ob' has other users, run 'callback' on
@@ -609,101 +537,76 @@ void ED_object_modifier_copy_to_object(struct bContext *C,
* If the callback ever returns true, iteration will stop and the
* function value will be true. Otherwise the function returns false.
*/
bool ED_object_iter_other(struct Main *bmain,
struct Object *orig_ob,
bool ED_object_iter_other(Main *bmain,
Object *orig_ob,
bool include_orig,
bool (*callback)(struct Object *ob, void *callback_data),
bool (*callback)(Object *ob, void *callback_data),
void *callback_data);
/**
* Use with #ED_object_iter_other(). Sets the total number of levels
* for any multi-res modifiers on the object to the int pointed to by callback_data.
*/
bool ED_object_multires_update_totlevels_cb(struct Object *ob, void *totlevel_v);
bool ED_object_multires_update_totlevels_cb(Object *ob, void *totlevel_v);
/* object_greasepencil_modifier.c */
struct GpencilModifierData *ED_object_gpencil_modifier_add(struct ReportList *reports,
struct Main *bmain,
struct Scene *scene,
struct Object *ob,
const char *name,
int type);
bool ED_object_gpencil_modifier_remove(struct ReportList *reports,
struct Main *bmain,
struct Object *ob,
struct GpencilModifierData *md);
void ED_object_gpencil_modifier_clear(struct Main *bmain, struct Object *ob);
bool ED_object_gpencil_modifier_move_down(struct ReportList *reports,
struct Object *ob,
struct GpencilModifierData *md);
bool ED_object_gpencil_modifier_move_up(struct ReportList *reports,
struct Object *ob,
struct GpencilModifierData *md);
bool ED_object_gpencil_modifier_move_to_index(struct ReportList *reports,
struct Object *ob,
struct GpencilModifierData *md,
GpencilModifierData *ED_object_gpencil_modifier_add(
ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type);
bool ED_object_gpencil_modifier_remove(ReportList *reports,
Main *bmain,
Object *ob,
GpencilModifierData *md);
void ED_object_gpencil_modifier_clear(Main *bmain, Object *ob);
bool ED_object_gpencil_modifier_move_down(ReportList *reports,
Object *ob,
GpencilModifierData *md);
bool ED_object_gpencil_modifier_move_up(ReportList *reports, Object *ob, GpencilModifierData *md);
bool ED_object_gpencil_modifier_move_to_index(ReportList *reports,
Object *ob,
GpencilModifierData *md,
int index);
bool ED_object_gpencil_modifier_apply(struct Main *bmain,
struct ReportList *reports,
struct Depsgraph *depsgraph,
struct Object *ob,
struct GpencilModifierData *md,
bool ED_object_gpencil_modifier_apply(Main *bmain,
ReportList *reports,
Depsgraph *depsgraph,
Object *ob,
GpencilModifierData *md,
int mode);
bool ED_object_gpencil_modifier_copy(struct ReportList *reports,
struct Object *ob,
struct GpencilModifierData *md);
void ED_object_gpencil_modifier_copy_to_object(struct Object *ob_dst,
struct GpencilModifierData *md);
bool ED_object_gpencil_modifier_copy(ReportList *reports, Object *ob, GpencilModifierData *md);
void ED_object_gpencil_modifier_copy_to_object(Object *ob_dst, GpencilModifierData *md);
/* `object_shader_fx.cc` */
struct ShaderFxData *ED_object_shaderfx_add(struct ReportList *reports,
struct Main *bmain,
struct Scene *scene,
struct Object *ob,
const char *name,
int type);
bool ED_object_shaderfx_remove(struct ReportList *reports,
struct Main *bmain,
struct Object *ob,
struct ShaderFxData *fx);
void ED_object_shaderfx_clear(struct Main *bmain, struct Object *ob);
int ED_object_shaderfx_move_down(struct ReportList *reports,
struct Object *ob,
struct ShaderFxData *fx);
int ED_object_shaderfx_move_up(struct ReportList *reports,
struct Object *ob,
struct ShaderFxData *fx);
bool ED_object_shaderfx_move_to_index(struct ReportList *reports,
struct Object *ob,
struct ShaderFxData *fx,
ShaderFxData *ED_object_shaderfx_add(
ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type);
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_down(ReportList *reports, Object *ob, ShaderFxData *fx);
int ED_object_shaderfx_move_up(ReportList *reports, Object *ob, ShaderFxData *fx);
bool ED_object_shaderfx_move_to_index(ReportList *reports,
Object *ob,
ShaderFxData *fx,
int index);
void ED_object_shaderfx_link(struct Object *dst, struct Object *src);
void ED_object_shaderfx_copy(struct Object *dst, struct ShaderFxData *fx);
void ED_object_shaderfx_link(Object *dst, Object *src);
void ED_object_shaderfx_copy(Object *dst, ShaderFxData *fx);
/* `object_select.cc` */
void ED_object_select_linked_by_id(struct bContext *C, struct ID *id);
void ED_object_select_linked_by_id(bContext *C, ID *id);
const struct EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(
const struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
bool *r_free,
unsigned int selection_mask);
const EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(const bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
bool *r_free,
unsigned int selection_mask);
void ED_object_check_force_modifiers(struct Main *bmain,
struct Scene *scene,
struct Object *object);
void ED_object_check_force_modifiers(Main *bmain, Scene *scene, Object *object);
/**
* If id is not already an Object, try to find an object that uses it as data.
* Prefers active, then selected, then visible/selectable.
*/
struct Base *ED_object_find_first_by_data_id(const struct Scene *scene,
struct ViewLayer *view_layer,
struct ID *id);
Base *ED_object_find_first_by_data_id(const Scene *scene, ViewLayer *view_layer, ID *id);
/**
* Select and make the target object active in the view layer.
@@ -711,7 +614,7 @@ struct Base *ED_object_find_first_by_data_id(const struct Scene *scene,
*
* \returns false if not found in current view layer
*/
bool ED_object_jump_to_object(struct bContext *C, struct Object *ob, bool reveal_hidden);
bool ED_object_jump_to_object(bContext *C, Object *ob, bool reveal_hidden);
/**
* Select and make the target object and bone active.
* Switches to Pose mode if in Object mode so the selection is visible.
@@ -719,20 +622,17 @@ bool ED_object_jump_to_object(struct bContext *C, struct Object *ob, bool reveal
*
* \returns false if object not in layer, bone not found, or other error
*/
bool ED_object_jump_to_bone(struct bContext *C,
struct Object *ob,
const char *bone_name,
bool reveal_hidden);
bool ED_object_jump_to_bone(bContext *C, Object *ob, const char *bone_name, bool reveal_hidden);
/* object_data_transform.cc */
struct XFormObjectData *ED_object_data_xform_create_ex(struct ID *id, bool is_edit_mode);
struct XFormObjectData *ED_object_data_xform_create(struct ID *id);
struct XFormObjectData *ED_object_data_xform_create_from_edit_mode(ID *id);
XFormObjectData *ED_object_data_xform_create_ex(ID *id, bool is_edit_mode);
XFormObjectData *ED_object_data_xform_create(ID *id);
XFormObjectData *ED_object_data_xform_create_from_edit_mode(ID *id);
void ED_object_data_xform_destroy(struct XFormObjectData *xod_base);
void ED_object_data_xform_destroy(XFormObjectData *xod_base);
void ED_object_data_xform_by_mat4(struct XFormObjectData *xod, const float mat[4][4]);
void ED_object_data_xform_by_mat4(XFormObjectData *xod, const float mat[4][4]);
void ED_object_data_xform_restore(struct XFormObjectData *xod);
void ED_object_data_xform_tag_update(struct XFormObjectData *xod);
void ED_object_data_xform_restore(XFormObjectData *xod);
void ED_object_data_xform_tag_update(XFormObjectData *xod);

View File

@@ -13,38 +13,37 @@ struct ListBase;
struct SpaceOutliner;
struct bContext;
bool ED_outliner_collections_editor_poll(struct bContext *C);
bool ED_outliner_collections_editor_poll(bContext *C);
/**
* Populates the \param objects: ListBase with all the outliner selected objects
* We store it as (Object *)LinkData->data
* \param objects: expected to be empty
*/
void ED_outliner_selected_objects_get(const struct bContext *C, struct ListBase *objects);
void ED_outliner_selected_objects_get(const bContext *C, ListBase *objects);
/**
* Get base of object under cursor. Used for eyedropper tool.
*/
struct Base *ED_outliner_give_base_under_cursor(struct bContext *C, const int mval[2]);
Base *ED_outliner_give_base_under_cursor(bContext *C, const int mval[2]);
/**
* Functions for tagging outliner selection syncing is dirty from operators.
*/
void ED_outliner_select_sync_from_object_tag(struct bContext *C);
void ED_outliner_select_sync_from_edit_bone_tag(struct bContext *C);
void ED_outliner_select_sync_from_pose_bone_tag(struct bContext *C);
void ED_outliner_select_sync_from_sequence_tag(struct bContext *C);
void ED_outliner_select_sync_from_all_tag(struct bContext *C);
void ED_outliner_select_sync_from_object_tag(bContext *C);
void ED_outliner_select_sync_from_edit_bone_tag(bContext *C);
void ED_outliner_select_sync_from_pose_bone_tag(bContext *C);
void ED_outliner_select_sync_from_sequence_tag(bContext *C);
void ED_outliner_select_sync_from_all_tag(bContext *C);
bool ED_outliner_select_sync_is_dirty(const struct bContext *C);
bool ED_outliner_select_sync_is_dirty(const bContext *C);
/**
* Set clean outliner and mark other outliners for syncing.
*/
void ED_outliner_select_sync_from_outliner(struct bContext *C,
struct SpaceOutliner *space_outliner);
void ED_outliner_select_sync_from_outliner(bContext *C, SpaceOutliner *space_outliner);
/**
* Copy sync select dirty flag from window manager to all outliners to be synced lazily on draw.
*/
void ED_outliner_select_sync_flag_outliners(const struct bContext *C);
void ED_outliner_select_sync_flag_outliners(const bContext *C);

View File

@@ -10,49 +10,41 @@
#include "DNA_view3d_enums.h"
struct bContext;
struct bToolRef;
struct PaintModeSettings;
struct ImBuf;
struct Image;
struct ImageUser;
struct PaintTileMap;
struct ReportList;
struct UndoStep;
struct UndoType;
struct bContext;
struct wmKeyConfig;
struct wmOperator;
typedef struct PaintTileMap PaintTileMap;
/* paint_ops.cc */
void ED_operatortypes_paint(void);
void ED_operatormacros_paint(void);
void ED_keymap_paint(struct wmKeyConfig *keyconf);
void ED_operatortypes_paint();
void ED_operatormacros_paint();
void ED_keymap_paint(wmKeyConfig *keyconf);
/* `paint_image.cc` */
void ED_imapaint_clear_partial_redraw(void);
void ED_imapaint_dirty_region(struct Image *ima,
struct ImBuf *ibuf,
struct ImageUser *iuser,
int x,
int y,
int w,
int h,
bool find_old);
void ED_imapaint_bucket_fill(struct bContext *C,
float color[3],
struct wmOperator *op,
const int mouse[2]);
void ED_imapaint_clear_partial_redraw();
void ED_imapaint_dirty_region(
Image *ima, ImBuf *ibuf, ImageUser *iuser, int x, int y, int w, int h, bool find_old);
void ED_imapaint_bucket_fill(bContext *C, float color[3], wmOperator *op, const int mouse[2]);
/* `paint_image_proj.cc` */
void ED_paint_data_warning(struct ReportList *reports, bool uvs, bool mat, bool tex, bool stencil);
void ED_paint_data_warning(ReportList *reports, bool uvs, bool mat, bool tex, bool stencil);
/**
* Make sure that active object has a material,
* and assign UVs and image layers if they do not exist.
*/
bool ED_paint_proj_mesh_data_check(
struct Scene *scene, struct Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil);
Scene *scene, Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil);
/* `image_undo.cc` */
@@ -62,42 +54,42 @@ bool ED_paint_proj_mesh_data_check(
*/
void ED_image_undo_push_begin(const char *name, int paint_mode);
void ED_image_undo_push_begin_with_image(const char *name,
struct Image *image,
struct ImBuf *ibuf,
struct ImageUser *iuser);
Image *image,
ImBuf *ibuf,
ImageUser *iuser);
void ED_image_undo_push_end(void);
void ED_image_undo_push_end();
/**
* Restore painting image to previous state. Used for anchored and drag-dot style brushes.
*/
void ED_image_undo_restore(struct UndoStep *us);
void ED_image_undo_restore(UndoStep *us);
/** Export for ED_undo_sys. */
void ED_image_undosys_type(struct UndoType *ut);
void ED_image_undosys_type(UndoType *ut);
void *ED_image_paint_tile_find(PaintTileMap *paint_tile_map,
struct Image *image,
struct ImBuf *ibuf,
struct ImageUser *iuser,
Image *image,
ImBuf *ibuf,
ImageUser *iuser,
int x_tile,
int y_tile,
unsigned short **r_mask,
bool validate);
void *ED_image_paint_tile_push(PaintTileMap *paint_tile_map,
struct Image *image,
struct ImBuf *ibuf,
struct ImBuf **tmpibuf,
struct ImageUser *iuser,
Image *image,
ImBuf *ibuf,
ImBuf **tmpibuf,
ImageUser *iuser,
int x_tile,
int y_tile,
unsigned short **r_mask,
bool **r_valid,
bool use_thread_lock,
bool find_prev);
void ED_image_paint_tile_lock_init(void);
void ED_image_paint_tile_lock_end(void);
void ED_image_paint_tile_lock_init();
void ED_image_paint_tile_lock_end();
struct PaintTileMap *ED_image_paint_tile_map_get(void);
PaintTileMap *ED_image_paint_tile_map_get();
#define ED_IMAGE_UNDO_TILE_BITS 6
#define ED_IMAGE_UNDO_TILE_SIZE (1 << ED_IMAGE_UNDO_TILE_BITS)
@@ -107,16 +99,16 @@ struct PaintTileMap *ED_image_paint_tile_map_get(void);
/* `paint_curve_undo.cc` */
void ED_paintcurve_undo_push_begin(const char *name);
void ED_paintcurve_undo_push_end(struct bContext *C);
void ED_paintcurve_undo_push_end(bContext *C);
/** Export for ED_undo_sys. */
void ED_paintcurve_undosys_type(struct UndoType *ut);
void ED_paintcurve_undosys_type(UndoType *ut);
/* paint_canvas.cc */
/** Color type of an object can be overridden in sculpt/paint mode. */
eV3DShadingColorType ED_paint_shading_color_override(struct bContext *C,
const struct PaintModeSettings *settings,
struct Object *ob,
eV3DShadingColorType ED_paint_shading_color_override(bContext *C,
const PaintModeSettings *settings,
Object *ob,
eV3DShadingColorType orig_color_type);
/**
@@ -124,7 +116,7 @@ eV3DShadingColorType ED_paint_shading_color_override(struct bContext *C,
*
* When #tref isn't given the active tool from the context is used.
*/
bool ED_paint_tool_use_canvas(struct bContext *C, struct bToolRef *tref);
bool ED_paint_tool_use_canvas(bContext *C, bToolRef *tref);
/* Store the last used tool in the sculpt session. */
void ED_paint_tool_update_sticky_shading_color(struct bContext *C, struct Object *ob);
void ED_paint_tool_update_sticky_shading_color(bContext *C, Object *ob);

View File

@@ -22,50 +22,35 @@ struct wmGenericUserData;
/* particle edit mode */
void PE_free_ptcache_edit(struct PTCacheEdit *edit);
int PE_start_edit(struct PTCacheEdit *edit);
void PE_free_ptcache_edit(PTCacheEdit *edit);
int PE_start_edit(PTCacheEdit *edit);
/* access */
struct PTCacheEdit *PE_get_current_from_psys(struct ParticleSystem *psys);
struct PTCacheEdit *PE_get_current(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
struct PTCacheEdit *PE_create_current(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void PE_current_changed(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
int PE_minmax(struct Depsgraph *depsgraph,
struct Scene *scene,
struct ViewLayer *view_layer,
float min[3],
float max[3]);
struct ParticleEditSettings *PE_settings(struct Scene *scene);
PTCacheEdit *PE_get_current_from_psys(ParticleSystem *psys);
PTCacheEdit *PE_get_current(Depsgraph *depsgraph, Scene *scene, Object *ob);
PTCacheEdit *PE_create_current(Depsgraph *depsgraph, Scene *scene, Object *ob);
void PE_current_changed(Depsgraph *depsgraph, Scene *scene, Object *ob);
int PE_minmax(
Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, float min[3], float max[3]);
ParticleEditSettings *PE_settings(Scene *scene);
/* update calls */
void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra);
void PE_update_object(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
int useflag);
void PE_hide_keys_time(Scene *scene, PTCacheEdit *edit, float cfra);
void PE_update_object(Depsgraph *depsgraph, Scene *scene, Object *ob, int useflag);
/* selection tools */
bool PE_mouse_particles(struct bContext *C,
const int mval[2],
const struct SelectPick_Params *params);
bool PE_box_select(struct bContext *C, const struct rcti *rect, int sel_op);
bool PE_circle_select(struct bContext *C,
struct wmGenericUserData *wm_userdata,
int sel_op,
const int mval[2],
float rad);
int PE_lasso_select(struct bContext *C, const int mcoords[][2], int mcoords_len, int sel_op);
bool PE_deselect_all_visible_ex(struct PTCacheEdit *edit);
bool PE_deselect_all_visible(struct bContext *C);
bool PE_mouse_particles(bContext *C, const int mval[2], const SelectPick_Params *params);
bool PE_box_select(bContext *C, const rcti *rect, int sel_op);
bool PE_circle_select(
bContext *C, wmGenericUserData *wm_userdata, int sel_op, const int mval[2], float rad);
int PE_lasso_select(bContext *C, const int mcoords[][2], int mcoords_len, int sel_op);
bool PE_deselect_all_visible_ex(PTCacheEdit *edit);
bool PE_deselect_all_visible(bContext *C);
/* `particle_edit_undo.cc` */
/** Export for ED_undo_sys. */
void ED_particle_undosys_type(struct UndoType *ut);
void ED_particle_undosys_type(UndoType *ut);

View File

@@ -11,34 +11,26 @@
struct ReportList;
struct bContext;
struct wmKeyConfig;
struct Object;
struct Scene;
/* `particle_edit.cc` */
bool PE_poll(struct bContext *C);
bool PE_hair_poll(struct bContext *C);
bool PE_poll_view3d(struct bContext *C);
bool PE_poll(bContext *C);
bool PE_hair_poll(bContext *C);
bool PE_poll_view3d(bContext *C);
/* `rigidbody_object.cc` */
bool ED_rigidbody_object_add(struct Main *bmain,
struct Scene *scene,
struct Object *ob,
int type,
struct ReportList *reports);
void ED_rigidbody_object_remove(struct Main *bmain, struct Scene *scene, struct Object *ob);
bool ED_rigidbody_object_add(Main *bmain, Scene *scene, Object *ob, int type, ReportList *reports);
void ED_rigidbody_object_remove(Main *bmain, Scene *scene, Object *ob);
/* `rigidbody_constraint.cc` */
bool ED_rigidbody_constraint_add(struct Main *bmain,
struct Scene *scene,
struct Object *ob,
int type,
struct ReportList *reports);
void ED_rigidbody_constraint_remove(struct Main *bmain, struct Scene *scene, struct Object *ob);
bool ED_rigidbody_constraint_add(
Main *bmain, Scene *scene, Object *ob, int type, ReportList *reports);
void ED_rigidbody_constraint_remove(Main *bmain, Scene *scene, Object *ob);
/* operators */
void ED_operatortypes_physics(void);
void ED_keymap_physics(struct wmKeyConfig *keyconf);
void ED_operatortypes_physics();
void ED_keymap_physics(wmKeyConfig *keyconf);

View File

@@ -27,32 +27,29 @@ struct wmWindowManager;
/* `render_ops.cc` */
void ED_operatortypes_render(void);
void ED_operatortypes_render();
/* `render_update.cc` */
void ED_render_engine_changed(struct Main *bmain, bool update_scene_data);
void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *area);
void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *screen);
void ED_render_engine_changed(Main *bmain, bool update_scene_data);
void ED_render_engine_area_exit(Main *bmain, ScrArea *area);
void ED_render_view_layer_changed(Main *bmain, bScreen *screen);
/* Callbacks handling data update events coming from depsgraph. */
void ED_render_id_flush_update(const struct DEGEditorUpdateContext *update_ctx, struct ID *id);
void ED_render_id_flush_update(const DEGEditorUpdateContext *update_ctx, ID *id);
/**
* Update all 3D viewport render and draw engines on changes to the scene.
* This is called by the dependency graph when it detects changes.
*/
void ED_render_scene_update(const struct DEGEditorUpdateContext *update_ctx, bool updated);
void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, bool updated);
/**
* Update 3D viewport render or draw engine on changes to the scene or view settings.
*/
void ED_render_view3d_update(struct Depsgraph *depsgraph,
struct wmWindow *window,
struct ScrArea *area,
bool updated);
void ED_render_view3d_update(Depsgraph *depsgraph, wmWindow *window, ScrArea *area, bool updated);
struct Scene *ED_render_job_get_scene(const struct bContext *C);
struct Scene *ED_render_job_get_current_scene(const struct bContext *C);
Scene *ED_render_job_get_scene(const bContext *C);
Scene *ED_render_job_get_current_scene(const bContext *C);
/* Render the preview
*
@@ -61,47 +58,41 @@ struct Scene *ED_render_job_get_current_scene(const struct bContext *C);
* - PR_ICON_RENDER: preview is rendered for icons. hopefully fast enough for at least 32x32
* - PR_ICON_DEFERRED: No render, we just ensure deferred icon data gets generated.
*/
typedef enum ePreviewRenderMethod {
enum ePreviewRenderMethod {
PR_BUTS_RENDER = 0,
PR_ICON_RENDER = 1,
PR_ICON_DEFERRED = 2,
} ePreviewRenderMethod;
};
void ED_preview_ensure_dbase(void);
void ED_preview_free_dbase(void);
void ED_preview_ensure_dbase();
void ED_preview_free_dbase();
/**
* Check if \a id is supported by the automatic preview render.
*/
bool ED_preview_id_is_supported(const struct ID *id);
bool ED_preview_id_is_supported(const ID *id);
void ED_preview_shader_job(const struct bContext *C,
void ED_preview_shader_job(const bContext *C,
void *owner,
struct ID *id,
struct ID *parent,
struct MTex *slot,
ID *id,
ID *parent,
MTex *slot,
int sizex,
int sizey,
ePreviewRenderMethod method);
void ED_preview_icon_render(const struct bContext *C,
struct Scene *scene,
struct PreviewImage *prv_img,
struct ID *id,
enum eIconSizes icon_size);
void ED_preview_icon_job(const struct bContext *C,
struct PreviewImage *prv_img,
struct ID *id,
enum eIconSizes icon_size,
bool delay);
void ED_preview_icon_render(
const bContext *C, Scene *scene, PreviewImage *prv_img, ID *id, enum eIconSizes icon_size);
void ED_preview_icon_job(
const bContext *C, PreviewImage *prv_img, ID *id, enum eIconSizes icon_size, bool delay);
void ED_preview_restart_queue_free(void);
void ED_preview_restart_queue_add(struct ID *id, enum eIconSizes size);
void ED_preview_restart_queue_work(const struct bContext *C);
void ED_preview_restart_queue_free();
void ED_preview_restart_queue_add(ID *id, enum eIconSizes size);
void ED_preview_restart_queue_work(const bContext *C);
void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain);
void ED_preview_kill_jobs(wmWindowManager *wm, Main *bmain);
void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect);
void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slot, rcti *rect);
void ED_render_clear_mtex_copybuf(void);
void ED_render_clear_mtex_copybuf();
void ED_render_internal_init(void);
void ED_render_internal_init();

View File

@@ -12,40 +12,27 @@
#include "BKE_scene.h"
#ifdef __cplusplus
extern "C" {
#endif
struct Scene *ED_scene_add(struct Main *bmain,
struct bContext *C,
struct wmWindow *win,
eSceneCopyMethod method) ATTR_NONNULL();
Scene *ED_scene_add(Main *bmain, bContext *C, wmWindow *win, eSceneCopyMethod method)
ATTR_NONNULL();
/**
* Add a new scene in the sequence editor.
*
* Special mode for adding a scene assigned to sequencer strip.
*/
struct Scene *ED_scene_sequencer_add(struct Main *bmain,
struct bContext *C,
eSceneCopyMethod method,
bool assign_strip);
Scene *ED_scene_sequencer_add(Main *bmain,
bContext *C,
eSceneCopyMethod method,
bool assign_strip);
/**
* \note Only call outside of area/region loops.
* \return true if successful.
*/
bool ED_scene_delete(struct bContext *C, struct Main *bmain, struct Scene *scene) ATTR_NONNULL();
bool ED_scene_delete(bContext *C, Main *bmain, Scene *scene) ATTR_NONNULL();
/**
* Depsgraph updates after scene becomes active in a window.
*/
void ED_scene_change_update(struct Main *bmain, struct Scene *scene, struct ViewLayer *layer)
ATTR_NONNULL();
bool ED_scene_view_layer_delete(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *layer,
struct ReportList *reports) ATTR_NONNULL(1, 2, 3);
void ED_scene_change_update(Main *bmain, Scene *scene, ViewLayer *layer) ATTR_NONNULL();
bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, ReportList *reports)
ATTR_NONNULL(1, 2, 3);
void ED_operatortypes_scene(void);
#ifdef __cplusplus
}
#endif
void ED_operatortypes_scene();

View File

@@ -17,7 +17,7 @@ struct ARegion;
/**
* For animation playback operator, stored in #bScreen.animtimer.customdata.
*/
typedef struct ScreenAnimData {
struct ScreenAnimData {
ARegion *region; /* do not read from this, only for comparing if region exists */
short redraws;
short flag; /* flags for playback */
@@ -25,7 +25,7 @@ typedef struct ScreenAnimData {
int nextfra; /* next frame to go to (when ANIMPLAY_FLAG_USE_NEXT_FRAME is set) */
double lagging_frame_count; /* used for frame dropping */
bool from_anim_edit; /* playback was invoked from animation editor */
} ScreenAnimData;
};
/** #ScreenAnimData.flag */
enum {
@@ -48,17 +48,17 @@ enum {
/**
* For playback frame-rate info stored during runtime as `scene->fps_info`.
*/
typedef struct ScreenFrameRateInfo {
struct ScreenFrameRateInfo {
double redrawtime;
double lredrawtime;
float redrawtimes_fps[REDRAW_FRAME_AVERAGE];
short redrawtime_index;
} ScreenFrameRateInfo;
};
/* ----------------------------------------------------- */
/* Enum for Action Zone Edges. Which edge of area is action zone. */
typedef enum {
enum AZEdge {
/** Region located on the left, _right_ edge is action zone.
* Region minimized to the top left */
AE_RIGHT_TO_TOPLEFT,
@@ -71,15 +71,15 @@ typedef enum {
/** Region located at the top, _bottom_ edge is action zone.
* Region minimized to the top left */
AE_BOTTOM_TO_TOPLEFT,
} AZEdge;
};
typedef enum {
enum AZScrollDirection {
AZ_SCROLL_VERT,
AZ_SCROLL_HOR,
} AZScrollDirection;
};
/* for editing areas/regions */
typedef struct AZone {
struct AZone {
struct AZone *next, *prev;
ARegion *region;
int type;
@@ -95,7 +95,7 @@ typedef struct AZone {
rcti rect;
/* for fade in/out */
float alpha;
} AZone;
};
/** Action-Zone Type: #AZone.type */
enum {

View File

@@ -19,47 +19,42 @@ struct wmKeyConfig;
/* sculpt.cc */
void ED_operatortypes_sculpt(void);
void ED_sculpt_redraw_planes_get(float planes[4][4], struct ARegion *region, struct Object *ob);
bool ED_sculpt_mask_box_select(struct bContext *C,
struct ViewContext *vc,
const struct rcti *rect,
bool select);
void ED_operatortypes_sculpt();
void ED_sculpt_redraw_planes_get(float planes[4][4], ARegion *region, Object *ob);
bool ED_sculpt_mask_box_select(bContext *C, ViewContext *vc, const rcti *rect, bool select);
void ED_keymap_sculpt(wmKeyConfig *keyconf);
/* sculpt_transform.cc */
void ED_sculpt_update_modal_transform(struct bContext *C, struct Object *ob);
void ED_sculpt_init_transform(struct bContext *C,
struct Object *ob,
void ED_sculpt_update_modal_transform(bContext *C, Object *ob);
void ED_sculpt_init_transform(bContext *C,
Object *ob,
const float mval_fl[2],
const char *undo_name);
void ED_sculpt_end_transform(struct bContext *C, struct Object *ob);
void ED_sculpt_end_transform(bContext *C, Object *ob);
/* sculpt_undo.cc */
/** Export for ED_undo_sys. */
void ED_sculpt_undosys_type(struct UndoType *ut);
void ED_sculpt_undosys_type(UndoType *ut);
/**
* Pushes an undo step using the operator name. This is necessary for
* redo panels to work; operators that do not support that may use
* #ED_sculpt_undo_geometry_begin_ex instead if so desired.
*/
void ED_sculpt_undo_geometry_begin(struct Object *ob, const struct wmOperator *op);
void ED_sculpt_undo_geometry_begin_ex(struct Object *ob, const char *name);
void ED_sculpt_undo_geometry_end(struct Object *ob);
void ED_sculpt_undo_geometry_begin(Object *ob, const wmOperator *op);
void ED_sculpt_undo_geometry_begin_ex(Object *ob, const char *name);
void ED_sculpt_undo_geometry_end(Object *ob);
/* Face sets. */
int ED_sculpt_face_sets_find_next_available_id(struct Mesh *mesh);
void ED_sculpt_face_sets_initialize_none_to_id(struct Mesh *mesh, int new_id);
int ED_sculpt_face_sets_find_next_available_id(Mesh *mesh);
void ED_sculpt_face_sets_initialize_none_to_id(Mesh *mesh, int new_id);
int ED_sculpt_face_sets_active_update_and_get(struct bContext *C,
struct Object *ob,
const float mval_fl[2]);
int ED_sculpt_face_sets_active_update_and_get(bContext *C, Object *ob, const float mval_fl[2]);
/* Undo for changes happening on a base mesh for multires sculpting.
* if there is no multi-res sculpt active regular undo is used. */
void ED_sculpt_undo_push_multires_mesh_begin(struct bContext *C, const char *str);
void ED_sculpt_undo_push_multires_mesh_end(struct bContext *C, const char *str);
void ED_sculpt_undo_push_multires_mesh_begin(bContext *C, const char *str);
void ED_sculpt_undo_push_multires_mesh_end(bContext *C, const char *str);

View File

@@ -11,6 +11,7 @@
#include "BLI_compiler_attrs.h"
struct KDTree_1d;
struct PointerRNA;
struct wmOperatorType;
enum {
@@ -20,28 +21,28 @@ enum {
SEL_INVERT = 3,
};
typedef enum WalkSelectDirection {
enum WalkSelectDirection {
UI_SELECT_WALK_UP,
UI_SELECT_WALK_DOWN,
UI_SELECT_WALK_LEFT,
UI_SELECT_WALK_RIGHT,
} WalkSelectDirections;
};
/** See #WM_operator_properties_select_operation */
typedef enum {
enum eSelectOp {
SEL_OP_ADD = 1,
SEL_OP_SUB,
SEL_OP_SET,
SEL_OP_AND,
SEL_OP_XOR,
} eSelectOp;
};
/* Select Similar */
typedef enum {
enum eSimilarCmp {
SIM_CMP_EQ = 0,
SIM_CMP_GT,
SIM_CMP_LT,
} eSimilarCmp;
};
#define SEL_OP_USE_OUTSIDE(sel_op) (ELEM(sel_op, SEL_OP_AND))
#define SEL_OP_USE_PRE_DESELECT(sel_op) (ELEM(sel_op, SEL_OP_SET))
@@ -61,7 +62,7 @@ int ED_select_op_action(eSelectOp sel_op, bool is_select, bool is_inside);
int ED_select_op_action_deselected(eSelectOp sel_op, bool is_select, bool is_inside);
bool ED_select_similar_compare_float(float delta, float thresh, eSimilarCmp compare);
bool ED_select_similar_compare_float_tree(const struct KDTree_1d *tree,
bool ED_select_similar_compare_float_tree(const KDTree_1d *tree,
float length,
float thresh,
eSimilarCmp compare);
@@ -94,19 +95,18 @@ struct SelectPick_Params {
/**
* Utility to get #eSelectPickMode from booleans for convenience.
*/
eSelectOp ED_select_op_from_operator(struct PointerRNA *ptr)
ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
eSelectOp ED_select_op_from_operator(PointerRNA *ptr) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT;
/**
* Initialize `params` from `op`,
* these properties are defined by #WM_operator_properties_mouse_select.
*/
void ED_select_pick_params_from_operator(struct PointerRNA *ptr, struct SelectPick_Params *params)
void ED_select_pick_params_from_operator(PointerRNA *ptr, SelectPick_Params *params)
ATTR_NONNULL(1, 2);
/**
* Get-name callback for #wmOperatorType.get_name, this is mainly useful so the selection
* action is shown in the status-bar.
*/
const char *ED_select_pick_get_name(struct wmOperatorType *ot, PointerRNA *ptr);
const char *ED_select_circle_get_name(struct wmOperatorType *ot, PointerRNA *ptr);
const char *ED_select_pick_get_name(wmOperatorType *ot, PointerRNA *ptr);
const char *ED_select_circle_get_name(wmOperatorType *ot, PointerRNA *ptr);

View File

@@ -13,38 +13,35 @@ struct Sequence;
struct SpaceSeq;
struct bContext;
void ED_sequencer_select_sequence_single(struct Scene *scene,
struct Sequence *seq,
bool deselect_all);
void ED_sequencer_select_sequence_single(Scene *scene, Sequence *seq, bool deselect_all);
/**
* Iterates over a scene's sequences and deselects all of them.
*
* \param scene: scene containing sequences to be deselected.
* \return true if any sequences were deselected; false otherwise.
*/
bool ED_sequencer_deselect_all(struct Scene *scene);
bool ED_sequencer_deselect_all(Scene *scene);
bool ED_space_sequencer_maskedit_mask_poll(struct bContext *C);
bool ED_space_sequencer_check_show_maskedit(struct SpaceSeq *sseq, struct Scene *scene);
bool ED_space_sequencer_maskedit_poll(struct bContext *C);
bool ED_space_sequencer_maskedit_mask_poll(bContext *C);
bool ED_space_sequencer_check_show_maskedit(SpaceSeq *sseq, Scene *scene);
bool ED_space_sequencer_maskedit_poll(bContext *C);
/**
* Are we displaying the seq output (not channels or histogram).
*/
bool ED_space_sequencer_check_show_imbuf(struct SpaceSeq *sseq);
bool ED_space_sequencer_check_show_imbuf(SpaceSeq *sseq);
bool ED_space_sequencer_check_show_strip(struct SpaceSeq *sseq);
bool ED_space_sequencer_check_show_strip(SpaceSeq *sseq);
/**
* Check if there is animation shown during playback.
*
* - Colors of color strips are displayed on the strip itself.
* - Backdrop is drawn.
*/
bool ED_space_sequencer_has_playback_animation(const struct SpaceSeq *sseq,
const struct Scene *scene);
bool ED_space_sequencer_has_playback_animation(const SpaceSeq *sseq, const Scene *scene);
void ED_operatormacros_sequencer(void);
void ED_operatormacros_sequencer();
Sequence *ED_sequencer_special_preview_get(void);
void ED_sequencer_special_preview_set(struct bContext *C, const int mval[2]);
void ED_sequencer_special_preview_clear(void);
Sequence *ED_sequencer_special_preview_get();
void ED_sequencer_special_preview_set(bContext *C, const int mval[2]);
void ED_sequencer_special_preview_clear();

View File

@@ -8,4 +8,4 @@
#pragma once
void ED_operatortypes_sound(void);
void ED_operatortypes_sound();

View File

@@ -12,8 +12,8 @@ struct ARegionType;
struct bContext;
/* Only called once on startup. storage is global in BKE kernel listbase. */
void ED_spacetypes_init(void);
void ED_spacemacros_init(void);
void ED_spacetypes_init();
void ED_spacemacros_init();
/* The plugin-able API for export to editors. */
@@ -23,26 +23,26 @@ void ED_spacemacros_init(void);
* Calls for registering default spaces, only called once, from #ED_spacetypes_init
* \{ */
void ED_spacetype_outliner(void);
void ED_spacetype_view3d(void);
void ED_spacetype_ipo(void);
void ED_spacetype_image(void);
void ED_spacetype_node(void);
void ED_spacetype_buttons(void);
void ED_spacetype_info(void);
void ED_spacetype_file(void);
void ED_spacetype_action(void);
void ED_spacetype_nla(void);
void ED_spacetype_script(void);
void ED_spacetype_text(void);
void ED_spacetype_sequencer(void);
void ED_spacetype_logic(void);
void ED_spacetype_console(void);
void ED_spacetype_userpref(void);
void ED_spacetype_clip(void);
void ED_spacetype_statusbar(void);
void ED_spacetype_topbar(void);
void ED_spacetype_spreadsheet(void);
void ED_spacetype_outliner();
void ED_spacetype_view3d();
void ED_spacetype_ipo();
void ED_spacetype_image();
void ED_spacetype_node();
void ED_spacetype_buttons();
void ED_spacetype_info();
void ED_spacetype_file();
void ED_spacetype_action();
void ED_spacetype_nla();
void ED_spacetype_script();
void ED_spacetype_text();
void ED_spacetype_sequencer();
void ED_spacetype_logic();
void ED_spacetype_console();
void ED_spacetype_userpref();
void ED_spacetype_clip();
void ED_spacetype_statusbar();
void ED_spacetype_topbar();
void ED_spacetype_spreadsheet();
/** \} */
@@ -51,8 +51,8 @@ void ED_spacetype_spreadsheet(void);
* Calls for instancing and freeing space-type static data called in #WM_init_exit
* \{ */
void ED_file_init(void);
void ED_file_exit(void);
void ED_file_init();
void ED_file_exit();
/** \} */
@@ -61,13 +61,11 @@ void ED_file_exit(void);
#define REGION_DRAW_PRE_VIEW 2
#define REGION_DRAW_BACKDROP 3
void *ED_region_draw_cb_activate(struct ARegionType *art,
void (*draw)(const struct bContext *, struct ARegion *, void *),
void *ED_region_draw_cb_activate(ARegionType *art,
void (*draw)(const bContext *, ARegion *, void *),
void *customdata,
int type);
void ED_region_draw_cb_draw(const struct bContext *C, struct ARegion *region, int type);
void ED_region_surface_draw_cb_draw(struct ARegionType *art, int type);
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle);
void ED_region_draw_cb_remove_by_type(struct ARegionType *art,
void *draw_fn,
void (*free)(void *));
void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type);
void ED_region_surface_draw_cb_draw(ARegionType *art, int type);
bool ED_region_draw_cb_exit(ARegionType *art, void *handle);
void ED_region_draw_cb_remove_by_type(ARegionType *art, void *draw_fn, void (*free)(void *));

View File

@@ -7,4 +7,4 @@
struct ID;
struct SpaceSpreadsheet;
struct ID *ED_spreadsheet_get_current_id(const struct SpaceSpreadsheet *sspreadsheet);
ID *ED_spreadsheet_get_current_id(const SpaceSpreadsheet *sspreadsheet);

View File

@@ -8,7 +8,6 @@
#pragma once
struct ARegion;
struct SpaceText;
struct Text;
@@ -16,32 +15,31 @@ struct UndoStep;
struct UndoType;
struct bContext;
bool ED_text_activate_in_screen(struct bContext *C, struct Text *text);
bool ED_text_activate_in_screen(bContext *C, Text *text);
/**
* Moves the view to the cursor location, also used to make sure the view isn't outside the file.
*/
void ED_text_scroll_to_cursor(struct SpaceText *st, struct ARegion *region, bool center);
void ED_text_scroll_to_cursor(SpaceText *st, ARegion *region, bool center);
/**
* Takes a cursor (row, character) and returns x,y pixel coords.
*/
bool ED_text_region_location_from_cursor(struct SpaceText *st,
struct ARegion *region,
bool ED_text_region_location_from_cursor(SpaceText *st,
ARegion *region,
const int cursor_co[2],
int r_pixel_co[2]);
/* text_undo.cc */
/** Export for ED_undo_sys. */
void ED_text_undosys_type(struct UndoType *ut);
void ED_text_undosys_type(UndoType *ut);
/** Use operator system to finish the undo step. */
struct UndoStep *ED_text_undo_push_init(struct bContext *C);
UndoStep *ED_text_undo_push_init(bContext *C);
/* `text_format.cc` */
const char *ED_text_format_comment_line_prefix(struct Text *text);
bool ED_text_is_syntax_highlight_supported(struct Text *text);
const char *ED_text_format_comment_line_prefix(Text *text);
bool ED_text_is_syntax_highlight_supported(Text *text);

View File

@@ -13,18 +13,16 @@ struct bDopeSheet;
struct wmEvent;
struct rcti;
void ED_time_scrub_draw_current_frame(const struct ARegion *region,
const struct Scene *scene,
void ED_time_scrub_draw_current_frame(const ARegion *region,
const Scene *scene,
bool display_seconds);
void ED_time_scrub_draw(const struct ARegion *region,
const struct Scene *scene,
void ED_time_scrub_draw(const ARegion *region,
const Scene *scene,
bool display_seconds,
bool discrete_frames);
bool ED_time_scrub_event_in_region(const struct ARegion *region, const struct wmEvent *event);
bool ED_time_scrub_event_in_region(const ARegion *region, const wmEvent *event);
void ED_time_scrub_channel_search_draw(const struct bContext *C,
struct ARegion *region,
struct bDopeSheet *dopesheet);
void ED_time_scrub_region_rect_get(const struct ARegion *region, struct rcti *rect);
void ED_time_scrub_channel_search_draw(const bContext *C, ARegion *region, bDopeSheet *dopesheet);
void ED_time_scrub_region_rect_get(const ARegion *region, rcti *rect);

View File

@@ -12,13 +12,21 @@
/* ******************* Registration Function ********************** */
struct Object;
struct ARegion;
struct bContext;
struct Scene;
struct ReportList;
struct TransformOrientation;
struct Object;
struct RegionView3D;
struct View3D;
struct ViewLayer;
struct wmGizmoGroupType;
struct wmKeyConfig;
struct wmOperatorType;
void ED_keymap_transform(struct wmKeyConfig *keyconf);
void transform_operatortypes(void);
void ED_keymap_transform(wmKeyConfig *keyconf);
void transform_operatortypes();
/* ******************** Macros & Prototypes *********************** */
@@ -66,42 +74,31 @@ enum eTfmMode {
/* Standalone call to get the transformation center corresponding to the current situation
* returns 1 if successful, 0 otherwise (usually means there's no selection)
* (if false is returns, `cent3d` is unmodified). */
bool calculateTransformCenter(struct bContext *C,
int centerMode,
float cent3d[3],
float cent2d[2]);
struct Object;
struct Scene;
struct wmGizmoGroupType;
bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2]);
/* UNUSED */
// int BIF_snappingSupported(struct Object *obedit);
struct ReportList;
struct TransformOrientation;
struct bContext;
void BIF_clearTransformOrientation(struct bContext *C);
void BIF_removeTransformOrientation(struct bContext *C, struct TransformOrientation *target);
void BIF_removeTransformOrientationIndex(struct bContext *C, int index);
bool BIF_createTransformOrientation(struct bContext *C,
struct ReportList *reports,
void BIF_clearTransformOrientation(bContext *C);
void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target);
void BIF_removeTransformOrientationIndex(bContext *C, int index);
bool BIF_createTransformOrientation(bContext *C,
ReportList *reports,
const char *name,
bool use_view,
bool activate,
bool overwrite);
void BIF_selectTransformOrientation(struct bContext *C, struct TransformOrientation *target);
void BIF_selectTransformOrientation(bContext *C, TransformOrientation *target);
void ED_getTransformOrientationMatrix(const struct Scene *scene,
struct ViewLayer *view_layer,
const struct View3D *v3d,
struct Object *ob,
struct Object *obedit,
void ED_getTransformOrientationMatrix(const Scene *scene,
ViewLayer *view_layer,
const View3D *v3d,
Object *ob,
Object *obedit,
short around,
float r_orientation_mat[3][3]);
int BIF_countTransformOrientation(const struct bContext *C);
int BIF_countTransformOrientation(const bContext *C);
/* to be able to add operator properties to other operators */
@@ -128,10 +125,10 @@ int BIF_countTransformOrientation(const struct bContext *C);
/* For properties performed when confirming the transformation. */
#define P_POST_TRANSFORM (1 << 20)
void Transform_Properties(struct wmOperatorType *ot, int flags);
void Transform_Properties(wmOperatorType *ot, int flags);
/* `transform_orientations.cc` */
void ED_transform_calc_orientation_from_type(const struct bContext *C, float r_mat[3][3]);
void ED_transform_calc_orientation_from_type(const bContext *C, float r_mat[3][3]);
/**
* \note The resulting matrix may not be orthogonal,
* callers that depend on `r_mat` to be orthogonal should use #orthogonalize_m3.
@@ -141,38 +138,36 @@ void ED_transform_calc_orientation_from_type(const struct bContext *C, float r_m
* - #V3D_ORIENT_LOCAL may contain shear from non-uniform scale in parent/child relationships.
* - #V3D_ORIENT_CUSTOM may have been created from #V3D_ORIENT_LOCAL.
*/
short ED_transform_calc_orientation_from_type_ex(const struct Scene *scene,
struct ViewLayer *view_layer,
const struct View3D *v3d,
const struct RegionView3D *rv3d,
struct Object *ob,
struct Object *obedit,
short ED_transform_calc_orientation_from_type_ex(const Scene *scene,
ViewLayer *view_layer,
const View3D *v3d,
const RegionView3D *rv3d,
Object *ob,
Object *obedit,
short orientation_index,
int pivot_point,
float r_mat[3][3]);
bool ED_transform_calc_pivot_pos(const struct bContext *C,
const short pivot_type,
float r_pivot_pos[3]);
bool ED_transform_calc_pivot_pos(const bContext *C, const short pivot_type, float r_pivot_pos[3]);
/* transform gizmos */
void VIEW3D_GGT_xform_gizmo(struct wmGizmoGroupType *gzgt);
void VIEW3D_GGT_xform_gizmo(wmGizmoGroupType *gzgt);
/**
* Only poll, flag & gzmap_params differ.
*/
void VIEW3D_GGT_xform_gizmo_context(struct wmGizmoGroupType *gzgt);
void VIEW3D_GGT_xform_cage(struct wmGizmoGroupType *gzgt);
void VIEW3D_GGT_xform_shear(struct wmGizmoGroupType *gzgt);
void VIEW3D_GGT_xform_gizmo_context(wmGizmoGroupType *gzgt);
void VIEW3D_GGT_xform_cage(wmGizmoGroupType *gzgt);
void VIEW3D_GGT_xform_shear(wmGizmoGroupType *gzgt);
/* `transform_gizmo_extrude_3d.cc` */
void VIEW3D_GGT_xform_extrude(struct wmGizmoGroupType *gzgt);
void VIEW3D_GGT_xform_extrude(wmGizmoGroupType *gzgt);
/* Generic 2D transform gizmo callback assignment. */
void ED_widgetgroup_gizmo2d_xform_callbacks_set(struct wmGizmoGroupType *gzgt);
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(struct wmGizmoGroupType *gzgt);
void ED_widgetgroup_gizmo2d_resize_callbacks_set(struct wmGizmoGroupType *gzgt);
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(struct wmGizmoGroupType *gzgt);
void ED_widgetgroup_gizmo2d_xform_callbacks_set(wmGizmoGroupType *gzgt);
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(wmGizmoGroupType *gzgt);
void ED_widgetgroup_gizmo2d_resize_callbacks_set(wmGizmoGroupType *gzgt);
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(wmGizmoGroupType *gzgt);
#define SNAP_INCREMENTAL_ANGLE DEG2RAD(5.0)
@@ -203,10 +198,10 @@ struct TransformCalcParams {
*
* Returns total items selected.
*/
int ED_transform_calc_gizmo_stats(const struct bContext *C,
const struct TransformCalcParams *params,
struct TransformBounds *tbounds,
struct RegionView3D *rv3d);
int ED_transform_calc_gizmo_stats(const bContext *C,
const TransformCalcParams *params,
TransformBounds *tbounds,
RegionView3D *rv3d);
/**
* Iterates over all the strips and finds the closest snapping candidate of either \a frame_1 or \a
@@ -214,11 +209,11 @@ int ED_transform_calc_gizmo_stats(const struct bContext *C,
* strip.
* \returns True if there was anything to snap to.
*/
bool ED_transform_snap_sequencer_to_closest_strip_calc(struct Scene *scene,
struct ARegion *region,
bool ED_transform_snap_sequencer_to_closest_strip_calc(Scene *scene,
ARegion *region,
int frame_1,
int frame_2,
int *r_snap_distance,
float *r_snap_frame);
void ED_draw_sequencer_snap_point(struct bContext *C, float snap_point);
void ED_draw_sequencer_snap_point(bContext *C, float snap_point);

View File

@@ -27,11 +27,11 @@ struct View3D;
/* ED_transform_snap_object_*** API */
typedef enum eSnapEditType {
enum eSnapEditType {
SNAP_GEOM_FINAL = 0,
SNAP_GEOM_CAGE = 1,
SNAP_GEOM_EDIT = 2, /* Bmesh for mesh-type. */
} eSnapEditType;
};
/** used for storing multiple hits */
struct SnapObjectHitDepth {
@@ -61,22 +61,22 @@ struct SnapObjectParams {
bool keep_on_same_target : 1;
};
typedef struct SnapObjectContext SnapObjectContext;
SnapObjectContext *ED_transform_snap_object_context_create(struct Scene *scene, int flag);
struct SnapObjectContext;
SnapObjectContext *ED_transform_snap_object_context_create(Scene *scene, int flag);
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx);
/* callbacks to filter how snap works */
void ED_transform_snap_object_context_set_editmesh_callbacks(
SnapObjectContext *sctx,
bool (*test_vert_fn)(struct BMVert *, void *user_data),
bool (*test_edge_fn)(struct BMEdge *, void *user_data),
bool (*test_face_fn)(struct BMFace *, void *user_data),
bool (*test_vert_fn)(BMVert *, void *user_data),
bool (*test_edge_fn)(BMEdge *, void *user_data),
bool (*test_face_fn)(BMFace *, void *user_data),
void *user_data);
bool ED_transform_snap_object_project_ray_ex(struct SnapObjectContext *sctx,
struct Depsgraph *depsgraph,
bool ED_transform_snap_object_project_ray_ex(SnapObjectContext *sctx,
Depsgraph *depsgraph,
const View3D *v3d,
const struct SnapObjectParams *params,
const SnapObjectParams *params,
const float ray_start[3],
const float ray_normal[3],
float *ray_depth,
@@ -84,12 +84,12 @@ bool ED_transform_snap_object_project_ray_ex(struct SnapObjectContext *sctx,
float r_loc[3],
float r_no[3],
int *r_index,
struct Object **r_ob,
Object **r_ob,
float r_obmat[4][4]);
bool ED_transform_snap_object_project_ray(SnapObjectContext *sctx,
struct Depsgraph *depsgraph,
Depsgraph *depsgraph,
const View3D *v3d,
const struct SnapObjectParams *params,
const SnapObjectParams *params,
const float ray_origin[3],
const float ray_direction[3],
float *ray_depth,
@@ -104,14 +104,14 @@ bool ED_transform_snap_object_project_ray(SnapObjectContext *sctx,
* \param r_hit_list: List of #SnapObjectHitDepth (caller must free).
*/
bool ED_transform_snap_object_project_ray_all(SnapObjectContext *sctx,
struct Depsgraph *depsgraph,
Depsgraph *depsgraph,
const View3D *v3d,
const struct SnapObjectParams *params,
const SnapObjectParams *params,
const float ray_start[3],
const float ray_normal[3],
float ray_depth,
bool sort,
struct ListBase *r_hit_list);
ListBase *r_hit_list);
/**
* Perform snapping.
@@ -133,12 +133,12 @@ bool ED_transform_snap_object_project_ray_all(SnapObjectContext *sctx,
* \param r_face_nor: World-space normal of snapped-to target face (optional).
* \return Snapped-to element, #eSnapMode.
*/
eSnapMode ED_transform_snap_object_project_view3d_ex(struct SnapObjectContext *sctx,
struct Depsgraph *depsgraph,
eSnapMode ED_transform_snap_object_project_view3d_ex(SnapObjectContext *sctx,
Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
const eSnapMode snap_to,
const struct SnapObjectParams *params,
const SnapObjectParams *params,
const float init_co[3],
const float mval[2],
const float prev_co[3],
@@ -146,7 +146,7 @@ eSnapMode ED_transform_snap_object_project_view3d_ex(struct SnapObjectContext *s
float r_loc[3],
float r_no[3],
int *r_index,
struct Object **r_ob,
Object **r_ob,
float r_obmat[4][4],
float r_face_nor[3]);
/**
@@ -165,12 +165,12 @@ eSnapMode ED_transform_snap_object_project_view3d_ex(struct SnapObjectContext *s
* \param r_no: Snapped world-space normal (optional).
* \return Snapped-to element, #eSnapMode.
*/
eSnapMode ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx,
struct Depsgraph *depsgraph,
eSnapMode ED_transform_snap_object_project_view3d(SnapObjectContext *sctx,
Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
const eSnapMode snap_to,
const struct SnapObjectParams *params,
const SnapObjectParams *params,
const float init_co[3],
const float mval[2],
const float prev_co[3],
@@ -183,17 +183,17 @@ eSnapMode ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx
* see: #ED_transform_snap_object_project_ray_all
*/
bool ED_transform_snap_object_project_all_view3d_ex(SnapObjectContext *sctx,
struct Depsgraph *depsgraph,
Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
const struct SnapObjectParams *params,
const SnapObjectParams *params,
const float mval[2],
float ray_depth,
bool sort,
ListBase *r_hit_list);
#ifdef DEBUG_SNAP_TIME
void ED_transform_snap_object_time_average_print(void);
void ED_transform_snap_object_time_average_print();
#else
# define ED_transform_snap_object_time_average_print() void(0)
#endif

View File

@@ -11,28 +11,28 @@
struct Object;
struct bContext;
typedef struct TransVert {
struct TransVert {
float *loc;
float oldloc[3], maploc[3];
float normal[3];
int flag;
} TransVert;
};
typedef struct TransVertStore {
struct TransVert *transverts;
struct TransVertStore {
TransVert *transverts;
int transverts_tot;
int mode;
} TransVertStore;
};
/**
* \param obedit: When `mode` has the #TM_CALC_MAPLOC flag set, `obedit` must be evaluated,
* to access evaluated vertices.
*/
void ED_transverts_create_from_obedit(TransVertStore *tvs, const struct Object *obedit, int mode);
void ED_transverts_update_obedit(TransVertStore *tvs, struct Object *obedit);
void ED_transverts_create_from_obedit(TransVertStore *tvs, const Object *obedit, int mode);
void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit);
void ED_transverts_free(TransVertStore *tvs);
bool ED_transverts_check_obedit(const struct Object *obedit);
bool ED_transverts_poll(struct bContext *C);
bool ED_transverts_check_obedit(const Object *obedit);
bool ED_transverts_poll(bContext *C);
/* currently only used for bmesh index values */
enum {

View File

@@ -15,6 +15,7 @@ struct Base;
struct CLG_LogRef;
struct Object;
struct Scene;
struct MemFile;
struct UndoStack;
struct ViewLayer;
struct bContext;
@@ -26,38 +27,38 @@ struct wmOperatorType;
/**
* Run from the main event loop, basic checks that undo is left in a correct state.
*/
bool ED_undo_is_state_valid(struct bContext *C);
void ED_undo_group_begin(struct bContext *C);
void ED_undo_group_end(struct bContext *C);
void ED_undo_push(struct bContext *C, const char *str);
void ED_undo_push_op(struct bContext *C, struct wmOperator *op);
void ED_undo_grouped_push(struct bContext *C, const char *str);
void ED_undo_grouped_push_op(struct bContext *C, struct wmOperator *op);
void ED_undo_pop_op(struct bContext *C, struct wmOperator *op);
void ED_undo_pop(struct bContext *C);
void ED_undo_redo(struct bContext *C);
void ED_OT_undo(struct wmOperatorType *ot);
void ED_OT_undo_push(struct wmOperatorType *ot);
void ED_OT_redo(struct wmOperatorType *ot);
void ED_OT_undo_redo(struct wmOperatorType *ot);
void ED_OT_undo_history(struct wmOperatorType *ot);
bool ED_undo_is_state_valid(bContext *C);
void ED_undo_group_begin(bContext *C);
void ED_undo_group_end(bContext *C);
void ED_undo_push(bContext *C, const char *str);
void ED_undo_push_op(bContext *C, wmOperator *op);
void ED_undo_grouped_push(bContext *C, const char *str);
void ED_undo_grouped_push_op(bContext *C, wmOperator *op);
void ED_undo_pop_op(bContext *C, wmOperator *op);
void ED_undo_pop(bContext *C);
void ED_undo_redo(bContext *C);
void ED_OT_undo(wmOperatorType *ot);
void ED_OT_undo_push(wmOperatorType *ot);
void ED_OT_redo(wmOperatorType *ot);
void ED_OT_undo_redo(wmOperatorType *ot);
void ED_OT_undo_history(wmOperatorType *ot);
/**
* UI callbacks should call this rather than calling WM_operator_repeat() themselves.
*/
int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op);
int ED_undo_operator_repeat(bContext *C, wmOperator *op);
/**
* Convenience since UI callbacks use this mostly.
*/
void ED_undo_operator_repeat_cb(struct bContext *C, void *arg_op, void *arg_unused);
void ED_undo_operator_repeat_cb_evt(struct bContext *C, void *arg_op, int arg_unused);
void ED_undo_operator_repeat_cb(bContext *C, void *arg_op, void *arg_unused);
void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int arg_unused);
/**
* Name optionally, function used to check for operator redo panel.
*/
bool ED_undo_is_valid(const struct bContext *C, const char *undoname);
bool ED_undo_is_valid(const bContext *C, const char *undoname);
bool ED_undo_is_memfile_compatible(const struct bContext *C);
bool ED_undo_is_memfile_compatible(const bContext *C);
/* Unfortunate workaround for limits mixing undo systems. */
@@ -69,22 +70,22 @@ bool ED_undo_is_memfile_compatible(const struct bContext *C);
* For example, changing a brush property isn't stored by sculpt-mode undo steps.
* This workaround is needed until the limitation is removed, see: #61948.
*/
bool ED_undo_is_legacy_compatible_for_property(struct bContext *C, struct ID *id);
bool ED_undo_is_legacy_compatible_for_property(bContext *C, ID *id);
/**
* Load all our objects from `object_array` into edit-mode, clear everything else.
*/
void ED_undo_object_editmode_restore_helper(struct bContext *C,
struct Object **object_array,
void ED_undo_object_editmode_restore_helper(bContext *C,
Object **object_array,
uint object_array_len,
uint object_array_stride);
struct Object **ED_undo_editmode_objects_from_view_layer(const struct Scene *scene,
struct ViewLayer *view_layer,
uint *r_len);
struct Base **ED_undo_editmode_bases_from_view_layer(const struct Scene *scene,
struct ViewLayer *view_layer,
uint *r_len);
Object **ED_undo_editmode_objects_from_view_layer(const Scene *scene,
ViewLayer *view_layer,
uint *r_len);
Base **ED_undo_editmode_bases_from_view_layer(const Scene *scene,
ViewLayer *view_layer,
uint *r_len);
/**
* Ideally we won't access the stack directly,
@@ -93,24 +94,21 @@ struct Base **ED_undo_editmode_bases_from_view_layer(const struct Scene *scene,
* Using global isn't great, this just avoids doing inline,
* causing 'BKE_global.h' & 'BKE_main.h' includes.
*/
struct UndoStack *ED_undo_stack_get(void);
UndoStack *ED_undo_stack_get();
/* Helpers. */
void ED_undo_object_set_active_or_warn(struct Scene *scene,
struct ViewLayer *view_layer,
struct Object *ob,
const char *info,
struct CLG_LogRef *log);
void ED_undo_object_set_active_or_warn(
Scene *scene, ViewLayer *view_layer, Object *ob, const char *info, CLG_LogRef *log);
/* `undo_system_types.cc` */
void ED_undosys_type_init(void);
void ED_undosys_type_free(void);
void ED_undosys_type_init();
void ED_undosys_type_free();
/* `memfile_undo.cc` */
struct MemFile *ED_undosys_stack_memfile_get_active(struct UndoStack *ustack);
MemFile *ED_undosys_stack_memfile_get_active(UndoStack *ustack);
/**
* If the last undo step is a memfile one, find the first #MemFileChunk matching given ID
* (using its session UUID), and tag it as "changed in the future".
@@ -126,4 +124,4 @@ struct MemFile *ED_undosys_stack_memfile_get_active(struct UndoStack *ustack);
* to first #MemFileChunk in #MemFile itself
* (currently we only do that in #MemFileWriteData when writing a new step).
*/
void ED_undosys_stack_memfile_id_changed_tag(struct UndoStack *ustack, struct ID *id);
void ED_undosys_stack_memfile_id_changed_tag(UndoStack *ustack, ID *id);

View File

@@ -8,4 +8,4 @@
#pragma once
void ED_operatortypes_userpref(void);
void ED_operatortypes_userpref();

View File

@@ -18,9 +18,9 @@ struct wmOperator;
/* `ed_util_imbuf.cc` */
void ED_imbuf_sample_draw(const struct bContext *C, struct ARegion *region, void *arg_info);
void ED_imbuf_sample_exit(struct bContext *C, struct wmOperator *op);
int ED_imbuf_sample_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
int ED_imbuf_sample_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
void ED_imbuf_sample_cancel(struct bContext *C, struct wmOperator *op);
bool ED_imbuf_sample_poll(struct bContext *C);
void ED_imbuf_sample_draw(const bContext *C, ARegion *region, void *arg_info);
void ED_imbuf_sample_exit(bContext *C, wmOperator *op);
int ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event);
int ED_imbuf_sample_modal(bContext *C, wmOperator *op, const wmEvent *event);
void ED_imbuf_sample_cancel(bContext *C, wmOperator *op);
bool ED_imbuf_sample_poll(bContext *C);

View File

@@ -32,73 +32,52 @@ struct wmKeyConfig;
/* `uvedit_ops.cc` */
void ED_operatortypes_uvedit(void);
void ED_operatormacros_uvedit(void);
void ED_keymap_uvedit(struct wmKeyConfig *keyconf);
void ED_operatortypes_uvedit();
void ED_operatormacros_uvedit();
void ED_keymap_uvedit(wmKeyConfig *keyconf);
bool ED_uvedit_minmax(const struct Scene *scene,
struct Object *obedit,
float min[2],
float max[2]);
bool ED_uvedit_minmax(const Scene *scene, Object *obedit, float min[2], float max[2]);
/**
* Be careful when using this, it bypasses all synchronization options.
*/
void ED_uvedit_select_all(struct BMesh *bm);
void ED_uvedit_select_all(BMesh *bm);
bool ED_uvedit_minmax_multi(const struct Scene *scene,
struct Object **objects_edit,
uint objects_len,
float r_min[2],
float r_max[2]);
bool ED_uvedit_center_multi(const struct Scene *scene,
struct Object **objects_edit,
uint objects_len,
float r_cent[2],
char mode);
bool ED_uvedit_minmax_multi(
const Scene *scene, Object **objects_edit, uint objects_len, float r_min[2], float r_max[2]);
bool ED_uvedit_center_multi(
const Scene *scene, Object **objects_edit, uint objects_len, float r_cent[2], char mode);
bool ED_uvedit_center_from_pivot_ex(struct SpaceImage *sima,
struct Scene *scene,
struct ViewLayer *view_layer,
bool ED_uvedit_center_from_pivot_ex(SpaceImage *sima,
Scene *scene,
ViewLayer *view_layer,
float r_center[2],
char mode,
bool *r_has_select);
bool ED_uvedit_center_from_pivot(struct SpaceImage *sima,
struct Scene *scene,
struct ViewLayer *view_layer,
float r_center[2],
char mode);
bool ED_uvedit_center_from_pivot(
SpaceImage *sima, Scene *scene, ViewLayer *view_layer, float r_center[2], char mode);
bool ED_object_get_active_image(struct Object *ob,
bool ED_object_get_active_image(Object *ob,
int mat_nr,
struct Image **r_ima,
struct ImageUser **r_iuser,
const struct bNode **r_node,
const struct bNodeTree **r_ntree);
void ED_object_assign_active_image(struct Main *bmain,
struct Object *ob,
int mat_nr,
struct Image *ima);
Image **r_ima,
ImageUser **r_iuser,
const bNode **r_node,
const bNodeTree **r_ntree);
void ED_object_assign_active_image(Main *bmain, Object *ob, int mat_nr, Image *ima);
bool ED_uvedit_test(struct Object *obedit);
bool ED_uvedit_test(Object *obedit);
/* Visibility and selection tests. */
bool uvedit_face_visible_test_ex(const struct ToolSettings *ts, struct BMFace *efa);
bool uvedit_face_select_test_ex(const struct ToolSettings *ts,
struct BMFace *efa,
BMUVOffsets offsets);
bool uvedit_face_visible_test_ex(const ToolSettings *ts, BMFace *efa);
bool uvedit_face_select_test_ex(const ToolSettings *ts, BMFace *efa, BMUVOffsets offsets);
bool uvedit_edge_select_test_ex(const struct ToolSettings *ts,
struct BMLoop *l,
BMUVOffsets offsets);
bool uvedit_uv_select_test_ex(const struct ToolSettings *ts,
struct BMLoop *l,
BMUVOffsets offsets);
bool uvedit_edge_select_test_ex(const ToolSettings *ts, BMLoop *l, BMUVOffsets offsets);
bool uvedit_uv_select_test_ex(const ToolSettings *ts, BMLoop *l, BMUVOffsets offsets);
bool uvedit_face_visible_test(const struct Scene *scene, struct BMFace *efa);
bool uvedit_face_select_test(const struct Scene *scene, struct BMFace *efa, BMUVOffsets offsets);
bool uvedit_edge_select_test(const struct Scene *scene, struct BMLoop *l, BMUVOffsets offsets);
bool uvedit_uv_select_test(const struct Scene *scene, struct BMLoop *l, BMUVOffsets offsets);
bool uvedit_face_visible_test(const Scene *scene, BMFace *efa);
bool uvedit_face_select_test(const Scene *scene, BMFace *efa, BMUVOffsets offsets);
bool uvedit_edge_select_test(const Scene *scene, BMLoop *l, BMUVOffsets offsets);
bool uvedit_uv_select_test(const Scene *scene, BMLoop *l, BMUVOffsets offsets);
/* Individual UV element selection functions. */
@@ -107,86 +86,56 @@ bool uvedit_uv_select_test(const struct Scene *scene, struct BMLoop *l, BMUVOffs
*
* Changes selection state of a single UV Face.
*/
void uvedit_face_select_set(const struct Scene *scene,
struct BMesh *bm,
struct BMFace *efa,
bool select,
bool do_history,
BMUVOffsets offsets);
void uvedit_face_select_set(
const Scene *scene, BMesh *bm, BMFace *efa, bool select, bool do_history, BMUVOffsets offsets);
/**
* \brief Select UV Edge
*
* Changes selection state of a single UV Edge.
*/
void uvedit_edge_select_set(const struct Scene *scene,
struct BMesh *bm,
struct BMLoop *l,
bool select,
bool do_history,
BMUVOffsets offsets);
void uvedit_edge_select_set(
const Scene *scene, BMesh *bm, BMLoop *l, bool select, bool do_history, BMUVOffsets offsets);
/**
* \brief Select UV Vertex
*
* Changes selection state of a single UV vertex.
*/
void uvedit_uv_select_set(const struct Scene *scene,
struct BMesh *bm,
struct BMLoop *l,
bool select,
bool do_history,
BMUVOffsets offsets);
void uvedit_uv_select_set(
const Scene *scene, BMesh *bm, BMLoop *l, bool select, bool do_history, BMUVOffsets offsets);
/* Low level functions for (de)selecting individual UV elements. Ensure UV face visibility before
* use. */
void uvedit_face_select_enable(const struct Scene *scene,
struct BMesh *bm,
struct BMFace *efa,
bool do_history,
BMUVOffsets offsets);
void uvedit_face_select_disable(const struct Scene *scene,
struct BMesh *bm,
struct BMFace *efa,
BMUVOffsets offsets);
void uvedit_face_select_enable(
const Scene *scene, BMesh *bm, BMFace *efa, bool do_history, BMUVOffsets offsets);
void uvedit_face_select_disable(const Scene *scene, BMesh *bm, BMFace *efa, BMUVOffsets offsets);
void uvedit_edge_select_enable(const struct Scene *scene,
struct BMesh *bm,
struct BMLoop *l,
bool do_history,
BMUVOffsets offsets);
void uvedit_edge_select_disable(const struct Scene *scene,
struct BMesh *bm,
struct BMLoop *l,
BMUVOffsets offsets);
void uvedit_edge_select_enable(
const Scene *scene, BMesh *bm, BMLoop *l, bool do_history, BMUVOffsets offsets);
void uvedit_edge_select_disable(const Scene *scene, BMesh *bm, BMLoop *l, BMUVOffsets offsets);
void uvedit_uv_select_enable(const struct Scene *scene,
struct BMesh *bm,
struct BMLoop *l,
bool do_history,
BMUVOffsets offsets);
void uvedit_uv_select_disable(const struct Scene *scene,
struct BMesh *bm,
struct BMLoop *l,
BMUVOffsets offsets);
void uvedit_uv_select_enable(
const Scene *scene, BMesh *bm, BMLoop *l, bool do_history, BMUVOffsets offsets);
void uvedit_uv_select_disable(const Scene *scene, BMesh *bm, BMLoop *l, BMUVOffsets offsets);
/* Sticky mode UV element selection functions. */
void uvedit_face_select_set_with_sticky(const struct Scene *scene,
struct BMEditMesh *em,
struct BMFace *efa,
void uvedit_face_select_set_with_sticky(const Scene *scene,
BMEditMesh *em,
BMFace *efa,
bool select,
bool do_history,
BMUVOffsets offsets);
void uvedit_edge_select_set_with_sticky(const struct Scene *scene,
struct BMEditMesh *em,
struct BMLoop *l,
void uvedit_edge_select_set_with_sticky(const Scene *scene,
BMEditMesh *em,
BMLoop *l,
bool select,
bool do_history,
BMUVOffsets offsets);
void uvedit_uv_select_set_with_sticky(const struct Scene *scene,
struct BMEditMesh *em,
struct BMLoop *l,
void uvedit_uv_select_set_with_sticky(const Scene *scene,
BMEditMesh *em,
BMLoop *l,
bool select,
bool do_history,
BMUVOffsets offsets);
@@ -194,9 +143,9 @@ void uvedit_uv_select_set_with_sticky(const struct Scene *scene,
/* Low level functions for sticky element selection (sticky mode independent). Type of sticky
* selection is specified explicitly (using sticky_flag, except for face selection). */
void uvedit_face_select_shared_vert(const struct Scene *scene,
struct BMEditMesh *em,
struct BMFace *efa,
void uvedit_face_select_shared_vert(const Scene *scene,
BMEditMesh *em,
BMFace *efa,
const bool select,
const bool do_history,
BMUVOffsets offsets);
@@ -207,9 +156,9 @@ void uvedit_face_select_shared_vert(const struct Scene *scene,
* - #SI_STICKY_LOC: selects all UV edges that share the same mesh vertices and UV coordinates.
* - #SI_STICKY_VERTEX: selects all UV edges sharing the same mesh vertices.
*/
void uvedit_edge_select_shared_vert(const struct Scene *scene,
struct BMEditMesh *em,
struct BMLoop *l,
void uvedit_edge_select_shared_vert(const Scene *scene,
BMEditMesh *em,
BMLoop *l,
const bool select,
const int sticky_flag,
const bool do_history,
@@ -221,9 +170,9 @@ void uvedit_edge_select_shared_vert(const struct Scene *scene,
* - #SI_STICKY_LOC: selects all UVs sharing same mesh vertex and UV coordinates.
* - #SI_STICKY_VERTEX: selects all UVs sharing same mesh vertex.
*/
void uvedit_uv_select_shared_vert(const struct Scene *scene,
struct BMEditMesh *em,
struct BMLoop *l,
void uvedit_uv_select_shared_vert(const Scene *scene,
BMEditMesh *em,
BMLoop *l,
const bool select,
const int sticky_flag,
const bool do_history,
@@ -232,11 +181,8 @@ void uvedit_uv_select_shared_vert(const struct Scene *scene,
/**
* Sets required UV edge flags as specified by the `sticky_flag`.
*/
void uvedit_edge_select_set_noflush(const struct Scene *scene,
struct BMLoop *l,
const bool select,
const int sticky_flag,
BMUVOffsets offsets);
void uvedit_edge_select_set_noflush(
const Scene *scene, BMLoop *l, const bool select, const int sticky_flag, BMUVOffsets offsets);
/**
* \brief UV Select Mode set
@@ -244,98 +190,87 @@ void uvedit_edge_select_set_noflush(const struct Scene *scene,
* Updates selection state for UVs based on the select mode and sticky mode. Similar to
* #EDBM_selectmode_set.
*/
void ED_uvedit_selectmode_clean(const struct Scene *scene, struct Object *obedit);
void ED_uvedit_selectmode_clean_multi(struct bContext *C);
void ED_uvedit_selectmode_clean(const Scene *scene, Object *obedit);
void ED_uvedit_selectmode_clean_multi(bContext *C);
/**
* \brief UV Select Mode Flush
*
* Flushes selections upwards as dictated by the UV select mode.
*/
void ED_uvedit_selectmode_flush(const struct Scene *scene, struct BMEditMesh *em);
void ED_uvedit_selectmode_flush(const Scene *scene, BMEditMesh *em);
/**
* Mode independent UV de-selection flush.
*/
void uvedit_deselect_flush(const struct Scene *scene, struct BMEditMesh *em);
void uvedit_deselect_flush(const Scene *scene, BMEditMesh *em);
/**
* Mode independent UV selection flush.
*/
void uvedit_select_flush(const struct Scene *scene, struct BMEditMesh *em);
void uvedit_select_flush(const Scene *scene, BMEditMesh *em);
bool ED_uvedit_nearest_uv_multi(const struct View2D *v2d,
const struct Scene *scene,
struct Object **objects,
bool ED_uvedit_nearest_uv_multi(const View2D *v2d,
const Scene *scene,
Object **objects,
uint objects_len,
const float mval_fl[2],
const bool ignore_selected,
float *dist_sq,
float r_uv[2]);
struct BMFace **ED_uvedit_selected_faces(const struct Scene *scene,
struct BMesh *bm,
int len_max,
int *r_faces_len);
struct BMLoop **ED_uvedit_selected_edges(const struct Scene *scene,
struct BMesh *bm,
int len_max,
int *r_edges_len);
struct BMLoop **ED_uvedit_selected_verts(const struct Scene *scene,
struct BMesh *bm,
int len_max,
int *r_verts_len);
BMFace **ED_uvedit_selected_faces(const Scene *scene, BMesh *bm, int len_max, int *r_faces_len);
BMLoop **ED_uvedit_selected_edges(const Scene *scene, BMesh *bm, int len_max, int *r_edges_len);
BMLoop **ED_uvedit_selected_verts(const Scene *scene, BMesh *bm, int len_max, int *r_verts_len);
void ED_uvedit_get_aspect(struct Object *obedit, float *r_aspx, float *r_aspy);
void ED_uvedit_get_aspect(Object *obedit, float *r_aspx, float *r_aspy);
/**
* Return the X / Y aspect (wider aspects are over 1, taller are below 1).
* Apply this aspect by multiplying with the Y axis (X aspect is always 1 & unchanged).
*/
float ED_uvedit_get_aspect_y(struct Object *obedit);
float ED_uvedit_get_aspect_y(Object *obedit);
void ED_uvedit_get_aspect_from_material(Object *ob,
const int material_index,
float *r_aspx,
float *r_aspy);
void ED_uvedit_active_vert_loop_set(struct BMesh *bm, struct BMLoop *l);
struct BMLoop *ED_uvedit_active_vert_loop_get(struct BMesh *bm);
void ED_uvedit_active_vert_loop_set(BMesh *bm, BMLoop *l);
BMLoop *ED_uvedit_active_vert_loop_get(BMesh *bm);
void ED_uvedit_active_edge_loop_set(struct BMesh *bm, struct BMLoop *l);
struct BMLoop *ED_uvedit_active_edge_loop_get(struct BMesh *bm);
void ED_uvedit_active_edge_loop_set(BMesh *bm, BMLoop *l);
BMLoop *ED_uvedit_active_edge_loop_get(BMesh *bm);
/**
* Intentionally don't return #UV_SELECT_ISLAND as it's not an element type.
* In this case return #UV_SELECT_VERTEX as a fallback.
*/
char ED_uvedit_select_mode_get(const struct Scene *scene);
void ED_uvedit_select_sync_flush(const struct ToolSettings *ts,
struct BMEditMesh *em,
bool select);
char ED_uvedit_select_mode_get(const Scene *scene);
void ED_uvedit_select_sync_flush(const ToolSettings *ts, BMEditMesh *em, bool select);
/* `uvedit_unwrap_ops.cc` */
void ED_uvedit_live_unwrap_begin(struct Scene *scene, struct Object *obedit);
void ED_uvedit_live_unwrap_re_solve(void);
void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit);
void ED_uvedit_live_unwrap_re_solve();
void ED_uvedit_live_unwrap_end(short cancel);
void ED_uvedit_live_unwrap(const struct Scene *scene, struct Object **objects, int objects_len);
void ED_uvedit_add_simple_uvs(struct Main *bmain, const struct Scene *scene, struct Object *ob);
void ED_uvedit_live_unwrap(const Scene *scene, Object **objects, int objects_len);
void ED_uvedit_add_simple_uvs(Main *bmain, const Scene *scene, Object *ob);
/* `uvedit_draw.cc` */
void ED_image_draw_cursor(struct ARegion *region, const float cursor[2]);
void ED_image_draw_cursor(ARegion *region, const float cursor[2]);
/* `uvedit_buttons.cc` */
void ED_uvedit_buttons_register(struct ARegionType *art);
void ED_uvedit_buttons_register(ARegionType *art);
/* `uvedit_islands.cc` */
struct FaceIsland {
struct FaceIsland *next;
struct FaceIsland *prev;
struct BMFace **faces;
FaceIsland *next;
FaceIsland *prev;
BMFace **faces;
int faces_len;
/**
* \note While this is duplicate information,
@@ -349,7 +284,7 @@ struct FaceIsland {
* Calculate islands and add them to \a island_list returning the number of items added.
*/
int bm_mesh_calc_uv_islands(const Scene *scene,
struct BMesh *bm,
BMesh *bm,
ListBase *island_list,
const bool only_selected_faces,
const bool only_selected_uvs,
@@ -360,6 +295,4 @@ int bm_mesh_calc_uv_islands(const Scene *scene,
/**
* Returns true if UV coordinates lie on a valid tile in UDIM grid or tiled image.
*/
bool uv_coords_isect_udim(const struct Image *image,
const int udim_grid[2],
const float coords[2]);
bool uv_coords_isect_udim(const Image *image, const int udim_grid[2], const float coords[2]);

View File

@@ -16,6 +16,7 @@
struct ARegion;
struct BMEdge;
struct BMElem;
struct BMEditMesh;
struct BMFace;
struct BMVert;
struct BPoint;
@@ -53,33 +54,33 @@ struct wmWindow;
struct wmWindowManager;
/* for derivedmesh drawing callbacks, for view3d_select, .... */
typedef struct ViewContext {
struct bContext *C;
struct Main *bmain;
struct ViewContext {
bContext *C;
Main *bmain;
/* Dependency graph is uses for depth drawing, viewport camera matrix access, and also some areas
* are re-using this to access evaluated entities.
*
* Moral of the story: assign to a fully evaluated state. */
struct Depsgraph *depsgraph;
struct Scene *scene;
struct ViewLayer *view_layer;
struct Object *obact;
struct Object *obedit;
struct ARegion *region;
struct View3D *v3d;
struct wmWindow *win;
struct RegionView3D *rv3d;
struct BMEditMesh *em;
Depsgraph *depsgraph;
Scene *scene;
ViewLayer *view_layer;
Object *obact;
Object *obedit;
ARegion *region;
View3D *v3d;
wmWindow *win;
RegionView3D *rv3d;
BMEditMesh *em;
int mval[2];
} ViewContext;
};
typedef struct ViewDepths {
struct ViewDepths {
unsigned short w, h;
/* only for temp use for sub-rectangles, added to `region->winx/winy`. */
short x, y;
float *depths;
double depth_range[2];
} ViewDepths;
};
/* Rotate 3D cursor on placement. */
enum eV3DCursorOrient {
@@ -89,33 +90,31 @@ enum eV3DCursorOrient {
V3D_CURSOR_ORIENT_GEOM,
};
void ED_view3d_background_color_get(const struct Scene *scene,
const struct View3D *v3d,
float r_color[3]);
bool ED_view3d_has_workbench_in_texture_color(const struct Scene *scene,
const struct Object *ob,
const struct View3D *v3d);
void ED_view3d_background_color_get(const Scene *scene, const View3D *v3d, float r_color[3]);
bool ED_view3d_has_workbench_in_texture_color(const Scene *scene,
const Object *ob,
const View3D *v3d);
/**
* Cursor position in `r_cursor_co`, result in `r_cursor_co`, `mval` in region coords.
*
* \note cannot use `event->mval` here, called by #object_add().
*/
void ED_view3d_cursor3d_position(struct bContext *C,
void ED_view3d_cursor3d_position(bContext *C,
const int mval[2],
bool use_depth,
float r_cursor_co[3]);
void ED_view3d_cursor3d_position_rotation(struct bContext *C,
void ED_view3d_cursor3d_position_rotation(bContext *C,
const int mval[2],
bool use_depth,
enum eV3DCursorOrient orientation,
float r_cursor_co[3],
float r_cursor_quat[4]);
void ED_view3d_cursor3d_update(struct bContext *C,
void ED_view3d_cursor3d_update(bContext *C,
const int mval[2],
bool use_depth,
enum eV3DCursorOrient orientation);
struct Camera *ED_view3d_camera_data_get(struct View3D *v3d, struct RegionView3D *rv3d);
Camera *ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d);
/**
* Calculate the view transformation matrix from RegionView3D input.
@@ -145,7 +144,7 @@ void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const
* \param lens: The view lens angle set for cameras and lights, normally from View3D.lens.
*/
void ED_view3d_from_object(
const struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens);
const Object *ob, float ofs[3], float quat[4], float *dist, float *lens);
/**
* Set the object transformation from #RegionView3D members.
* \param depsgraph: The depsgraph to get the evaluated object parent
@@ -155,29 +154,26 @@ void ED_view3d_from_object(
* \param quat: The view rotation, quaternion normally from #RegionView3D.viewquat.
* \param dist: The view distance from `ofs`, normally from #RegionView3D.dist.
*/
void ED_view3d_to_object(const struct Depsgraph *depsgraph,
struct Object *ob,
const float ofs[3],
const float quat[4],
float dist);
void ED_view3d_to_object(
const Depsgraph *depsgraph, Object *ob, const float ofs[3], const float quat[4], float dist);
bool ED_view3d_camera_to_view_selected(struct Main *bmain,
struct Depsgraph *depsgraph,
const struct Scene *scene,
struct Object *camera_ob);
bool ED_view3d_camera_to_view_selected(Main *bmain,
Depsgraph *depsgraph,
const Scene *scene,
Object *camera_ob);
bool ED_view3d_camera_to_view_selected_with_set_clipping(struct Main *bmain,
struct Depsgraph *depsgraph,
const struct Scene *scene,
struct Object *camera_ob);
bool ED_view3d_camera_to_view_selected_with_set_clipping(Main *bmain,
Depsgraph *depsgraph,
const Scene *scene,
Object *camera_ob);
/**
* Use to store the last view, before entering camera view.
*/
void ED_view3d_lastview_store(struct RegionView3D *rv3d);
void ED_view3d_lastview_store(RegionView3D *rv3d);
/* Depth buffer */
typedef enum {
enum eV3DDepthOverrideMode {
/** Redraw viewport without Grease Pencil and Annotations. */
V3D_DEPTH_NO_GPENCIL = 0,
/** Redraw viewport with Grease Pencil and Annotations only. */
@@ -185,26 +181,26 @@ typedef enum {
/** Redraw viewport with active object only. */
V3D_DEPTH_OBJECT_ONLY,
} eV3DDepthOverrideMode;
};
/**
* Redraw the viewport depth buffer.
*/
void ED_view3d_depth_override(struct Depsgraph *depsgraph,
struct ARegion *region,
struct View3D *v3d,
struct Object *obact,
void ED_view3d_depth_override(Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
Object *obact,
eV3DDepthOverrideMode mode,
struct ViewDepths **r_depths);
ViewDepths **r_depths);
void ED_view3d_depths_free(ViewDepths *depths);
bool ED_view3d_depth_read_cached(const ViewDepths *vd,
const int mval[2],
int margin,
float *r_depth);
bool ED_view3d_depth_read_cached_normal(const struct ARegion *region,
bool ED_view3d_depth_read_cached_normal(const ARegion *region,
const ViewDepths *depths,
const int mval[2],
float r_normal[3]);
bool ED_view3d_depth_unproject_v3(const struct ARegion *region,
bool ED_view3d_depth_unproject_v3(const ARegion *region,
const int mval[2],
double depth,
float r_location_world[3]);
@@ -216,18 +212,18 @@ bool ED_view3d_depth_unproject_v3(const struct ARegion *region,
*
* \note modal map events can also be used in `ED_view3d_navigation_do`.
*/
struct ViewOpsData *ED_view3d_navigation_init(struct bContext *C, const bool use_alt_navigation);
bool ED_view3d_navigation_do(struct bContext *C,
struct ViewOpsData *vod,
const struct wmEvent *event,
ViewOpsData *ED_view3d_navigation_init(bContext *C, const bool use_alt_navigation);
bool ED_view3d_navigation_do(bContext *C,
ViewOpsData *vod,
const wmEvent *event,
const float depth_loc_override[3]);
void ED_view3d_navigation_free(struct bContext *C, struct ViewOpsData *vod);
void ED_view3d_navigation_free(bContext *C, ViewOpsData *vod);
/* Projection */
#define IS_CLIPPED 12000
/* return values for ED_view3d_project_...() */
typedef enum {
enum eV3DProjStatus {
V3D_PROJ_RET_OK = 0,
/** can't avoid this when in perspective mode, (can't avoid) */
V3D_PROJ_RET_CLIP_NEAR = 1,
@@ -241,11 +237,11 @@ typedef enum {
V3D_PROJ_RET_CLIP_WIN = 5,
/** outside range (mainly for short), (can't avoid) */
V3D_PROJ_RET_OVERFLOW = 6,
} eV3DProjStatus;
};
ENUM_OPERATORS(eV3DProjStatus, V3D_PROJ_RET_OVERFLOW);
/* some clipping tests are optional */
typedef enum {
enum eV3DProjTest {
V3D_PROJ_TEST_NOP = 0,
V3D_PROJ_TEST_CLIP_BB = (1 << 0),
V3D_PROJ_TEST_CLIP_WIN = (1 << 1),
@@ -273,7 +269,7 @@ typedef enum {
* to avoid accidentally enabling near clipping without clipping by window bounds.
*/
V3D_PROJ_TEST_CLIP_CONTENT = (1 << 5),
} eV3DProjTest;
};
ENUM_OPERATORS(eV3DProjTest, V3D_PROJ_TEST_CLIP_CONTENT);
#define V3D_PROJ_TEST_CLIP_DEFAULT \
@@ -288,23 +284,23 @@ ENUM_OPERATORS(eV3DProjTest, V3D_PROJ_TEST_CLIP_CONTENT);
/* `view3d_snap.cc` */
bool ED_view3d_snap_selected_to_location(struct bContext *C,
bool ED_view3d_snap_selected_to_location(bContext *C,
const float snap_target_global[3],
int pivot_point);
/* `view3d_cursor_snap.cc` */
#define USE_SNAP_DETECT_FROM_KEYMAP_HACK
typedef enum {
enum eV3DSnapCursor {
V3D_SNAPCURSOR_TOGGLE_ALWAYS_TRUE = 1 << 0,
V3D_SNAPCURSOR_OCCLUSION_ALWAYS_TRUE = 1 << 1,
V3D_SNAPCURSOR_OCCLUSION_ALWAYS_FALSE = 1 << 2, /* TODO. */
V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL = 1 << 3,
V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE = 1 << 4,
} eV3DSnapCursor;
};
ENUM_OPERATORS(eV3DSnapCursor, V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE)
typedef struct V3DSnapCursorData {
struct V3DSnapCursorData {
eSnapMode snap_elem;
float loc[3];
float nor[3];
@@ -315,9 +311,9 @@ typedef struct V3DSnapCursorData {
/** Enabled when snap is activated, even if it didn't find anything. */
bool is_enabled;
} V3DSnapCursorData;
};
typedef struct V3DSnapCursorState {
struct V3DSnapCursorState {
/* Setup. */
eV3DSnapCursor flag;
uchar source_color[4];
@@ -329,23 +325,20 @@ typedef struct V3DSnapCursorState {
bool draw_plane;
bool draw_box;
bool (*poll)(struct ARegion *region, void *custom_poll_data);
bool (*poll)(ARegion *region, void *custom_poll_data);
void *poll_data;
} V3DSnapCursorState;
};
void ED_view3d_cursor_snap_state_default_set(V3DSnapCursorState *state);
V3DSnapCursorState *ED_view3d_cursor_snap_state_active_get(void);
V3DSnapCursorState *ED_view3d_cursor_snap_state_active_get();
void ED_view3d_cursor_snap_state_active_set(V3DSnapCursorState *state);
V3DSnapCursorState *ED_view3d_cursor_snap_state_create(void);
V3DSnapCursorState *ED_view3d_cursor_snap_state_create();
void ED_view3d_cursor_snap_state_free(V3DSnapCursorState *state);
void ED_view3d_cursor_snap_state_prevpoint_set(V3DSnapCursorState *state,
const float prev_point[3]);
void ED_view3d_cursor_snap_data_update(V3DSnapCursorState *state,
const struct bContext *C,
int x,
int y);
V3DSnapCursorData *ED_view3d_cursor_snap_data_get(void);
struct SnapObjectContext *ED_view3d_cursor_snap_context_ensure(struct Scene *scene);
void ED_view3d_cursor_snap_data_update(V3DSnapCursorState *state, const bContext *C, int x, int y);
V3DSnapCursorData *ED_view3d_cursor_snap_data_get();
SnapObjectContext *ED_view3d_cursor_snap_context_ensure(Scene *scene);
void ED_view3d_cursor_snap_draw_util(RegionView3D *rv3d,
const float source_loc[3],
const float target_loc[3],
@@ -358,20 +351,20 @@ void ED_view3d_cursor_snap_draw_util(RegionView3D *rv3d,
/* foreach iterators */
void meshobject_foreachScreenVert(struct ViewContext *vc,
void meshobject_foreachScreenVert(ViewContext *vc,
void (*func)(void *user_data,
const float screen_co[2],
int index),
void *user_data,
eV3DProjTest clip_flag);
void mesh_foreachScreenVert(
struct ViewContext *vc,
void (*func)(void *user_data, struct BMVert *eve, const float screen_co[2], int index),
ViewContext *vc,
void (*func)(void *user_data, BMVert *eve, const float screen_co[2], int index),
void *user_data,
eV3DProjTest clip_flag);
void mesh_foreachScreenEdge(struct ViewContext *vc,
void mesh_foreachScreenEdge(ViewContext *vc,
void (*func)(void *user_data,
struct BMEdge *eed,
BMEdge *eed,
const float screen_co_a[2],
const float screen_co_b[2],
int index),
@@ -382,9 +375,9 @@ void mesh_foreachScreenEdge(struct ViewContext *vc,
* A version of #mesh_foreachScreenEdge that clips the segment when
* there is a clipping bounding box.
*/
void mesh_foreachScreenEdge_clip_bb_segment(struct ViewContext *vc,
void mesh_foreachScreenEdge_clip_bb_segment(ViewContext *vc,
void (*func)(void *user_data,
struct BMEdge *eed,
BMEdge *eed,
const float screen_co_a[2],
const float screen_co_b[2],
int index),
@@ -392,15 +385,15 @@ void mesh_foreachScreenEdge_clip_bb_segment(struct ViewContext *vc,
eV3DProjTest clip_flag);
void mesh_foreachScreenFace(
struct ViewContext *vc,
void (*func)(void *user_data, struct BMFace *efa, const float screen_co[2], int index),
ViewContext *vc,
void (*func)(void *user_data, BMFace *efa, const float screen_co[2], int index),
void *user_data,
eV3DProjTest clip_flag);
void nurbs_foreachScreenVert(struct ViewContext *vc,
void nurbs_foreachScreenVert(ViewContext *vc,
void (*func)(void *user_data,
struct Nurb *nu,
struct BPoint *bp,
struct BezTriple *bezt,
Nurb *nu,
BPoint *bp,
BezTriple *bezt,
int beztindex,
bool handle_visible,
const float screen_co[2]),
@@ -409,24 +402,20 @@ void nurbs_foreachScreenVert(struct ViewContext *vc,
/**
* #ED_view3d_init_mats_rv3d must be called first.
*/
void mball_foreachScreenElem(struct ViewContext *vc,
void (*func)(void *user_data,
struct MetaElem *ml,
const float screen_co[2]),
void mball_foreachScreenElem(ViewContext *vc,
void (*func)(void *user_data, MetaElem *ml, const float screen_co[2]),
void *user_data,
eV3DProjTest clip_flag);
void lattice_foreachScreenVert(struct ViewContext *vc,
void (*func)(void *user_data,
struct BPoint *bp,
const float screen_co[2]),
void lattice_foreachScreenVert(ViewContext *vc,
void (*func)(void *user_data, BPoint *bp, const float screen_co[2]),
void *user_data,
eV3DProjTest clip_flag);
/**
* #ED_view3d_init_mats_rv3d must be called first.
*/
void armature_foreachScreenBone(struct ViewContext *vc,
void armature_foreachScreenBone(ViewContext *vc,
void (*func)(void *user_data,
struct EditBone *ebone,
EditBone *ebone,
const float screen_co_a[2],
const float screen_co_b[2]),
void *user_data,
@@ -435,9 +424,9 @@ void armature_foreachScreenBone(struct ViewContext *vc,
/**
* ED_view3d_init_mats_rv3d must be called first.
*/
void pose_foreachScreenBone(struct ViewContext *vc,
void pose_foreachScreenBone(ViewContext *vc,
void (*func)(void *user_data,
struct bPoseChannel *pchan,
bPoseChannel *pchan,
const float screen_co_a[2],
const float screen_co_b[2]),
void *user_data,
@@ -449,80 +438,78 @@ void pose_foreachScreenBone(struct ViewContext *vc,
/**
* \note use #ED_view3d_ob_project_mat_get to get the projection matrix
*/
void ED_view3d_project_float_v2_m4(const struct ARegion *region,
void ED_view3d_project_float_v2_m4(const ARegion *region,
const float co[3],
float r_co[2],
const float mat[4][4]);
/**
* \note use #ED_view3d_ob_project_mat_get to get projecting mat
*/
void ED_view3d_project_float_v3_m4(const struct ARegion *region,
void ED_view3d_project_float_v3_m4(const ARegion *region,
const float co[3],
float r_co[3],
const float mat[4][4]);
eV3DProjStatus ED_view3d_project_base(const struct ARegion *region,
struct Base *base,
float r_co[2]);
eV3DProjStatus ED_view3d_project_base(const ARegion *region, Base *base, float r_co[2]);
/* *** short *** */
eV3DProjStatus ED_view3d_project_short_ex(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_short_ex(const ARegion *region,
float perspmat[4][4],
bool is_local,
const float co[3],
short r_co[2],
eV3DProjTest flag);
/* --- short --- */
eV3DProjStatus ED_view3d_project_short_global(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_short_global(const ARegion *region,
const float co[3],
short r_co[2],
eV3DProjTest flag);
/* object space, use ED_view3d_init_mats_rv3d before calling */
eV3DProjStatus ED_view3d_project_short_object(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_short_object(const ARegion *region,
const float co[3],
short r_co[2],
eV3DProjTest flag);
/* *** int *** */
eV3DProjStatus ED_view3d_project_int_ex(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_int_ex(const ARegion *region,
float perspmat[4][4],
bool is_local,
const float co[3],
int r_co[2],
eV3DProjTest flag);
/* --- int --- */
eV3DProjStatus ED_view3d_project_int_global(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_int_global(const ARegion *region,
const float co[3],
int r_co[2],
eV3DProjTest flag);
/* object space, use ED_view3d_init_mats_rv3d before calling */
eV3DProjStatus ED_view3d_project_int_object(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_int_object(const ARegion *region,
const float co[3],
int r_co[2],
eV3DProjTest flag);
/* *** float *** */
eV3DProjStatus ED_view3d_project_float_ex(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_float_ex(const ARegion *region,
float perspmat[4][4],
bool is_local,
const float co[3],
float r_co[2],
eV3DProjTest flag);
/* --- float --- */
eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region,
const float co[3],
float r_co[2],
eV3DProjTest flag);
/**
* Object space, use #ED_view3d_init_mats_rv3d before calling.
*/
eV3DProjStatus ED_view3d_project_float_object(const struct ARegion *region,
eV3DProjStatus ED_view3d_project_float_object(const ARegion *region,
const float co[3],
float r_co[2],
eV3DProjTest flag);
float ED_view3d_pixel_size(const struct RegionView3D *rv3d, const float co[3]);
float ED_view3d_pixel_size_no_ui_scale(const struct RegionView3D *rv3d, const float co[3]);
float ED_view3d_pixel_size(const RegionView3D *rv3d, const float co[3]);
float ED_view3d_pixel_size_no_ui_scale(const RegionView3D *rv3d, const float co[3]);
/**
* Calculate a depth value from \a co, use with #ED_view3d_win_to_delta.
@@ -534,15 +521,15 @@ float ED_view3d_pixel_size_no_ui_scale(const struct RegionView3D *rv3d, const fl
* with additional sanitation to ensure the result is never negative
* as this isn't useful for tool-code.
*/
float ED_view3d_calc_zfac_ex(const struct RegionView3D *rv3d, const float co[3], bool *r_flip);
float ED_view3d_calc_zfac_ex(const RegionView3D *rv3d, const float co[3], bool *r_flip);
/** See #ED_view3d_calc_zfac_ex doc-string. */
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3]);
float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3]);
/**
* Calculate a depth value from `co` (result should only be used for comparison).
*/
float ED_view3d_calc_depth_for_comparison(const struct RegionView3D *rv3d, const float co[3]);
float ED_view3d_calc_depth_for_comparison(const RegionView3D *rv3d, const float co[3]);
bool ED_view3d_clip_segment(const struct RegionView3D *rv3d, float ray_start[3], float ray_end[3]);
bool ED_view3d_clip_segment(const RegionView3D *rv3d, float ray_start[3], float ray_end[3]);
/**
* Calculate a 3d viewpoint and direction vector from 2d window coordinates.
* This ray_start is located at the viewpoint, ray_normal is the direction towards mval.
@@ -556,9 +543,9 @@ bool ED_view3d_clip_segment(const struct RegionView3D *rv3d, float ray_start[3],
* \param do_clip_planes: Optionally clip the start of the ray by the view clipping planes.
* \return success, false if the ray is totally clipped.
*/
bool ED_view3d_win_to_ray_clipped(struct Depsgraph *depsgraph,
const struct ARegion *region,
const struct View3D *v3d,
bool ED_view3d_win_to_ray_clipped(Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
const float mval[2],
float r_ray_start[3],
float r_ray_normal[3],
@@ -579,9 +566,9 @@ bool ED_view3d_win_to_ray_clipped(struct Depsgraph *depsgraph,
* \param do_clip_planes: Optionally clip the start of the ray by the view clipping planes.
* \return success, false if the ray is totally clipped.
*/
bool ED_view3d_win_to_ray_clipped_ex(struct Depsgraph *depsgraph,
const struct ARegion *region,
const struct View3D *v3d,
bool ED_view3d_win_to_ray_clipped_ex(Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
const float mval[2],
float r_ray_co[3],
float r_ray_normal[3],
@@ -598,7 +585,7 @@ bool ED_view3d_win_to_ray_clipped_ex(struct Depsgraph *depsgraph,
* \note Ignores view near/far clipping,
* to take this into account use #ED_view3d_win_to_ray_clipped.
*/
void ED_view3d_win_to_ray(const struct ARegion *region,
void ED_view3d_win_to_ray(const ARegion *region,
const float mval[2],
float r_ray_start[3],
float r_ray_normal[3]);
@@ -609,9 +596,7 @@ void ED_view3d_win_to_ray(const struct ARegion *region,
* \param coord: The world-space location.
* \param vec: The resulting normalized vector.
*/
void ED_view3d_global_to_vector(const struct RegionView3D *rv3d,
const float coord[3],
float vec[3]);
void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3], float vec[3]);
/**
* Calculate a 3d location from 2d window coordinates.
* \param region: The region (used for the window width and height).
@@ -619,17 +604,17 @@ void ED_view3d_global_to_vector(const struct RegionView3D *rv3d,
* \param mval: The area relative location (such as `event->mval` converted to floats).
* \param r_out: The resulting world-space location.
*/
void ED_view3d_win_to_3d(const struct View3D *v3d,
const struct ARegion *region,
void ED_view3d_win_to_3d(const View3D *v3d,
const ARegion *region,
const float depth_pt[3],
const float mval[2],
float r_out[3]);
void ED_view3d_win_to_3d_int(const struct View3D *v3d,
const struct ARegion *region,
void ED_view3d_win_to_3d_int(const View3D *v3d,
const ARegion *region,
const float depth_pt[3],
const int mval[2],
float r_out[3]);
bool ED_view3d_win_to_3d_on_plane(const struct ARegion *region,
bool ED_view3d_win_to_3d_on_plane(const ARegion *region,
const float plane[4],
const float mval[2],
bool do_clip,
@@ -641,17 +626,14 @@ bool ED_view3d_win_to_3d_on_plane(const struct ARegion *region,
* This is intended to be used when \a plane is orthogonal to the views Z axis where
* projecting the \a mval doesn't work well (or fail completely when exactly aligned).
*/
bool ED_view3d_win_to_3d_on_plane_with_fallback(const struct ARegion *region,
bool ED_view3d_win_to_3d_on_plane_with_fallback(const ARegion *region,
const float plane[4],
const float mval[2],
bool do_clip,
const float plane_fallback[4],
float r_out[3]);
bool ED_view3d_win_to_3d_on_plane_int(const struct ARegion *region,
const float plane[4],
const int mval[2],
bool do_clip,
float r_out[3]);
bool ED_view3d_win_to_3d_on_plane_int(
const ARegion *region, const float plane[4], const int mval[2], bool do_clip, float r_out[3]);
/**
* Calculate a 3d difference vector from 2d window offset.
*
@@ -668,7 +650,7 @@ bool ED_view3d_win_to_3d_on_plane_int(const struct ARegion *region,
* (see it's doc-string for details).
* \param r_out: The resulting world-space delta.
*/
void ED_view3d_win_to_delta(const struct ARegion *region,
void ED_view3d_win_to_delta(const ARegion *region,
const float xy_delta[2],
float zfac,
float r_out[3]);
@@ -682,7 +664,7 @@ void ED_view3d_win_to_delta(const struct ARegion *region,
* \param mval: The area relative 2d location (such as `event->mval` converted to float).
* \param r_out: The resulting normalized world-space direction vector.
*/
void ED_view3d_win_to_origin(const struct ARegion *region, const float mval[2], float r_out[3]);
void ED_view3d_win_to_origin(const ARegion *region, const float mval[2], float r_out[3]);
/**
* Calculate a 3d direction vector from 2d window coordinates.
* This direction vector starts and the view in the direction of the 2d window coordinates.
@@ -696,7 +678,7 @@ void ED_view3d_win_to_origin(const struct ARegion *region, const float mval[2],
* \param mval: The area relative 2d location (such as `event->mval` converted to float).
* \param r_out: The resulting normalized world-space direction vector.
*/
void ED_view3d_win_to_vector(const struct ARegion *region, const float mval[2], float r_out[3]);
void ED_view3d_win_to_vector(const ARegion *region, const float mval[2], float r_out[3]);
/**
* Calculate a 3d segment from 2d window coordinates.
* This ray_start is located at the viewpoint, ray_end is a far point.
@@ -711,17 +693,15 @@ void ED_view3d_win_to_vector(const struct ARegion *region, const float mval[2],
* \param do_clip_planes: Optionally clip the ray by the view clipping planes.
* \return success, false if the segment is totally clipped.
*/
bool ED_view3d_win_to_segment_clipped(const struct Depsgraph *depsgraph,
const struct ARegion *region,
const struct View3D *v3d,
bool ED_view3d_win_to_segment_clipped(const Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
const float mval[2],
float r_ray_start[3],
float r_ray_end[3],
bool do_clip_planes);
void ED_view3d_ob_project_mat_get(const struct RegionView3D *rv3d,
const struct Object *ob,
float r_pmat[4][4]);
void ED_view3d_ob_project_mat_get_from_obmat(const struct RegionView3D *rv3d,
void ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const Object *ob, float r_pmat[4][4]);
void ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d,
const float obmat[4][4],
float r_pmat[4][4]);
@@ -729,33 +709,29 @@ void ED_view3d_ob_project_mat_get_from_obmat(const struct RegionView3D *rv3d,
* Convert between region relative coordinates (x,y) and depth component z and
* a point in world space.
*/
void ED_view3d_project_v3(const struct ARegion *region,
const float world[3],
float r_region_co[3]);
void ED_view3d_project_v2(const struct ARegion *region,
const float world[3],
float r_region_co[2]);
void ED_view3d_project_v3(const ARegion *region, const float world[3], float r_region_co[3]);
void ED_view3d_project_v2(const ARegion *region, const float world[3], float r_region_co[2]);
bool ED_view3d_unproject_v3(
const struct ARegion *region, float regionx, float regiony, float regionz, float world[3]);
const ARegion *region, float regionx, float regiony, float regionz, float world[3]);
/* end */
void ED_view3d_dist_range_get(const struct View3D *v3d, float r_dist_range[2]);
void ED_view3d_dist_range_get(const View3D *v3d, float r_dist_range[2]);
/**
* \note copies logic of #ED_view3d_viewplane_get(), keep in sync.
*/
bool ED_view3d_clip_range_get(const struct Depsgraph *depsgraph,
const struct View3D *v3d,
const struct RegionView3D *rv3d,
bool ED_view3d_clip_range_get(const Depsgraph *depsgraph,
const View3D *v3d,
const RegionView3D *rv3d,
float *r_clipsta,
float *r_clipend,
bool use_ortho_factor);
bool ED_view3d_viewplane_get(struct Depsgraph *depsgraph,
const struct View3D *v3d,
const struct RegionView3D *rv3d,
bool ED_view3d_viewplane_get(Depsgraph *depsgraph,
const View3D *v3d,
const RegionView3D *rv3d,
int winxi,
int winyi,
struct rctf *r_viewplane,
rctf *r_viewplane,
float *r_clipsta,
float *r_clipend,
float *r_pixsize);
@@ -763,35 +739,27 @@ bool ED_view3d_viewplane_get(struct Depsgraph *depsgraph,
/**
* Use instead of: `GPU_polygon_offset(rv3d->dist, ...)` see bug #37727.
*/
void ED_view3d_polygon_offset(const struct RegionView3D *rv3d, float dist);
void ED_view3d_polygon_offset(const RegionView3D *rv3d, float dist);
void ED_view3d_calc_camera_border(const struct Scene *scene,
struct Depsgraph *depsgraph,
const struct ARegion *region,
const struct View3D *v3d,
const struct RegionView3D *rv3d,
struct rctf *r_viewborder,
void ED_view3d_calc_camera_border(const Scene *scene,
Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
const RegionView3D *rv3d,
rctf *r_viewborder,
bool no_shift);
void ED_view3d_calc_camera_border_size(const struct Scene *scene,
struct Depsgraph *depsgraph,
const struct ARegion *region,
const struct View3D *v3d,
const struct RegionView3D *rv3d,
void ED_view3d_calc_camera_border_size(const Scene *scene,
Depsgraph *depsgraph,
const ARegion *region,
const View3D *v3d,
const RegionView3D *rv3d,
float r_size[2]);
bool ED_view3d_calc_render_border(const struct Scene *scene,
struct Depsgraph *depsgraph,
struct View3D *v3d,
struct ARegion *region,
struct rcti *rect);
bool ED_view3d_calc_render_border(
const Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, rcti *rect);
void ED_view3d_clipping_calc_from_boundbox(float clip[4][4],
const struct BoundBox *clipbb,
bool is_flip);
void ED_view3d_clipping_calc(struct BoundBox *bb,
float planes[4][4],
const struct ARegion *region,
const struct Object *ob,
const struct rcti *rect);
void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const BoundBox *clipbb, bool is_flip);
void ED_view3d_clipping_calc(
BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect);
/**
* Clamp min/max by the viewport clipping.
*
@@ -804,9 +772,9 @@ void ED_view3d_clipping_calc(struct BoundBox *bb,
*
* \return True when the arguments were clamped.
*/
bool ED_view3d_clipping_clamp_minmax(const struct RegionView3D *rv3d, float min[3], float max[3]);
bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3]);
void ED_view3d_clipping_local(struct RegionView3D *rv3d, const float mat[4][4]);
void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4]);
/**
* Return true when `co` is hidden by the 3D views clipping planes.
*
@@ -816,7 +784,7 @@ void ED_view3d_clipping_local(struct RegionView3D *rv3d, const float mat[4][4]);
*
* \note Callers should check #RV3D_CLIPPING_ENABLED first.
*/
bool ED_view3d_clipping_test(const struct RegionView3D *rv3d, const float co[3], bool is_local);
bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], bool is_local);
float ED_view3d_radius_to_dist_persp(float angle, float radius);
float ED_view3d_radius_to_dist_ortho(float lens, float radius);
@@ -845,9 +813,9 @@ float ED_view3d_radius_to_dist_ortho(float lens, float radius);
* \param radius: The radius will be fitted exactly,
* typically pre-scaled by a margin (#VIEW3D_MARGIN).
*/
float ED_view3d_radius_to_dist(const struct View3D *v3d,
const struct ARegion *region,
const struct Depsgraph *depsgraph,
float ED_view3d_radius_to_dist(const View3D *v3d,
const ARegion *region,
const Depsgraph *depsgraph,
char persp,
bool use_aspect,
float radius);
@@ -855,28 +823,28 @@ float ED_view3d_radius_to_dist(const struct View3D *v3d,
/**
* Back-buffer select and draw support.
*/
void ED_view3d_backbuf_depth_validate(struct ViewContext *vc);
void ED_view3d_backbuf_depth_validate(ViewContext *vc);
/**
* allow for small values [0.5 - 2.5],
* and large values, FLT_MAX by clamping by the area size
*/
int ED_view3d_backbuf_sample_size_clamp(struct ARegion *region, float dist);
int ED_view3d_backbuf_sample_size_clamp(ARegion *region, float dist);
void ED_view3d_select_id_validate(struct ViewContext *vc);
void ED_view3d_select_id_validate(ViewContext *vc);
/** Check if the last auto-dist can be used. */
bool ED_view3d_autodist_last_check(struct wmWindow *win, const struct wmEvent *event);
bool ED_view3d_autodist_last_check(wmWindow *win, const wmEvent *event);
/**
* \return true when `r_ofs` is set.
* \warning #ED_view3d_autodist_last_check should be called first to ensure the data is available.
*/
bool ED_view3d_autodist_last_get(struct wmWindow *win, float r_ofs[3]);
void ED_view3d_autodist_last_set(struct wmWindow *win,
const struct wmEvent *event,
bool ED_view3d_autodist_last_get(wmWindow *win, float r_ofs[3]);
void ED_view3d_autodist_last_set(wmWindow *win,
const wmEvent *event,
const float ofs[3],
const bool has_depth);
/** Clear and free auto-dist data. */
void ED_view3d_autodist_last_clear(struct wmWindow *win);
void ED_view3d_autodist_last_clear(wmWindow *win);
/**
* Get the world-space 3d location from a screen-space 2d point.
@@ -886,9 +854,9 @@ void ED_view3d_autodist_last_clear(struct wmWindow *win);
* \param mouse_worldloc: Output world-space location.
* \param fallback_depth_pt: Use this points depth when no depth can be found.
*/
bool ED_view3d_autodist(struct Depsgraph *depsgraph,
struct ARegion *region,
struct View3D *v3d,
bool ED_view3d_autodist(Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
const int mval[2],
float mouse_worldloc[3],
bool alphaoverride,
@@ -897,7 +865,7 @@ bool ED_view3d_autodist(struct Depsgraph *depsgraph,
/**
* No 4x4 sampling, run #ED_view3d_depth_override first.
*/
bool ED_view3d_autodist_simple(struct ARegion *region,
bool ED_view3d_autodist_simple(ARegion *region,
const int mval[2],
float mouse_worldloc[3],
int margin,
@@ -914,34 +882,33 @@ bool ED_view3d_depth_read_cached_seg(
*/
#define MAXPICKELEMS 2500
typedef enum {
enum eV3DSelectMode {
/* all elements in the region, ignore depth */
VIEW3D_SELECT_ALL = 0,
/* pick also depth sorts (only for small regions!) */
VIEW3D_SELECT_PICK_ALL = 1,
/* sorts and only returns visible objects (only for small regions!) */
VIEW3D_SELECT_PICK_NEAREST = 2,
} eV3DSelectMode;
};
typedef enum {
enum eV3DSelectObjectFilter {
/** Don't exclude anything. */
VIEW3D_SELECT_FILTER_NOP = 0,
/** Don't select objects outside the current mode. */
VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK = 1,
/** A version of #VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK that allows pose-bone selection. */
VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK = 2,
} eV3DSelectObjectFilter;
};
eV3DSelectObjectFilter ED_view3d_select_filter_from_mode(const struct Scene *scene,
const struct Object *obact);
eV3DSelectObjectFilter ED_view3d_select_filter_from_mode(const Scene *scene, const Object *obact);
/**
* Optionally cache data for multiple calls to #view3d_opengl_select
*
* just avoid GPU_select headers outside this file
*/
void view3d_opengl_select_cache_begin(void);
void view3d_opengl_select_cache_end(void);
void view3d_opengl_select_cache_begin();
void view3d_opengl_select_cache_end();
/**
* \warning be sure to account for a negative return value
@@ -950,33 +917,31 @@ void view3d_opengl_select_cache_end(void);
*
* \note (vc->obedit == NULL) can be set to explicitly skip edit-object selection.
*/
int view3d_opengl_select_ex(struct ViewContext *vc,
struct GPUSelectResult *buffer,
int view3d_opengl_select_ex(ViewContext *vc,
GPUSelectResult *buffer,
unsigned int buffer_len,
const struct rcti *input,
const rcti *input,
eV3DSelectMode select_mode,
eV3DSelectObjectFilter select_filter,
bool do_material_slot_selection);
int view3d_opengl_select(struct ViewContext *vc,
struct GPUSelectResult *buffer,
int view3d_opengl_select(ViewContext *vc,
GPUSelectResult *buffer,
unsigned int buffer_len,
const struct rcti *input,
const rcti *input,
eV3DSelectMode select_mode,
eV3DSelectObjectFilter select_filter);
int view3d_opengl_select_with_id_filter(struct ViewContext *vc,
struct GPUSelectResult *buffer,
int view3d_opengl_select_with_id_filter(ViewContext *vc,
GPUSelectResult *buffer,
unsigned int buffer_len,
const struct rcti *input,
const rcti *input,
eV3DSelectMode select_mode,
eV3DSelectObjectFilter select_filter,
uint select_id);
/* view3d_select.cc */
float ED_view3d_select_dist_px(void);
void ED_view3d_viewcontext_init(struct bContext *C,
struct ViewContext *vc,
struct Depsgraph *depsgraph);
float ED_view3d_select_dist_px();
void ED_view3d_viewcontext_init(bContext *C, ViewContext *vc, Depsgraph *depsgraph);
/**
* Re-initialize `vc` with `obact` as if it's active object (with some differences).
@@ -993,13 +958,13 @@ void ED_view3d_viewcontext_init(struct bContext *C,
* disable edit-mode operation (to force object selection in edit-mode for e.g.).
* So object-mode specific values should remain cleared when initialized with another object.
*/
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact);
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact);
/**
* Use this call when executing an operator,
* event system doesn't set for each event the OpenGL drawing context.
*/
void view3d_operator_needs_opengl(const struct bContext *C);
void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *region);
void view3d_operator_needs_opengl(const bContext *C);
void view3d_region_operator_needs_opengl(wmWindow *win, ARegion *region);
/** XXX: should move to BLI_math */
bool edge_inside_circle(const float cent[2],
@@ -1010,22 +975,18 @@ bool edge_inside_circle(const float cent[2],
/**
* Get 3D region from context, also if mouse is in header or toolbar.
*/
struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C);
RegionView3D *ED_view3d_context_rv3d(bContext *C);
/**
* Ideally would return an rv3d but in some cases the region is needed too
* so return that, the caller can then access the `region->regiondata`.
*/
bool ED_view3d_context_user_region(struct bContext *C,
struct View3D **r_v3d,
struct ARegion **r_region);
bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region);
/**
* Similar to #ED_view3d_context_user_region() but does not use context. Always performs a lookup.
* Also works if \a v3d is not the active space.
*/
bool ED_view3d_area_user_region(const struct ScrArea *area,
const struct View3D *v3d,
struct ARegion **r_region);
bool ED_operator_rv3d_user_region_poll(struct bContext *C);
bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion **r_region);
bool ED_operator_rv3d_user_region_poll(bContext *C);
/**
* Most of the time this isn't needed since you could assume the view matrix was
@@ -1039,61 +1000,61 @@ bool ED_operator_rv3d_user_region_poll(struct bContext *C);
* view3d_project_short_clip and view3d_project_short_noclip in cases where
* these functions are not used during draw_object
*/
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d);
void ED_view3d_init_mats_rv3d_gl(const struct Object *ob, struct RegionView3D *rv3d);
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d);
void ED_view3d_init_mats_rv3d_gl(const Object *ob, RegionView3D *rv3d);
#ifdef DEBUG
/**
* Ensure we correctly initialize.
*/
void ED_view3d_clear_mats_rv3d(struct RegionView3D *rv3d);
void ED_view3d_check_mats_rv3d(struct RegionView3D *rv3d);
void ED_view3d_clear_mats_rv3d(RegionView3D *rv3d);
void ED_view3d_check_mats_rv3d(RegionView3D *rv3d);
#else
# define ED_view3d_clear_mats_rv3d(rv3d) (void)(rv3d)
# define ED_view3d_check_mats_rv3d(rv3d) (void)(rv3d)
#endif
struct RV3DMatrixStore *ED_view3d_mats_rv3d_backup(struct RegionView3D *rv3d);
void ED_view3d_mats_rv3d_restore(struct RegionView3D *rv3d, struct RV3DMatrixStore *rv3dmat);
RV3DMatrixStore *ED_view3d_mats_rv3d_backup(RegionView3D *rv3d);
void ED_view3d_mats_rv3d_restore(RegionView3D *rv3d, RV3DMatrixStore *rv3dmat);
struct RenderEngineType *ED_view3d_engine_type(const struct Scene *scene, int drawtype);
RenderEngineType *ED_view3d_engine_type(const Scene *scene, int drawtype);
bool ED_view3d_context_activate(struct bContext *C);
bool ED_view3d_context_activate(bContext *C);
/**
* Set the correct matrices
*/
void ED_view3d_draw_setup_view(const struct wmWindowManager *wm,
struct wmWindow *win,
struct Depsgraph *depsgraph,
struct Scene *scene,
struct ARegion *region,
struct View3D *v3d,
void ED_view3d_draw_setup_view(const wmWindowManager *wm,
wmWindow *win,
Depsgraph *depsgraph,
Scene *scene,
ARegion *region,
View3D *v3d,
const float viewmat[4][4],
const float winmat[4][4],
const struct rcti *rect);
const rcti *rect);
/**
* `mval` comes from event->mval, only use within region handlers.
*/
struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);
struct Object *ED_view3d_give_object_under_cursor(struct bContext *C, const int mval[2]);
struct Object *ED_view3d_give_material_slot_under_cursor(struct bContext *C,
const int mval[2],
int *r_material_slot);
bool ED_view3d_is_object_under_cursor(struct bContext *C, const int mval[2]);
Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2]);
Object *ED_view3d_give_object_under_cursor(bContext *C, const int mval[2]);
Object *ED_view3d_give_material_slot_under_cursor(bContext *C,
const int mval[2],
int *r_material_slot);
bool ED_view3d_is_object_under_cursor(bContext *C, const int mval[2]);
/**
* 'clip' is used to know if our clip setting has changed.
*/
void ED_view3d_quadview_update(struct ScrArea *area, struct ARegion *region, bool do_clip);
void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip);
/**
* \note keep this synced with #ED_view3d_mats_rv3d_backup/#ED_view3d_mats_rv3d_restore
*/
void ED_view3d_update_viewmat(struct Depsgraph *depsgraph,
const struct Scene *scene,
struct View3D *v3d,
struct ARegion *region,
void ED_view3d_update_viewmat(Depsgraph *depsgraph,
const Scene *scene,
View3D *v3d,
ARegion *region,
const float viewmat[4][4],
const float winmat[4][4],
const struct rcti *rect,
const rcti *rect,
bool offscreen);
bool ED_view3d_quat_from_axis_view(char view, char view_axis_roll, float r_quat[4]);
bool ED_view3d_quat_to_axis_view(const float viewquat[4],
@@ -1113,21 +1074,21 @@ bool ED_view3d_quat_to_axis_view_and_reset_quat(float viewquat[4],
char ED_view3d_lock_view_from_index(int index);
char ED_view3d_axis_view_opposite(char view);
bool ED_view3d_lock(struct RegionView3D *rv3d);
bool ED_view3d_lock(RegionView3D *rv3d);
void ED_view3d_datamask(const struct Scene *scene,
struct ViewLayer *view_layer,
const struct View3D *v3d,
struct CustomData_MeshMasks *r_cddata_masks);
void ED_view3d_datamask(const Scene *scene,
ViewLayer *view_layer,
const View3D *v3d,
CustomData_MeshMasks *r_cddata_masks);
/**
* Goes over all modes and view3d settings.
*/
void ED_view3d_screen_datamask(const struct Scene *scene,
struct ViewLayer *view_layer,
const struct bScreen *screen,
struct CustomData_MeshMasks *r_cddata_masks);
void ED_view3d_screen_datamask(const Scene *scene,
ViewLayer *view_layer,
const bScreen *screen,
CustomData_MeshMasks *r_cddata_masks);
bool ED_view3d_offset_lock_check(const struct View3D *v3d, const struct RegionView3D *rv3d);
bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d);
/**
* For viewport operators that exit camera perspective.
*
@@ -1135,9 +1096,9 @@ bool ED_view3d_offset_lock_check(const struct View3D *v3d, const struct RegionVi
* sets the `ofs` and `dist` values of the viewport so it matches the camera,
* otherwise switching out of camera view may jump to a different part of the scene.
*/
void ED_view3d_persp_switch_from_camera(const struct Depsgraph *depsgraph,
struct View3D *v3d,
struct RegionView3D *rv3d,
void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph,
View3D *v3d,
RegionView3D *rv3d,
char persp);
/**
* Action to take when rotating the view,
@@ -1145,9 +1106,7 @@ void ED_view3d_persp_switch_from_camera(const struct Depsgraph *depsgraph,
*
* shared with NDOF.
*/
bool ED_view3d_persp_ensure(const struct Depsgraph *depsgraph,
struct View3D *v3d,
struct ARegion *region);
bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *region);
/* Camera view functions. */
@@ -1155,33 +1114,31 @@ bool ED_view3d_persp_ensure(const struct Depsgraph *depsgraph,
* Utility to scale zoom level when in camera-view #RegionView3D.camzoom and apply limits.
* \return true a change was made.
*/
bool ED_view3d_camera_view_zoom_scale(struct RegionView3D *rv3d, const float scale);
bool ED_view3d_camera_view_zoom_scale(RegionView3D *rv3d, const float scale);
/**
* Utility to pan when in camera view.
* \param event_ofs: The offset the pan in screen (pixel) coordinates.
* \return true when a change was made.
*/
bool ED_view3d_camera_view_pan(struct ARegion *region, const float event_ofs[2]);
bool ED_view3d_camera_view_pan(ARegion *region, const float event_ofs[2]);
/* Camera lock functions */
/**
* \return true when the 3D Viewport is locked to its camera.
*/
bool ED_view3d_camera_lock_check(const struct View3D *v3d, const struct RegionView3D *rv3d);
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d);
/**
* Copy the camera to the view before starting a view transformation.
*
* Apply the camera object transformation to the 3D Viewport.
* (needed so we can use regular 3D Viewport manipulation operators, that sync back to the camera).
*/
void ED_view3d_camera_lock_init_ex(const struct Depsgraph *depsgraph,
struct View3D *v3d,
struct RegionView3D *rv3d,
void ED_view3d_camera_lock_init_ex(const Depsgraph *depsgraph,
View3D *v3d,
RegionView3D *rv3d,
bool calc_dist);
void ED_view3d_camera_lock_init(const struct Depsgraph *depsgraph,
struct View3D *v3d,
struct RegionView3D *rv3d);
void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d);
/**
* Copy the view to the camera, return true if.
*
@@ -1189,36 +1146,26 @@ void ED_view3d_camera_lock_init(const struct Depsgraph *depsgraph,
*
* \return true if the camera (or one of it's parents) was moved.
*/
bool ED_view3d_camera_lock_sync(const struct Depsgraph *depsgraph,
struct View3D *v3d,
struct RegionView3D *rv3d);
bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d);
bool ED_view3d_camera_autokey(const struct Scene *scene,
struct ID *id_key,
struct bContext *C,
bool do_rotate,
bool do_translate);
bool ED_view3d_camera_autokey(
const Scene *scene, ID *id_key, bContext *C, bool do_rotate, bool do_translate);
/**
* Call after modifying a locked view.
*
* \note Not every view edit currently auto-keys (numeric-pad for eg),
* this is complicated because of smooth-view.
*/
bool ED_view3d_camera_lock_autokey(struct View3D *v3d,
struct RegionView3D *rv3d,
struct bContext *C,
bool do_rotate,
bool do_translate);
bool ED_view3d_camera_lock_autokey(
View3D *v3d, RegionView3D *rv3d, bContext *C, bool do_rotate, bool do_translate);
void ED_view3d_lock_clear(struct View3D *v3d);
void ED_view3d_lock_clear(View3D *v3d);
/**
* Check if creating an undo step should be performed if the viewport moves.
* \return true if #ED_view3d_camera_lock_undo_push would do an undo push.
*/
bool ED_view3d_camera_lock_undo_test(const View3D *v3d,
const RegionView3D *rv3d,
struct bContext *C);
bool ED_view3d_camera_lock_undo_test(const View3D *v3d, const RegionView3D *rv3d, bContext *C);
/**
* Create an undo step when the camera is locked to the view.
@@ -1228,8 +1175,8 @@ bool ED_view3d_camera_lock_undo_test(const View3D *v3d,
*/
bool ED_view3d_camera_lock_undo_push(const char *str,
const View3D *v3d,
const struct RegionView3D *rv3d,
struct bContext *C);
const RegionView3D *rv3d,
bContext *C);
/**
* A version of #ED_view3d_camera_lock_undo_push that performs a grouped undo push.
@@ -1239,8 +1186,8 @@ bool ED_view3d_camera_lock_undo_push(const char *str,
*/
bool ED_view3d_camera_lock_undo_grouped_push(const char *str,
const View3D *v3d,
const struct RegionView3D *rv3d,
struct bContext *C);
const RegionView3D *rv3d,
bContext *C);
#define VIEW3D_MARGIN 1.4f
#define VIEW3D_DIST_FALLBACK 1.0f
@@ -1263,7 +1210,7 @@ float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], float
*
* \note take care that #RegionView3d.viewinv is up to date, #ED_view3d_update_viewmat first.
*/
void ED_view3d_distance_set(struct RegionView3D *rv3d, float dist);
void ED_view3d_distance_set(RegionView3D *rv3d, float dist);
/**
* Change the distance & offset to match the depth of \a dist_co along the view axis.
*
@@ -1271,41 +1218,39 @@ void ED_view3d_distance_set(struct RegionView3D *rv3d, float dist);
* \param dist_min: Resulting distances below this will be ignored.
* \return Success if the distance was set.
*/
bool ED_view3d_distance_set_from_location(struct RegionView3D *rv3d,
bool ED_view3d_distance_set_from_location(RegionView3D *rv3d,
const float dist_co[3],
float dist_min);
/**
* Could move this elsewhere, but tied into #ED_view3d_grid_scale
*/
float ED_scene_grid_scale(const struct Scene *scene, const char **r_grid_unit);
float ED_view3d_grid_scale(const struct Scene *scene,
const struct View3D *v3d,
const char **r_grid_unit);
void ED_view3d_grid_steps(const struct Scene *scene,
const struct View3D *v3d,
const struct RegionView3D *rv3d,
float ED_scene_grid_scale(const Scene *scene, const char **r_grid_unit);
float ED_view3d_grid_scale(const Scene *scene, const View3D *v3d, const char **r_grid_unit);
void ED_view3d_grid_steps(const Scene *scene,
const View3D *v3d,
const RegionView3D *rv3d,
float r_grid_steps[8]);
/**
* Simulates the grid scale that is actually viewed.
* The actual code is seen in `object_grid_frag.glsl` (see `grid_res`).
* Currently the simulation is only done when RV3D_VIEW_IS_AXIS.
*/
float ED_view3d_grid_view_scale(struct Scene *scene,
struct View3D *v3d,
struct ARegion *region,
float ED_view3d_grid_view_scale(Scene *scene,
View3D *v3d,
ARegion *region,
const char **r_grid_unit);
/**
* \note The info that this uses is updated in #ED_refresh_viewport_fps,
* which currently gets called during #SCREEN_OT_animation_step.
*/
void ED_scene_draw_fps(const struct Scene *scene, int xoffset, int *yoffset);
void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset);
/* Render */
void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *region);
void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *area);
void ED_view3d_stop_render_preview(wmWindowManager *wm, ARegion *region);
void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area);
#define SHADING_XRAY_ALPHA(shading) \
(((shading).type == OB_WIRE) ? (shading).xray_alpha_wire : (shading).xray_alpha)
@@ -1345,25 +1290,25 @@ void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrAr
/**
* Try avoid using these more move out of legacy.
*/
void ED_view3d_draw_bgpic_test(const struct Scene *scene,
struct Depsgraph *depsgraph,
struct ARegion *region,
struct View3D *v3d,
void ED_view3d_draw_bgpic_test(const Scene *scene,
Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
bool do_foreground,
bool do_camera_frame);
/* view3d_gizmo_preselect_type.cc */
void ED_view3d_gizmo_mesh_preselect_get_active(struct bContext *C,
struct wmGizmo *gz,
struct Base **r_base,
struct BMElem **r_ele);
void ED_view3d_gizmo_mesh_preselect_clear(struct wmGizmo *gz);
void ED_view3d_gizmo_mesh_preselect_get_active(bContext *C,
wmGizmo *gz,
Base **r_base,
BMElem **r_ele);
void ED_view3d_gizmo_mesh_preselect_clear(wmGizmo *gz);
/* space_view3d.cc */
void ED_view3d_buttons_region_layout_ex(const struct bContext *C,
struct ARegion *region,
void ED_view3d_buttons_region_layout_ex(const bContext *C,
ARegion *region,
const char *category_override);
/* `view3d_view.cc` */
@@ -1372,15 +1317,13 @@ void ED_view3d_buttons_region_layout_ex(const struct bContext *C,
* See if current UUID is valid, otherwise set a valid UUID to v3d,
* Try to keep the same UUID previously used to allow users to quickly toggle back and forth.
*/
bool ED_view3d_local_collections_set(struct Main *bmain, struct View3D *v3d);
void ED_view3d_local_collections_reset(struct bContext *C, bool reset_all);
bool ED_view3d_local_collections_set(Main *bmain, View3D *v3d);
void ED_view3d_local_collections_reset(bContext *C, bool reset_all);
#ifdef WITH_XR_OPENXR
void ED_view3d_xr_mirror_update(const struct ScrArea *area, const struct View3D *v3d, bool enable);
void ED_view3d_xr_shading_update(struct wmWindowManager *wm,
const View3D *v3d,
const struct Scene *scene);
bool ED_view3d_is_region_xr_mirror_active(const struct wmWindowManager *wm,
const struct View3D *v3d,
const struct ARegion *region);
void ED_view3d_xr_mirror_update(const ScrArea *area, const View3D *v3d, bool enable);
void ED_view3d_xr_shading_update(wmWindowManager *wm, const View3D *v3d, const Scene *scene);
bool ED_view3d_is_region_xr_mirror_active(const wmWindowManager *wm,
const View3D *v3d,
const ARegion *region);
#endif

View File

@@ -22,11 +22,11 @@ struct Scene;
struct View3D;
struct View3DShading;
void ED_view3d_draw_offscreen(struct Depsgraph *depsgraph,
const struct Scene *scene,
void ED_view3d_draw_offscreen(Depsgraph *depsgraph,
const Scene *scene,
eDrawType drawtype,
struct View3D *v3d,
struct ARegion *region,
View3D *v3d,
ARegion *region,
int winx,
int winy,
const float viewmat[4][4],
@@ -36,15 +36,15 @@ void ED_view3d_draw_offscreen(struct Depsgraph *depsgraph,
const char *viewname,
bool do_color_management,
bool restore_rv3d_mats,
struct GPUOffScreen *ofs,
struct GPUViewport *viewport);
GPUOffScreen *ofs,
GPUViewport *viewport);
/**
* Creates own fake 3d views (wrapping #ED_view3d_draw_offscreen). Similar too
* #ED_view_draw_offscreen_imbuf_simple, but takes view/projection matrices as arguments.
*/
void ED_view3d_draw_offscreen_simple(struct Depsgraph *depsgraph,
struct Scene *scene,
struct View3DShading *shading_override,
void ED_view3d_draw_offscreen_simple(Depsgraph *depsgraph,
Scene *scene,
View3DShading *shading_override,
eDrawType drawtype,
int object_type_exclude_viewport_override,
int object_type_exclude_select_override,
@@ -60,8 +60,8 @@ void ED_view3d_draw_offscreen_simple(struct Depsgraph *depsgraph,
bool draw_background,
const char *viewname,
bool do_color_management,
struct GPUOffScreen *ofs,
struct GPUViewport *viewport);
GPUOffScreen *ofs,
GPUViewport *viewport);
/**
* Utility func for ED_view3d_draw_offscreen
@@ -69,19 +69,19 @@ void ED_view3d_draw_offscreen_simple(struct Depsgraph *depsgraph,
* \param ofs: Optional off-screen buffer, can be NULL.
* (avoids re-creating when doing multiple GL renders).
*/
struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Depsgraph *depsgraph,
struct Scene *scene,
eDrawType drawtype,
struct View3D *v3d,
struct ARegion *region,
int sizex,
int sizey,
eImBufFlags imbuf_flag,
int alpha_mode,
const char *viewname,
bool restore_rv3d_mats,
struct GPUOffScreen *ofs,
char err_out[256]);
ImBuf *ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph,
Scene *scene,
eDrawType drawtype,
View3D *v3d,
ARegion *region,
int sizex,
int sizey,
eImBufFlags imbuf_flag,
int alpha_mode,
const char *viewname,
bool restore_rv3d_mats,
GPUOffScreen *ofs,
char err_out[256]);
/**
* Creates own fake 3d views (wrapping #ED_view3d_draw_offscreen_imbuf)
*
@@ -90,16 +90,16 @@ struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Depsgraph *depsgraph,
*
* \note used by the sequencer
*/
struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(struct Depsgraph *depsgraph,
struct Scene *scene,
struct View3DShading *shading_override,
eDrawType drawtype,
struct Object *camera,
int width,
int height,
eImBufFlags imbuf_flags,
eV3DOffscreenDrawFlag draw_flags,
int alpha_mode,
const char *viewname,
struct GPUOffScreen *ofs,
char err_out[256]);
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph,
Scene *scene,
View3DShading *shading_override,
eDrawType drawtype,
Object *camera,
int width,
int height,
eImBufFlags imbuf_flags,
eV3DOffscreenDrawFlag draw_flags,
int alpha_mode,
const char *viewname,
GPUOffScreen *ofs,
char err_out[256]);

View File

@@ -8,10 +8,8 @@
#pragma once
#ifdef __cplusplus
# include <functional>
# include <string>
#endif
#include <functional>
#include <string>
#include "BLI_compiler_attrs.h"
#include "BLI_string_utf8_symbols.h"
@@ -20,10 +18,6 @@
#include "UI_interface_icons.hh"
#include "WM_types.hh"
#ifdef __cplusplus
extern "C" {
#endif
/* Struct Declarations */
struct ARegion;
@@ -41,6 +35,8 @@ struct ListBase;
struct MTex;
struct Panel;
struct PanelType;
struct PanelCategoryDyn;
struct PanelCategoryStack;
struct PointerRNA;
struct PropertyRNA;
struct ReportList;
@@ -51,6 +47,7 @@ struct bNode;
struct bNodeSocket;
struct bNodeTree;
struct bScreen;
struct MenuType;
struct rctf;
struct rcti;
struct uiButSearch;
@@ -71,15 +68,15 @@ struct wmOperatorType;
struct wmRegionListenerParams;
struct wmWindow;
typedef struct uiBlock uiBlock;
typedef struct uiBut uiBut;
typedef struct uiButExtraOpIcon uiButExtraOpIcon;
typedef struct uiLayout uiLayout;
typedef struct uiPopupBlockHandle uiPopupBlockHandle;
struct uiBlock;
struct uiBut;
struct uiButExtraOpIcon;
struct uiLayout;
struct uiPopupBlockHandle;
/* C handle for C++ #ui::AbstractView type. */
typedef struct uiViewHandle uiViewHandle;
struct uiViewHandle;
/* C handle for C++ #ui::AbstractViewItem type. */
typedef struct uiViewItemHandle uiViewItemHandle;
struct uiViewItemHandle;
/* Defines */
@@ -119,7 +116,7 @@ typedef struct uiViewItemHandle uiViewItemHandle;
#define UI_SCREEN_MARGIN 10
/** #uiBlock.emboss and #uiBut.emboss */
typedef enum eUIEmbossType {
enum eUIEmbossType {
UI_EMBOSS = 0, /* use widget style for drawing */
UI_EMBOSS_NONE = 1, /* Nothing, only icon and/or text */
UI_EMBOSS_PULLDOWN = 2, /* Pull-down menu style */
@@ -131,7 +128,7 @@ typedef enum eUIEmbossType {
UI_EMBOSS_NONE_OR_STATUS = 4,
UI_EMBOSS_UNDEFINED = 255, /* For layout engine, use emboss from block. */
} eUIEmbossType;
};
/** #uiBlock::direction */
enum {
@@ -359,7 +356,7 @@ enum {
* - bit 8: for 'bit'
* - bit 9-15: button type (now 6 bits, 64 types)
*/
typedef enum {
enum eButPointerType {
UI_BUT_POIN_NONE = 0,
UI_BUT_POIN_CHAR = 32,
@@ -368,7 +365,7 @@ typedef enum {
UI_BUT_POIN_FLOAT = 128,
// UI_BUT_POIN_FUNCTION = 192, /* UNUSED */
UI_BUT_POIN_BIT = 256, /* OR'd with a bit index. */
} eButPointerType;
};
/** \note requires `but->poin != NULL`. */
#define UI_BUT_POIN_TYPES (UI_BUT_POIN_FLOAT | UI_BUT_POIN_SHORT | UI_BUT_POIN_CHAR)
@@ -377,7 +374,7 @@ typedef enum {
* #uiBut::type
* OR'd with #eButPointerType when passing as an argument.
*/
typedef enum {
enum eButType {
UI_BTYPE_BUT = 1 << 9,
UI_BTYPE_ROW = 2 << 9,
UI_BTYPE_TEXT = 3 << 9,
@@ -442,12 +439,12 @@ typedef enum {
UI_BTYPE_DECORATOR = 58 << 9,
/** An item a view (see #ui::AbstractViewItem). */
UI_BTYPE_VIEW_ITEM = 59 << 9,
} eButType;
};
#define BUTTYPE (63 << 9)
/** Gradient types, for color picker #UI_BTYPE_HSVCUBE etc. */
typedef enum eButGradientType {
enum eButGradientType {
UI_GRAD_SV = 0,
UI_GRAD_HV = 1,
UI_GRAD_HS = 2,
@@ -457,7 +454,7 @@ typedef enum eButGradientType {
UI_GRAD_V_ALT = 9,
UI_GRAD_L_ALT = 10,
} eButGradientType;
};
/* Drawing
*
@@ -465,16 +462,13 @@ typedef enum eButGradientType {
* Used for code that draws its own UI style elements. */
void UI_draw_roundbox_corner_set(int type);
void UI_draw_roundbox_aa(const struct rctf *rect, bool filled, float rad, const float color[4]);
void UI_draw_roundbox_4fv(const struct rctf *rect, bool filled, float rad, const float col[4]);
void UI_draw_roundbox_3ub_alpha(const struct rctf *rect,
bool filled,
float rad,
const unsigned char col[3],
unsigned char alpha);
void UI_draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4]);
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4]);
void UI_draw_roundbox_3ub_alpha(
const rctf *rect, bool filled, float rad, const unsigned char col[3], unsigned char alpha);
void UI_draw_roundbox_3fv_alpha(
const struct rctf *rect, bool filled, float rad, const float col[3], float alpha);
void UI_draw_roundbox_4fv_ex(const struct rctf *rect,
const rctf *rect, bool filled, float rad, const float col[3], float alpha);
void UI_draw_roundbox_4fv_ex(const rctf *rect,
const float inner1[4],
const float inner2[4],
float shade_dir,
@@ -483,10 +477,10 @@ void UI_draw_roundbox_4fv_ex(const struct rctf *rect,
float rad);
#if 0 /* unused */
int UI_draw_roundbox_corner_get(void);
int UI_draw_roundbox_corner_get();
#endif
void UI_draw_box_shadow(const struct rctf *rect, unsigned char alpha);
void UI_draw_box_shadow(const rctf *rect, unsigned char alpha);
void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const float color[4]);
/**
@@ -498,7 +492,7 @@ void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const flo
* \param rect: The offsets for the view, not the zones.
*/
void UI_draw_safe_areas(uint pos,
const struct rctf *rect,
const rctf *rect,
const float title_aspect[2],
const float action_aspect[2]);
@@ -510,10 +504,7 @@ enum {
/**
* Function in use for buttons and for view2d sliders.
*/
void UI_draw_widget_scroll(struct uiWidgetColors *wcol,
const struct rcti *rect,
const struct rcti *slider,
int state);
void UI_draw_widget_scroll(uiWidgetColors *wcol, const rcti *rect, const rcti *slider, int state);
/**
* Shortening string helper.
@@ -528,7 +519,7 @@ void UI_draw_widget_scroll(struct uiWidgetColors *wcol,
* Useful for strings with shortcuts
* (like `A Very Long Foo Bar Label For Menu Entry|Ctrl O' -> 'AVeryLong...MenuEntry|Ctrl O`).
*/
float UI_text_clip_middle_ex(const struct uiFontStyle *fstyle,
float UI_text_clip_middle_ex(const uiFontStyle *fstyle,
char *str,
float okwidth,
float minwidth,
@@ -551,44 +542,39 @@ float UI_text_clip_middle_ex(const struct uiFontStyle *fstyle,
*
* - #UI_but_funcN_set will free the argument with MEM_freeN. */
typedef struct uiSearchItems uiSearchItems;
struct uiSearchItems;
typedef void (*uiButHandleFunc)(struct bContext *C, void *arg1, void *arg2);
typedef void (*uiButHandleRenameFunc)(struct bContext *C, void *arg, char *origstr);
typedef void (*uiButHandleNFunc)(struct bContext *C, void *argN, void *arg2);
typedef void (*uiButHandleHoldFunc)(struct bContext *C, struct ARegion *butregion, uiBut *but);
typedef int (*uiButCompleteFunc)(struct bContext *C, char *str, void *arg);
using uiButHandleFunc = void (*)(bContext *C, void *arg1, void *arg2);
using uiButHandleRenameFunc = void (*)(bContext *C, void *arg, char *origstr);
using uiButHandleNFunc = void (*)(bContext *C, void *argN, void *arg2);
using uiButHandleHoldFunc = void (*)(bContext *C, ARegion *butregion, uiBut *but);
using uiButCompleteFunc = int (*)(bContext *C, char *str, void *arg);
/** Function to compare the identity of two buttons over redraws, to check if they represent the
* same data, and thus should be considered the same button over redraws. */
typedef bool (*uiButIdentityCompareFunc)(const uiBut *a, const uiBut *b);
using uiButIdentityCompareFunc = bool (*)(const uiBut *a, const uiBut *b);
/* Search types. */
typedef struct ARegion *(*uiButSearchCreateFn)(struct bContext *C,
struct ARegion *butregion,
struct uiButSearch *search_but);
using uiButSearchCreateFn = ARegion *(*)(bContext *C, ARegion *butregion, uiButSearch *search_but);
/**
* `is_first` is typically used to ignore search filtering when the menu is first opened in order
* to display the full list of options. The value will be false after the button's text is edited
* (for every call except the first).
*/
typedef void (*uiButSearchUpdateFn)(
const struct bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first);
typedef bool (*uiButSearchContextMenuFn)(struct bContext *C,
void *arg,
void *active,
const struct wmEvent *event);
typedef struct ARegion *(*uiButSearchTooltipFn)(struct bContext *C,
struct ARegion *region,
const struct rcti *item_rect,
void *arg,
void *active);
typedef void (*uiButSearchListenFn)(const struct wmRegionListenerParams *params, void *arg);
using uiButSearchUpdateFn =
void (*)(const bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first);
using uiButSearchContextMenuFn = bool (*)(bContext *C,
void *arg,
void *active,
const wmEvent *event);
using uiButSearchTooltipFn =
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active);
using uiButSearchListenFn = void (*)(const wmRegionListenerParams *params, void *arg);
/** Must return an allocated string. */
typedef char *(*uiButToolTipFunc)(struct bContext *C, void *argN, const char *tip);
using uiButToolTipFunc = char *(*)(bContext *C, void *argN, const char *tip);
typedef void (*uiBlockHandleFunc)(struct bContext *C, void *arg, int event);
using uiBlockHandleFunc = void (*)(bContext *C, void *arg, int event);
/* -------------------------------------------------------------------- */
/** \name Custom Interaction
@@ -615,24 +601,24 @@ struct uiBlockInteraction_Params {
};
/** Returns 'user_data', freed by #uiBlockInteractionEndFn. */
typedef void *(*uiBlockInteractionBeginFn)(struct bContext *C,
const struct uiBlockInteraction_Params *params,
void *arg1);
typedef void (*uiBlockInteractionEndFn)(struct bContext *C,
const struct uiBlockInteraction_Params *params,
void *arg1,
void *user_data);
typedef void (*uiBlockInteractionUpdateFn)(struct bContext *C,
const struct uiBlockInteraction_Params *params,
void *arg1,
void *user_data);
using uiBlockInteractionBeginFn = void *(*)(bContext *C,
const uiBlockInteraction_Params *params,
void *arg1);
using uiBlockInteractionEndFn = void (*)(bContext *C,
const uiBlockInteraction_Params *params,
void *arg1,
void *user_data);
using uiBlockInteractionUpdateFn = void (*)(bContext *C,
const uiBlockInteraction_Params *params,
void *arg1,
void *user_data);
typedef struct uiBlockInteraction_CallbackData {
struct uiBlockInteraction_CallbackData {
uiBlockInteractionBeginFn begin_fn;
uiBlockInteractionEndFn end_fn;
uiBlockInteractionUpdateFn update_fn;
void *arg1;
} uiBlockInteraction_CallbackData;
};
void UI_block_interaction_set(uiBlock *block, uiBlockInteraction_CallbackData *callbacks);
@@ -640,18 +626,18 @@ void UI_block_interaction_set(uiBlock *block, uiBlockInteraction_CallbackData *c
/* Menu Callbacks */
typedef void (*uiMenuCreateFunc)(struct bContext *C, struct uiLayout *layout, void *arg1);
typedef void (*uiMenuHandleFunc)(struct bContext *C, void *arg, int event);
using uiMenuCreateFunc = void (*)(bContext *C, uiLayout *layout, void *arg1);
using uiMenuHandleFunc = void (*)(bContext *C, void *arg, int event);
/**
* Used for cycling menu values without opening the menu (Ctrl-Wheel).
* \param direction: forward or backwards [1 / -1].
* \param arg1: uiBut.poin (as with #uiMenuCreateFunc).
* \return true when the button was changed.
*/
typedef bool (*uiMenuStepFunc)(struct bContext *C, int direction, void *arg1);
using uiMenuStepFunc = bool (*)(bContext *C, int direction, void *arg1);
typedef void *(*uiCopyArgFunc)(const void *arg);
typedef void (*uiFreeArgFunc)(void *arg);
using uiCopyArgFunc = void *(*)(const void *arg);
using uiFreeArgFunc = void (*)(void *arg);
/* `interface_query.cc` */
@@ -665,7 +651,7 @@ bool UI_block_is_empty_ex(const uiBlock *block, bool skip_title);
bool UI_block_is_empty(const uiBlock *block);
bool UI_block_can_add_separator(const uiBlock *block);
struct uiList *UI_list_find_mouse_over(const struct ARegion *region, const struct wmEvent *event);
uiList *UI_list_find_mouse_over(const ARegion *region, const wmEvent *event);
/* `interface_region_menu_popup.cc` */
@@ -677,29 +663,28 @@ struct uiList *UI_list_find_mouse_over(const struct ARegion *region, const struc
* the uiItem functions in between. If it is a simple confirmation menu
* or similar, popups can be created with a single function call.
*/
typedef struct uiPopupMenu uiPopupMenu;
struct uiPopupMenu;
uiPopupMenu *UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL();
uiPopupMenu *UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL();
/**
* Directly create a popup menu that is not refreshed on redraw.
*
* Only return handler, and set optional title.
* \param block_name: Assigned to uiBlock.name (useful info for debugging).
*/
uiPopupMenu *UI_popup_menu_begin_ex(struct bContext *C,
uiPopupMenu *UI_popup_menu_begin_ex(bContext *C,
const char *title,
const char *block_name,
int icon) ATTR_NONNULL();
/**
* Set the whole structure to work.
*/
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup);
bool UI_popup_menu_end_or_cancel(struct bContext *C, struct uiPopupMenu *pup);
struct uiLayout *UI_popup_menu_layout(uiPopupMenu *pup);
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup);
bool UI_popup_menu_end_or_cancel(bContext *C, uiPopupMenu *pup);
uiLayout *UI_popup_menu_layout(uiPopupMenu *pup);
void UI_popup_menu_reports(struct bContext *C, struct ReportList *reports) ATTR_NONNULL();
int UI_popup_menu_invoke(struct bContext *C, const char *idname, struct ReportList *reports)
ATTR_NONNULL(1, 2);
void UI_popup_menu_reports(bContext *C, ReportList *reports) ATTR_NONNULL();
int UI_popup_menu_invoke(bContext *C, const char *idname, ReportList *reports) ATTR_NONNULL(1, 2);
/**
* Allow setting menu return value from externals.
@@ -709,16 +694,13 @@ void UI_popup_menu_retval_set(const uiBlock *block, int retval, bool enable);
/**
* Setting the button makes the popup open from the button instead of the cursor.
*/
void UI_popup_menu_but_set(uiPopupMenu *pup, struct ARegion *butregion, uiBut *but);
void UI_popup_menu_but_set(uiPopupMenu *pup, ARegion *butregion, uiBut *but);
/* `interface_region_popover.cc` */
typedef struct uiPopover uiPopover;
struct uiPopover;
int UI_popover_panel_invoke(struct bContext *C,
const char *idname,
bool keep_open,
struct ReportList *reports);
int UI_popover_panel_invoke(bContext *C, const char *idname, bool keep_open, ReportList *reports);
/**
* Only return handler, and set optional title.
@@ -726,37 +708,34 @@ int UI_popover_panel_invoke(struct bContext *C,
* \param from_active_button: Use the active button for positioning,
* use when the popover is activated from an operator instead of directly from the button.
*/
uiPopover *UI_popover_begin(struct bContext *C, int menu_width, bool from_active_button)
ATTR_NONNULL(1);
uiPopover *UI_popover_begin(bContext *C, int menu_width, bool from_active_button) ATTR_NONNULL(1);
/**
* Set the whole structure to work.
*/
void UI_popover_end(struct bContext *C, struct uiPopover *pup, struct wmKeyMap *keymap);
struct uiLayout *UI_popover_layout(uiPopover *pup);
void UI_popover_end(bContext *C, uiPopover *pup, wmKeyMap *keymap);
uiLayout *UI_popover_layout(uiPopover *pup);
void UI_popover_once_clear(uiPopover *pup);
/* `interface_region_menu_pie.cc` */
/* Pie menus */
typedef struct uiPieMenu uiPieMenu;
struct uiPieMenu;
int UI_pie_menu_invoke(struct bContext *C, const char *idname, const struct wmEvent *event);
int UI_pie_menu_invoke_from_operator_enum(struct bContext *C,
int UI_pie_menu_invoke(bContext *C, const char *idname, const wmEvent *event);
int UI_pie_menu_invoke_from_operator_enum(bContext *C,
const char *title,
const char *opname,
const char *propname,
const struct wmEvent *event);
int UI_pie_menu_invoke_from_rna_enum(struct bContext *C,
const wmEvent *event);
int UI_pie_menu_invoke_from_rna_enum(bContext *C,
const char *title,
const char *path,
const struct wmEvent *event);
const wmEvent *event);
struct uiPieMenu *UI_pie_menu_begin(struct bContext *C,
const char *title,
int icon,
const struct wmEvent *event) ATTR_NONNULL();
void UI_pie_menu_end(struct bContext *C, uiPieMenu *pie);
struct uiLayout *UI_pie_menu_layout(struct uiPieMenu *pie);
uiPieMenu *UI_pie_menu_begin(bContext *C, const char *title, int icon, const wmEvent *event)
ATTR_NONNULL();
void UI_pie_menu_end(bContext *C, uiPieMenu *pie);
uiLayout *UI_pie_menu_layout(uiPieMenu *pie);
/* `interface_region_menu_popup.cc` */
@@ -764,34 +743,28 @@ struct uiLayout *UI_pie_menu_layout(struct uiPieMenu *pie);
*
* Functions used to create popup blocks. These are like popup menus
* but allow using all button types and creating an own layout. */
typedef uiBlock *(*uiBlockCreateFunc)(struct bContext *C, struct ARegion *region, void *arg1);
typedef void (*uiBlockCancelFunc)(struct bContext *C, void *arg1);
using uiBlockCreateFunc = uiBlock *(*)(bContext *C, ARegion *region, void *arg1);
using uiBlockCancelFunc = void (*)(bContext *C, void *arg1);
void UI_popup_block_invoke(struct bContext *C,
uiBlockCreateFunc func,
void *arg,
uiFreeArgFunc arg_free);
void UI_popup_block_invoke_ex(struct bContext *C,
uiBlockCreateFunc func,
void *arg,
uiFreeArgFunc arg_free,
bool can_refresh);
void UI_popup_block_ex(struct bContext *C,
void UI_popup_block_invoke(bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free);
void UI_popup_block_invoke_ex(
bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free, bool can_refresh);
void UI_popup_block_ex(bContext *C,
uiBlockCreateFunc func,
uiBlockHandleFunc popup_func,
uiBlockCancelFunc cancel_func,
void *arg,
struct wmOperator *op);
wmOperator *op);
#if 0 /* UNUSED */
void uiPupBlockOperator(struct bContext *C,
void uiPupBlockOperator( bContext *C,
uiBlockCreateFunc func,
struct wmOperator *op,
wmOperator *op,
wmOperatorCallContext opcontext);
#endif
void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block);
void UI_popup_block_close(bContext *C, wmWindow *win, uiBlock *block);
bool UI_popup_block_name_exists(const struct bScreen *screen, const char *name);
bool UI_popup_block_name_exists(const bScreen *screen, const char *name);
/* Blocks
*
@@ -803,20 +776,20 @@ bool UI_popup_block_name_exists(const struct bScreen *screen, const char *name);
* Freeing blocks is done by the screen/ module automatically.
*/
uiBlock *UI_block_begin(const struct bContext *C,
struct ARegion *region,
uiBlock *UI_block_begin(const bContext *C,
ARegion *region,
const char *name,
eUIEmbossType emboss);
void UI_block_end_ex(const struct bContext *C, uiBlock *block, const int xy[2], int r_xy[2]);
void UI_block_end(const struct bContext *C, uiBlock *block);
void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2], int r_xy[2]);
void UI_block_end(const bContext *C, uiBlock *block);
/**
* Uses local copy of style, to scale things down, and allow widgets to change stuff.
*/
void UI_block_draw(const struct bContext *C, struct uiBlock *block);
void UI_blocklist_update_window_matrix(const struct bContext *C, const struct ListBase *lb);
void UI_blocklist_update_view_for_buttons(const struct bContext *C, const struct ListBase *lb);
void UI_blocklist_draw(const struct bContext *C, const struct ListBase *lb);
void UI_block_update_from_old(const struct bContext *C, struct uiBlock *block);
void UI_block_draw(const bContext *C, uiBlock *block);
void UI_blocklist_update_window_matrix(const bContext *C, const ListBase *lb);
void UI_blocklist_update_view_for_buttons(const bContext *C, const ListBase *lb);
void UI_blocklist_draw(const bContext *C, const ListBase *lb);
void UI_block_update_from_old(const bContext *C, uiBlock *block);
enum {
UI_BLOCK_THEME_STYLE_REGULAR = 0,
@@ -835,23 +808,23 @@ void UI_block_set_search_only(uiBlock *block, bool search_only);
/**
* Can be called with C==NULL.
*/
void UI_block_free(const struct bContext *C, uiBlock *block);
void UI_block_free(const bContext *C, uiBlock *block);
void UI_block_listen(const uiBlock *block, const struct wmRegionListenerParams *listener_params);
void UI_block_listen(const uiBlock *block, const wmRegionListenerParams *listener_params);
/**
* Can be called with C==NULL.
*/
void UI_blocklist_free(const struct bContext *C, struct ARegion *region);
void UI_blocklist_free_inactive(const struct bContext *C, struct ARegion *region);
void UI_blocklist_free(const bContext *C, ARegion *region);
void UI_blocklist_free_inactive(const bContext *C, ARegion *region);
/**
* Is called by notifier.
*/
void UI_screen_free_active_but_highlight(const struct bContext *C, struct bScreen *screen);
void UI_region_free_active_but_all(struct bContext *context, struct ARegion *region);
void UI_screen_free_active_but_highlight(const bContext *C, bScreen *screen);
void UI_region_free_active_but_all(bContext *context, ARegion *region);
void UI_block_region_set(uiBlock *block, struct ARegion *region);
void UI_block_region_set(uiBlock *block, ARegion *region);
void UI_block_lock_set(uiBlock *block, bool val, const char *lockstr);
void UI_block_lock_clear(uiBlock *block);
@@ -863,7 +836,7 @@ void UI_block_align_begin(uiBlock *block);
void UI_block_align_end(uiBlock *block);
/** Block bounds/position calculation. */
typedef enum {
enum eBlockBoundsCalc {
UI_BLOCK_BOUNDS_NONE = 0,
UI_BLOCK_BOUNDS = 1,
UI_BLOCK_BOUNDS_TEXT,
@@ -871,12 +844,12 @@ typedef enum {
UI_BLOCK_BOUNDS_POPUP_MENU,
UI_BLOCK_BOUNDS_POPUP_CENTER,
UI_BLOCK_BOUNDS_PIE_CENTER,
} eBlockBoundsCalc;
};
/**
* Used for various cases.
*/
void UI_block_bounds_set_normal(struct uiBlock *block, int addval);
void UI_block_bounds_set_normal(uiBlock *block, int addval);
/**
* Used for pull-downs.
*/
@@ -895,7 +868,7 @@ void UI_block_bounds_set_menu(uiBlock *block, int addval, const int bounds_offse
void UI_block_bounds_set_centered(uiBlock *block, int addval);
void UI_block_bounds_set_explicit(uiBlock *block, int minx, int miny, int maxx, int maxy);
int UI_blocklist_min_y_get(struct ListBase *lb);
int UI_blocklist_min_y_get(ListBase *lb);
void UI_block_direction_set(uiBlock *block, char direction);
/**
@@ -908,13 +881,13 @@ void UI_block_translate(uiBlock *block, int x, int y);
int UI_but_return_value_get(uiBut *but);
uiBut *UI_but_active_drop_name_button(const struct bContext *C);
uiBut *UI_but_active_drop_name_button(const bContext *C);
/**
* Returns true if highlighted button allows drop of names.
* called in region context.
*/
bool UI_but_active_drop_name(const struct bContext *C);
bool UI_but_active_drop_color(struct bContext *C);
bool UI_but_active_drop_name(const bContext *C);
bool UI_but_active_drop_color(bContext *C);
void UI_but_flag_enable(uiBut *but, int flag);
void UI_but_flag_disable(uiBut *but, int flag);
@@ -937,32 +910,24 @@ void UI_but_type_set_menu_from_pulldown(uiBut *but);
* they should keep calling #uiDefBut to keep them alive.
* \return false when button removed.
*/
bool UI_but_active_only_ex(const struct bContext *C,
struct ARegion *region,
uiBlock *block,
uiBut *but,
bool remove_on_failure);
bool UI_but_active_only(const struct bContext *C,
struct ARegion *region,
uiBlock *block,
uiBut *but);
bool UI_but_active_only_ex(
const bContext *C, ARegion *region, uiBlock *block, uiBut *but, bool remove_on_failure);
bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBut *but);
/**
* \warning This must run after other handlers have been added,
* otherwise the handler won't be removed, see: #71112.
*/
bool UI_block_active_only_flagged_buttons(const struct bContext *C,
struct ARegion *region,
struct uiBlock *block);
bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *region, uiBlock *block);
/**
* Simulate button click.
*/
void UI_but_execute(const struct bContext *C, struct ARegion *region, uiBut *but);
void UI_but_execute(const bContext *C, ARegion *region, uiBut *but);
bool UI_but_online_manual_id(const uiBut *but,
char *r_str,
size_t str_maxncpy) ATTR_WARN_UNUSED_RESULT;
bool UI_but_online_manual_id_from_active(const struct bContext *C,
bool UI_but_online_manual_id_from_active(const bContext *C,
char *r_str,
size_t str_maxncpy) ATTR_WARN_UNUSED_RESULT;
bool UI_but_is_userdef(const uiBut *but);
@@ -1100,7 +1065,7 @@ uiBut *uiDefButR(uiBlock *block,
int y,
short width,
short height,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
int index,
float min,
@@ -1116,8 +1081,8 @@ uiBut *uiDefButR_prop(uiBlock *block,
int y,
short width,
short height,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNA *prop,
int index,
float min,
float max,
@@ -1136,7 +1101,7 @@ uiBut *uiDefButO(uiBlock *block,
const char *tip);
uiBut *uiDefButO_ptr(uiBlock *block,
int type,
struct wmOperatorType *ot,
wmOperatorType *ot,
wmOperatorCallContext opcontext,
const char *str,
int x,
@@ -1243,7 +1208,7 @@ uiBut *uiDefIconButR(uiBlock *block,
int y,
short width,
short height,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
int index,
float min,
@@ -1259,8 +1224,8 @@ uiBut *uiDefIconButR_prop(uiBlock *block,
int y,
short width,
short height,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNA *prop,
int index,
float min,
float max,
@@ -1279,7 +1244,7 @@ uiBut *uiDefIconButO(uiBlock *block,
const char *tip);
uiBut *uiDefIconButO_ptr(uiBlock *block,
int type,
struct wmOperatorType *ot,
wmOperatorType *ot,
wmOperatorCallContext opcontext,
int icon,
int x,
@@ -1345,7 +1310,7 @@ uiBut *uiDefIconTextButR(uiBlock *block,
int y,
short width,
short height,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
int index,
float min,
@@ -1362,8 +1327,8 @@ uiBut *uiDefIconTextButR_prop(uiBlock *block,
int y,
short width,
short height,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNA *prop,
int index,
float min,
float max,
@@ -1383,7 +1348,7 @@ uiBut *uiDefIconTextButO(uiBlock *block,
const char *tip);
uiBut *uiDefIconTextButO_ptr(uiBlock *block,
int type,
struct wmOperatorType *ot,
wmOperatorType *ot,
wmOperatorCallContext opcontext,
int icon,
const char *str,
@@ -1394,21 +1359,18 @@ uiBut *uiDefIconTextButO_ptr(uiBlock *block,
const char *tip);
/** For passing inputs to ButO buttons. */
struct PointerRNA *UI_but_operator_ptr_get(uiBut *but);
PointerRNA *UI_but_operator_ptr_get(uiBut *but);
void UI_but_context_ptr_set(uiBlock *block,
uiBut *but,
const char *name,
const struct PointerRNA *ptr);
const struct PointerRNA *UI_but_context_ptr_get(const uiBut *but,
const char *name,
const StructRNA *type CPP_ARG_DEFAULT(nullptr));
struct bContextStore *UI_but_context_get(const uiBut *but);
void UI_but_context_ptr_set(uiBlock *block, uiBut *but, const char *name, const PointerRNA *ptr);
const PointerRNA *UI_but_context_ptr_get(const uiBut *but,
const char *name,
const StructRNA *type CPP_ARG_DEFAULT(nullptr));
bContextStore *UI_but_context_get(const uiBut *but);
void UI_but_unit_type_set(uiBut *but, int unit_type);
int UI_but_unit_type_get(const uiBut *but);
typedef enum uiStringInfoType {
enum uiStringInfoType {
BUT_GET_RNAPROP_IDENTIFIER = 1,
BUT_GET_RNASTRUCT_IDENTIFIER,
BUT_GET_RNAENUM_IDENTIFIER,
@@ -1425,20 +1387,20 @@ typedef enum uiStringInfoType {
BUT_GET_RNAENUM_TIP,
BUT_GET_OP_KEYMAP,
BUT_GET_PROP_KEYMAP,
} uiStringInfoType;
};
typedef struct uiStringInfo {
struct uiStringInfo {
uiStringInfoType type;
char *strinfo;
} uiStringInfo;
};
/**
* \note Expects pointers to #uiStringInfo structs as parameters.
* Will fill them with translated strings, when possible.
* Strings in #uiStringInfo must be MEM_freeN'ed by caller.
*/
void UI_but_string_info_get(struct bContext *C, uiBut *but, ...) ATTR_SENTINEL(0);
void UI_but_extra_icon_string_info_get(struct bContext *C, uiButExtraOpIcon *extra_icon, ...)
void UI_but_string_info_get(bContext *C, uiBut *but, ...) ATTR_SENTINEL(0);
void UI_but_extra_icon_string_info_get(bContext *C, uiButExtraOpIcon *extra_icon, ...)
ATTR_SENTINEL(0);
/* Edit i18n stuff. */
@@ -1490,14 +1452,14 @@ enum eButProgressType {
/***************************** ID Utilities *******************************/
int UI_icon_from_id(const struct ID *id);
int UI_icon_from_id(const ID *id);
/** See: #BKE_report_type_str */
int UI_icon_from_report_type(int type);
int UI_icon_colorid_from_report_type(int type);
int UI_text_colorid_from_report_type(int type);
int UI_icon_from_event_type(short event_type, short event_value);
int UI_icon_from_keymap_item(const struct wmKeyMapItem *kmi, int r_icon_mod[4]);
int UI_icon_from_keymap_item(const wmKeyMapItem *kmi, int r_icon_mod[4]);
uiBut *uiDefPulldownBut(uiBlock *block,
uiBlockCreateFunc func,
@@ -1604,8 +1566,8 @@ uiBut *uiDefSearchBut(uiBlock *block,
* used by callback to call again the right op with the right options (properties values).
*/
uiBut *uiDefSearchButO_ptr(uiBlock *block,
struct wmOperatorType *ot,
struct IDProperty *properties,
wmOperatorType *ot,
IDProperty *properties,
void *arg,
int retval,
int icon,
@@ -1619,28 +1581,28 @@ uiBut *uiDefSearchButO_ptr(uiBlock *block,
const char *tip);
/** For #uiDefAutoButsRNA. */
typedef enum {
enum eButLabelAlign {
/** Keep current layout for aligning label with property button. */
UI_BUT_LABEL_ALIGN_NONE,
/** Align label and property button vertically. */
UI_BUT_LABEL_ALIGN_COLUMN,
/** Split layout into a column for the label and one for property button. */
UI_BUT_LABEL_ALIGN_SPLIT_COLUMN,
} eButLabelAlign;
};
/** Return info for uiDefAutoButsRNA. */
typedef enum eAutoPropButsReturn {
enum eAutoPropButsReturn {
/** Returns when no buttons were added */
UI_PROP_BUTS_NONE_ADDED = 1 << 0,
/** Returned when any property failed the custom check callback (check_prop) */
UI_PROP_BUTS_ANY_FAILED_CHECK = 1 << 1,
} eAutoPropButsReturn;
};
ENUM_OPERATORS(eAutoPropButsReturn, UI_PROP_BUTS_ANY_FAILED_CHECK);
uiBut *uiDefAutoButR(uiBlock *block,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNA *prop,
int index,
const char *name,
int icon,
@@ -1663,12 +1625,12 @@ void uiDefAutoButsArrayR(uiBlock *block,
* \param prop_activate_init: Property to activate on initial popup (#UI_BUT_ACTIVATE_ON_INIT).
*/
eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout,
struct PointerRNA *ptr,
bool (*check_prop)(struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
bool (*check_prop)(PointerRNA *ptr,
PropertyRNA *prop,
void *user_data),
void *user_data,
struct PropertyRNA *prop_activate_init,
PropertyRNA *prop_activate_init,
eButLabelAlign label_align,
bool compact);
@@ -1741,8 +1703,8 @@ void UI_but_func_search_set_results_are_suggestions(uiBut *but, bool value);
/**
* Height in pixels, it's using hard-coded values still.
*/
int UI_searchbox_size_y(void);
int UI_searchbox_size_x(void);
int UI_searchbox_size_y();
int UI_searchbox_size_x();
/**
* Check if a string is in an existing search box.
*/
@@ -1754,7 +1716,7 @@ int UI_search_items_find_index(uiSearchItems *items, const char *name);
void UI_but_hint_drawstr_set(uiBut *but, const char *string);
void UI_but_icon_indicator_number_set(uiBut *but, const int indicator_number);
void UI_but_node_link_set(uiBut *but, struct bNodeSocket *socket, const float draw_color[4]);
void UI_but_node_link_set(uiBut *but, bNodeSocket *socket, const float draw_color[4]);
void UI_but_number_step_size_set(uiBut *but, float step_size);
void UI_but_number_precision_set(uiBut *but, float precision);
@@ -1770,48 +1732,45 @@ void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2
void UI_but_func_complete_set(uiBut *but, uiButCompleteFunc func, void *arg);
void UI_but_func_drawextra_set(
uiBlock *block,
void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect),
void *arg1,
void *arg2);
void UI_but_func_drawextra_set(uiBlock *block,
void (*func)(const bContext *C, void *, void *, void *, rcti *rect),
void *arg1,
void *arg2);
void UI_but_func_menu_step_set(uiBut *but, uiMenuStepFunc func);
void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg);
#ifdef __cplusplus
void UI_but_func_tooltip_label_set(uiBut *but, std::function<std::string(const uiBut *but)> func);
#endif
/**
* Recreate tool-tip (use to update dynamic tips)
*/
void UI_but_tooltip_refresh(struct bContext *C, uiBut *but);
void UI_but_tooltip_refresh(bContext *C, uiBut *but);
/**
* Removes tool-tip timer from active but
* (meaning tool-tip is disabled until it's re-enabled again).
*/
void UI_but_tooltip_timer_remove(struct bContext *C, uiBut *but);
void UI_but_tooltip_timer_remove(bContext *C, uiBut *but);
bool UI_textbutton_activate_rna(const struct bContext *C,
struct ARegion *region,
bool UI_textbutton_activate_rna(const bContext *C,
ARegion *region,
const void *rna_poin_data,
const char *rna_prop_id);
bool UI_textbutton_activate_but(const struct bContext *C, uiBut *but);
bool UI_textbutton_activate_but(const bContext *C, uiBut *but);
/**
* push a new event onto event queue to activate the given button
* (usually a text-field) upon entering a popup
*/
void UI_but_focus_on_enter_event(struct wmWindow *win, uiBut *but);
void UI_but_focus_on_enter_event(wmWindow *win, uiBut *but);
void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN);
struct PointerRNA *UI_but_extra_operator_icon_add(uiBut *but,
const char *opname,
wmOperatorCallContext opcontext,
int icon);
struct wmOperatorType *UI_but_extra_operator_icon_optype_get(struct uiButExtraOpIcon *extra_icon);
struct PointerRNA *UI_but_extra_operator_icon_opptr_get(struct uiButExtraOpIcon *extra_icon);
PointerRNA *UI_but_extra_operator_icon_add(uiBut *but,
const char *opname,
wmOperatorCallContext opcontext,
int icon);
wmOperatorType *UI_but_extra_operator_icon_optype_get(uiButExtraOpIcon *extra_icon);
PointerRNA *UI_but_extra_operator_icon_opptr_get(uiButExtraOpIcon *extra_icon);
/**
* Get the scaled size for a preview button (typically #UI_BTyPE_PREVIEW_TILE) based on \a
@@ -1827,7 +1786,7 @@ int UI_preview_tile_size_y_no_label(const int size_px CPP_ARG_DEFAULT(96));
* Call begin once, then multiple times do_name with all possibilities,
* and finally end to finish and get the completed name. */
typedef struct AutoComplete AutoComplete;
struct AutoComplete;
#define AUTOCOMPLETE_NO_MATCH 0
#define AUTOCOMPLETE_FULL_MATCH 1
@@ -1842,16 +1801,15 @@ int UI_autocomplete_end(AutoComplete *autocpl, char *autoname);
* Functions to set drag data for buttons. This enables dragging support, whereby the drag data is
* "dragged", not the button itself. */
void UI_but_drag_set_id(uiBut *but, struct ID *id);
void UI_but_drag_set_id(uiBut *but, ID *id);
/**
* Set an image to display while dragging. This works for any drag type (`WM_DRAG_XXX`).
* Not to be confused with #UI_but_drag_set_image(), which sets up dragging of an image.
*
* Sets #UI_BUT_DRAG_FULL_BUT so the full button can be dragged.
*/
void UI_but_drag_attach_image(uiBut *but, const struct ImBuf *imb, float scale);
void UI_but_drag_attach_image(uiBut *but, const ImBuf *imb, float scale);
#ifdef __cplusplus
/**
* Sets #UI_BUT_DRAG_FULL_BUT so the full button can be dragged.
* \param asset: May be passed from a temporary variable, drag data only stores a copy of this.
@@ -1860,11 +1818,10 @@ void UI_but_drag_set_asset(uiBut *but,
const blender::asset_system::AssetRepresentation *asset,
int import_type, /* eAssetImportType */
int icon,
const struct ImBuf *imb,
const ImBuf *imb,
float scale);
#endif
void UI_but_drag_set_rna(uiBut *but, struct PointerRNA *ptr);
void UI_but_drag_set_rna(uiBut *but, PointerRNA *ptr);
/**
* Enable dragging a path from this button.
* \param path: The path to drag. The passed string may be destructed, button keeps a copy.
@@ -1880,8 +1837,7 @@ void UI_but_drag_set_value(uiBut *but);
* Sets #UI_BUT_DRAG_FULL_BUT so the full button can be dragged.
* \param path: The path to drag. The passed string may be destructed, button keeps a copy.
*/
void UI_but_drag_set_image(
uiBut *but, const char *path, int icon, const struct ImBuf *imb, float scale);
void UI_but_drag_set_image(uiBut *but, const char *path, int icon, const ImBuf *imb, float scale);
/* Panels
*
@@ -1889,109 +1845,102 @@ void UI_but_drag_set_image(
* could use a good cleanup, though how they will function in 2.5 is
* not clear yet so we postpone that. */
void UI_panels_begin(const struct bContext *C, struct ARegion *region);
void UI_panels_end(const struct bContext *C, struct ARegion *region, int *r_x, int *r_y);
void UI_panels_begin(const bContext *C, ARegion *region);
void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y);
/**
* Draw panels, selected (panels currently being dragged) on top.
*/
void UI_panels_draw(const struct bContext *C, struct ARegion *region);
void UI_panels_draw(const bContext *C, ARegion *region);
struct Panel *UI_panel_find_by_type(struct ListBase *lb, const struct PanelType *pt);
Panel *UI_panel_find_by_type(ListBase *lb, const PanelType *pt);
/**
* \note \a panel should be return value from #UI_panel_find_by_type and can be NULL.
*/
struct Panel *UI_panel_begin(struct ARegion *region,
struct ListBase *lb,
uiBlock *block,
struct PanelType *pt,
struct Panel *panel,
bool *r_open);
Panel *UI_panel_begin(
ARegion *region, ListBase *lb, uiBlock *block, PanelType *pt, Panel *panel, bool *r_open);
/**
* Create the panel header button group, used to mark which buttons are part of
* panel headers for the panel search process that happens later. This Should be
* called before adding buttons for the panel's header layout.
*/
void UI_panel_header_buttons_begin(struct Panel *panel);
void UI_panel_header_buttons_begin(Panel *panel);
/**
* Finish the button group for the panel header to avoid putting panel body buttons in it.
*/
void UI_panel_header_buttons_end(struct Panel *panel);
void UI_panel_end(struct Panel *panel, int width, int height);
void UI_panel_header_buttons_end(Panel *panel);
void UI_panel_end(Panel *panel, int width, int height);
/**
* Set a context for this entire panel and its current layout. This should be used whenever panel
* callbacks that are called outside of regular drawing might require context. Currently it affects
* the #PanelType.reorder callback only.
*/
void UI_panel_context_pointer_set(struct Panel *panel, const char *name, struct PointerRNA *ptr);
void UI_panel_context_pointer_set(Panel *panel, const char *name, PointerRNA *ptr);
/**
* Get the panel's expansion state, taking into account
* expansion set from property search if it applies.
*/
bool UI_panel_is_closed(const struct Panel *panel);
bool UI_panel_is_active(const struct Panel *panel);
bool UI_panel_is_closed(const Panel *panel);
bool UI_panel_is_active(const Panel *panel);
/**
* For button layout next to label.
*/
void UI_panel_label_offset(const struct uiBlock *block, int *r_x, int *r_y);
bool UI_panel_should_show_background(const struct ARegion *region,
const struct PanelType *panel_type);
int UI_panel_size_y(const struct Panel *panel);
bool UI_panel_is_dragging(const struct Panel *panel);
void UI_panel_label_offset(const uiBlock *block, int *r_x, int *r_y);
bool UI_panel_should_show_background(const ARegion *region, const PanelType *panel_type);
int UI_panel_size_y(const Panel *panel);
bool UI_panel_is_dragging(const Panel *panel);
/**
* Find whether a panel or any of its sub-panels contain a property that matches the search filter,
* depending on the search process running in #UI_block_apply_search_filter earlier.
*/
bool UI_panel_matches_search_filter(const struct Panel *panel);
bool UI_panel_can_be_pinned(const struct Panel *panel);
bool UI_panel_matches_search_filter(const Panel *panel);
bool UI_panel_can_be_pinned(const Panel *panel);
bool UI_panel_category_is_visible(const struct ARegion *region);
void UI_panel_category_add(struct ARegion *region, const char *name);
struct PanelCategoryDyn *UI_panel_category_find(const struct ARegion *region, const char *idname);
struct PanelCategoryStack *UI_panel_category_active_find(struct ARegion *region,
const char *idname);
const char *UI_panel_category_active_get(struct ARegion *region, bool set_fallback);
void UI_panel_category_active_set(struct ARegion *region, const char *idname);
void UI_panel_category_active_set_default(struct ARegion *region, const char *idname);
void UI_panel_category_clear_all(struct ARegion *region);
bool UI_panel_category_is_visible(const ARegion *region);
void UI_panel_category_add(ARegion *region, const char *name);
PanelCategoryDyn *UI_panel_category_find(const ARegion *region, const char *idname);
PanelCategoryStack *UI_panel_category_active_find(ARegion *region, const char *idname);
const char *UI_panel_category_active_get(ARegion *region, bool set_fallback);
void UI_panel_category_active_set(ARegion *region, const char *idname);
void UI_panel_category_active_set_default(ARegion *region, const char *idname);
void UI_panel_category_clear_all(ARegion *region);
/**
* Draw vertical tabs on the left side of the region, one tab per category.
*/
void UI_panel_category_draw_all(struct ARegion *region, const char *category_id_active);
void UI_panel_category_draw_all(ARegion *region, const char *category_id_active);
/* Panel custom data. */
struct PointerRNA *UI_panel_custom_data_get(const struct Panel *panel);
struct PointerRNA *UI_region_panel_custom_data_under_cursor(const struct bContext *C,
const struct wmEvent *event);
void UI_panel_custom_data_set(struct Panel *panel, struct PointerRNA *custom_data);
PointerRNA *UI_panel_custom_data_get(const Panel *panel);
PointerRNA *UI_region_panel_custom_data_under_cursor(const bContext *C, const wmEvent *event);
void UI_panel_custom_data_set(Panel *panel, PointerRNA *custom_data);
/* Poly-instantiated panels for representing a list of data. */
/**
* Called in situations where panels need to be added dynamically rather than
* having only one panel corresponding to each #PanelType.
*/
struct Panel *UI_panel_add_instanced(const struct bContext *C,
struct ARegion *region,
struct ListBase *panels,
const char *panel_idname,
struct PointerRNA *custom_data);
Panel *UI_panel_add_instanced(const bContext *C,
ARegion *region,
ListBase *panels,
const char *panel_idname,
PointerRNA *custom_data);
/**
* Remove instanced panels from the region's panel list.
*
* \note Can be called with NULL \a C, but it should be avoided because
* handlers might not be removed.
*/
void UI_panels_free_instanced(const struct bContext *C, struct ARegion *region);
void UI_panels_free_instanced(const bContext *C, ARegion *region);
#define INSTANCED_PANEL_UNIQUE_STR_SIZE 16
/**
* Find a unique key to append to the #PanelType.idname for the lookup to the panel's #uiBlock.
* Needed for instanced panels, where there can be multiple with the same type and identifier.
*/
void UI_list_panel_unique_str(struct Panel *panel, char *r_name);
void UI_list_panel_unique_str(Panel *panel, char *r_name);
typedef void (*uiListPanelIDFromDataFunc)(void *data_link, char *r_idname);
using uiListPanelIDFromDataFunc = void (*)(void *data_link, char *r_idname);
/**
* Check if the instanced panels in the region's panels correspond to the list of data the panels
* represent. Returns false if the panels have been reordered or if the types from the list data
@@ -2001,8 +1950,8 @@ typedef void (*uiListPanelIDFromDataFunc)(void *data_link, char *r_idname);
* \param panel_idname_func: Function to find the #PanelType.idname for each item in the data list.
* For a readability and generality, this lookup happens separately for each type of panel list.
*/
bool UI_panel_list_matches_data(struct ARegion *region,
struct ListBase *data,
bool UI_panel_list_matches_data(ARegion *region,
ListBase *data,
uiListPanelIDFromDataFunc panel_idname_func);
/* Handlers
@@ -2011,24 +1960,21 @@ bool UI_panel_list_matches_data(struct ARegion *region,
* handling WM events. Mostly this is done automatic by modules such
* as screen/ if ED_KEYMAP_UI is set, or internally in popup functions. */
void UI_region_handlers_add(struct ListBase *handlers);
void UI_popup_handlers_add(struct bContext *C,
struct ListBase *handlers,
uiPopupBlockHandle *popup,
char flag);
void UI_popup_handlers_remove(struct ListBase *handlers, uiPopupBlockHandle *popup);
void UI_popup_handlers_remove_all(struct bContext *C, struct ListBase *handlers);
void UI_region_handlers_add(ListBase *handlers);
void UI_popup_handlers_add(bContext *C, ListBase *handlers, uiPopupBlockHandle *popup, char flag);
void UI_popup_handlers_remove(ListBase *handlers, uiPopupBlockHandle *popup);
void UI_popup_handlers_remove_all(bContext *C, ListBase *handlers);
/* Module
*
* init and exit should be called before using this module. init_userdef must
* be used to reinitialize some internal state if user preferences change. */
void UI_init(void);
void UI_init();
/* after reading userdef file */
void UI_init_userdef(void);
void UI_reinit_font(void);
void UI_exit(void);
void UI_init_userdef();
void UI_reinit_font();
void UI_exit();
/* Layout
*
@@ -2065,7 +2011,7 @@ enum {
UI_LAYOUT_ALIGN_RIGHT = 3,
};
typedef enum eUI_Item_Flag {
enum eUI_Item_Flag {
/* UI_ITEM_O_RETURN_PROPS = 1 << 0, */ /* UNUSED */
UI_ITEM_R_EXPAND = 1 << 1,
UI_ITEM_R_SLIDER = 1 << 2,
@@ -2095,7 +2041,7 @@ typedef enum eUI_Item_Flag {
UI_ITEM_R_FORCE_BLANK_DECORATE = 1 << 13,
/* Even create the property split layout if there's no name to show there. */
UI_ITEM_R_SPLIT_EMPTY_NAME = 1 << 14,
} eUI_Item_Flag;
};
ENUM_OPERATORS(eUI_Item_Flag, UI_ITEM_R_SPLIT_EMPTY_NAME)
#define UI_ITEM_NONE eUI_Item_Flag(0)
@@ -2140,7 +2086,7 @@ uiLayout *UI_block_layout(uiBlock *block,
int size,
int em,
int padding,
const struct uiStyle *style);
const uiStyle *style);
void UI_block_layout_set_current(uiBlock *block, uiLayout *layout);
void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y);
bool UI_block_layout_needs_resolving(const uiBlock *block);
@@ -2158,14 +2104,14 @@ void UI_block_layout_free(uiBlock *block);
*/
bool UI_block_apply_search_filter(uiBlock *block, const char *search_filter);
void UI_region_message_subscribe(struct ARegion *region, struct wmMsgBus *mbus);
void UI_region_message_subscribe(ARegion *region, wmMsgBus *mbus);
uiBlock *uiLayoutGetBlock(uiLayout *layout);
void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv);
void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct PointerRNA *ptr);
struct bContextStore *uiLayoutGetContextStore(uiLayout *layout);
void uiLayoutContextCopy(uiLayout *layout, struct bContextStore *context);
void uiLayoutSetContextPointer(uiLayout *layout, const char *name, PointerRNA *ptr);
bContextStore *uiLayoutGetContextStore(uiLayout *layout);
void uiLayoutContextCopy(uiLayout *layout, bContextStore *context);
/**
* Set tooltip function for all buttons in the layout.
@@ -2187,21 +2133,20 @@ void uiLayoutSetTooltipFunc(uiLayout *layout,
/**
* This is a bit of a hack but best keep it in one place at least.
*/
struct wmOperatorType *UI_but_operatortype_get_from_enum_menu(struct uiBut *but,
struct PropertyRNA **r_prop);
wmOperatorType *UI_but_operatortype_get_from_enum_menu(uiBut *but, PropertyRNA **r_prop);
/**
* This is a bit of a hack but best keep it in one place at least.
*/
struct MenuType *UI_but_menutype_get(uiBut *but);
MenuType *UI_but_menutype_get(uiBut *but);
/**
* This is a bit of a hack but best keep it in one place at least.
*/
struct PanelType *UI_but_paneltype_get(uiBut *but);
void UI_menutype_draw(struct bContext *C, struct MenuType *mt, struct uiLayout *layout);
PanelType *UI_but_paneltype_get(uiBut *but);
void UI_menutype_draw(bContext *C, MenuType *mt, uiLayout *layout);
/**
* Used for popup panels only.
*/
void UI_paneltype_draw(struct bContext *C, struct PanelType *pt, struct uiLayout *layout);
void UI_paneltype_draw(bContext *C, PanelType *pt, uiLayout *layout);
/* Only for convenience. */
void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but);
@@ -2266,9 +2211,9 @@ uiLayout *uiLayoutGridFlow(uiLayout *layout,
bool align);
uiLayout *uiLayoutBox(uiLayout *layout);
uiLayout *uiLayoutListBox(uiLayout *layout,
struct uiList *ui_list,
struct PointerRNA *actptr,
struct PropertyRNA *actprop);
uiList *ui_list,
PointerRNA *actptr,
PropertyRNA *actprop);
uiLayout *uiLayoutAbsolute(uiLayout *layout, bool align);
uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, bool align);
uiLayout *uiLayoutOverlap(uiLayout *layout);
@@ -2276,10 +2221,10 @@ uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout);
uiLayout *uiLayoutRadial(uiLayout *layout);
/* templates */
void uiTemplateHeader(uiLayout *layout, struct bContext *C);
void uiTemplateHeader(uiLayout *layout, bContext *C);
void uiTemplateID(uiLayout *layout,
const struct bContext *C,
struct PointerRNA *ptr,
const bContext *C,
PointerRNA *ptr,
const char *propname,
const char *newop,
const char *openop,
@@ -2288,8 +2233,8 @@ void uiTemplateID(uiLayout *layout,
bool live_icon,
const char *text);
void uiTemplateIDBrowse(uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
bContext *C,
PointerRNA *ptr,
const char *propname,
const char *newop,
const char *openop,
@@ -2297,8 +2242,8 @@ void uiTemplateIDBrowse(uiLayout *layout,
int filter,
const char *text);
void uiTemplateIDPreview(uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
bContext *C,
PointerRNA *ptr,
const char *propname,
const char *newop,
const char *openop,
@@ -2311,8 +2256,8 @@ void uiTemplateIDPreview(uiLayout *layout,
* Version of #uiTemplateID using tabs.
*/
void uiTemplateIDTabs(uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
bContext *C,
PointerRNA *ptr,
const char *propname,
const char *newop,
const char *menu,
@@ -2326,7 +2271,7 @@ void uiTemplateIDTabs(uiLayout *layout,
* used to determine the type of ID-pointer that can be used.
*/
void uiTemplateAnyID(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
const char *proptypename,
const char *text);
@@ -2335,18 +2280,18 @@ void uiTemplateAnyID(uiLayout *layout,
* A version of uiTemplateID that works for non-ID types.
*/
void uiTemplateSearch(uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
bContext *C,
PointerRNA *ptr,
const char *propname,
struct PointerRNA *searchptr,
PointerRNA *searchptr,
const char *searchpropname,
const char *newop,
const char *unlinkop);
void uiTemplateSearchPreview(uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
bContext *C,
PointerRNA *ptr,
const char *propname,
struct PointerRNA *searchptr,
PointerRNA *searchptr,
const char *searchpropname,
const char *newop,
const char *unlinkop,
@@ -2360,45 +2305,42 @@ void uiTemplateSearchPreview(uiLayout *layout,
* - root_ptr: struct that path gets built from
*/
void uiTemplatePathBuilder(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
struct PointerRNA *root_ptr,
PointerRNA *root_ptr,
const char *text);
void uiTemplateModifiers(uiLayout *layout, struct bContext *C);
void uiTemplateGpencilModifiers(uiLayout *layout, struct bContext *C);
void uiTemplateModifiers(uiLayout *layout, bContext *C);
void uiTemplateGpencilModifiers(uiLayout *layout, bContext *C);
/**
* Check if the shader effect panels don't match the data and rebuild the panels if so.
*/
void uiTemplateShaderFx(uiLayout *layout, struct bContext *C);
void uiTemplateShaderFx(uiLayout *layout, bContext *C);
/**
* Check if the constraint panels don't match the data and rebuild the panels if so.
*/
void uiTemplateConstraints(uiLayout *layout, struct bContext *C, bool use_bone_constraints);
void uiTemplateConstraints(uiLayout *layout, bContext *C, bool use_bone_constraints);
uiLayout *uiTemplateGpencilModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr);
uiLayout *uiTemplateGpencilModifier(uiLayout *layout, bContext *C, PointerRNA *ptr);
void uiTemplateGpencilColorPreview(uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
bContext *C,
PointerRNA *ptr,
const char *propname,
int rows,
int cols,
float scale,
int filter);
void uiTemplateOperatorRedoProperties(uiLayout *layout, const struct bContext *C);
void uiTemplateOperatorRedoProperties(uiLayout *layout, const bContext *C);
void uiTemplateConstraintHeader(uiLayout *layout, struct PointerRNA *ptr);
void uiTemplateConstraintHeader(uiLayout *layout, PointerRNA *ptr);
void uiTemplatePreview(uiLayout *layout,
struct bContext *C,
struct ID *id,
bContext *C,
ID *id,
bool show_buttons,
struct ID *parent,
struct MTex *slot,
ID *parent,
MTex *slot,
const char *preview_id);
void uiTemplateColorRamp(uiLayout *layout,
struct PointerRNA *ptr,
const char *propname,
bool expand);
void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname, bool expand);
/**
* \param icon_scale: Scale of the icon, 1x == button height.
*/
@@ -2407,16 +2349,16 @@ void uiTemplateIcon(uiLayout *layout, int icon_value, float icon_scale);
* \param icon_scale: Scale of the icon, 1x == button height.
*/
void uiTemplateIconView(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
bool show_labels,
float icon_scale,
float icon_scale_popup);
void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname);
void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname);
void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propname);
void uiTemplateCurveMapping(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
int type,
bool levels,
@@ -2427,57 +2369,43 @@ void uiTemplateCurveMapping(uiLayout *layout,
* Template for a path creation widget intended for custom bevel profiles.
* This section is quite similar to #uiTemplateCurveMapping, but with reduced complexity.
*/
void uiTemplateCurveProfile(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
void uiTemplateCurveProfile(uiLayout *layout, PointerRNA *ptr, const char *propname);
/**
* This template now follows User Preference for type - name is not correct anymore.
*/
void uiTemplateColorPicker(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
bool value_slider,
bool lock,
bool lock_luminosity,
bool cubic);
void uiTemplatePalette(uiLayout *layout,
struct PointerRNA *ptr,
const char *propname,
bool colors);
void uiTemplateCryptoPicker(uiLayout *layout,
struct PointerRNA *ptr,
const char *propname,
int icon);
void uiTemplatePalette(uiLayout *layout, PointerRNA *ptr, const char *propname, bool colors);
void uiTemplateCryptoPicker(uiLayout *layout, PointerRNA *ptr, const char *propname, int icon);
/**
* \todo for now, grouping of layers is determined by dividing up the length of
* the array of layer bitflags
*/
void uiTemplateLayers(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
struct PointerRNA *used_ptr,
PointerRNA *used_ptr,
const char *used_propname,
int active_layer);
void uiTemplateImage(uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
bContext *C,
PointerRNA *ptr,
const char *propname,
struct PointerRNA *userptr,
PointerRNA *userptr,
bool compact,
bool multiview);
void uiTemplateImageSettings(uiLayout *layout, struct PointerRNA *imfptr, bool color_management);
void uiTemplateImageStereo3d(uiLayout *layout, struct PointerRNA *stereo3d_format_ptr);
void uiTemplateImageViews(uiLayout *layout, struct PointerRNA *imaptr);
void uiTemplateImageFormatViews(uiLayout *layout,
struct PointerRNA *imfptr,
struct PointerRNA *ptr);
void uiTemplateImageLayers(uiLayout *layout,
struct bContext *C,
struct Image *ima,
struct ImageUser *iuser);
void uiTemplateImageInfo(uiLayout *layout,
struct bContext *C,
struct Image *ima,
struct ImageUser *iuser);
void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C);
void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, bool color_management);
void uiTemplateImageStereo3d(uiLayout *layout, PointerRNA *stereo3d_format_ptr);
void uiTemplateImageViews(uiLayout *layout, PointerRNA *imaptr);
void uiTemplateImageFormatViews(uiLayout *layout, PointerRNA *imfptr, PointerRNA *ptr);
void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser);
void uiTemplateImageInfo(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser);
void uiTemplateRunningJobs(uiLayout *layout, bContext *C);
void UI_but_func_operator_search(uiBut *but);
void uiTemplateOperatorSearch(uiLayout *layout);
@@ -2489,36 +2417,33 @@ void uiTemplateMenuSearch(uiLayout *layout);
* This function does not initialize the layout,
* functions can be called on the layout before and after.
*/
void uiTemplateOperatorPropertyButs(const struct bContext *C,
uiLayout *layout,
struct wmOperator *op,
eButLabelAlign label_align,
short flag);
void uiTemplateHeader3D_mode(uiLayout *layout, struct bContext *C);
void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C);
void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
void uiTemplateInputStatus(uiLayout *layout, struct bContext *C);
void uiTemplateStatusInfo(uiLayout *layout, struct bContext *C);
void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr);
void uiTemplateOperatorPropertyButs(
const bContext *C, uiLayout *layout, wmOperator *op, eButLabelAlign label_align, short flag);
void uiTemplateHeader3D_mode(uiLayout *layout, bContext *C);
void uiTemplateEditModeSelection(uiLayout *layout, bContext *C);
void uiTemplateReportsBanner(uiLayout *layout, bContext *C);
void uiTemplateInputStatus(uiLayout *layout, bContext *C);
void uiTemplateStatusInfo(uiLayout *layout, bContext *C);
void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr);
bool uiTemplateEventFromKeymapItem(struct uiLayout *layout,
bool uiTemplateEventFromKeymapItem(uiLayout *layout,
const char *text,
const struct wmKeyMapItem *kmi,
const wmKeyMapItem *kmi,
bool text_fallback);
void uiTemplateComponentMenu(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
const char *name);
void uiTemplateNodeSocket(uiLayout *layout, struct bContext *C, const float color[4]);
void uiTemplateNodeSocket(uiLayout *layout, bContext *C, const float color[4]);
/**
* Draw the main CacheFile properties and operators (file path, scale, etc.), that is those which
* do not have their own dedicated template functions.
*/
void uiTemplateCacheFile(uiLayout *layout,
const struct bContext *C,
struct PointerRNA *ptr,
const bContext *C,
PointerRNA *ptr,
const char *propname);
/**
@@ -2526,33 +2451,27 @@ void uiTemplateCacheFile(uiLayout *layout,
* Returns true if `ptr` has a RNACacheFile, false otherwise. If false, the output parameter is not
* initialized.
*/
bool uiTemplateCacheFilePointer(struct PointerRNA *ptr,
const char *propname,
struct PointerRNA *r_file_ptr);
bool uiTemplateCacheFilePointer(PointerRNA *ptr, const char *propname, PointerRNA *r_file_ptr);
/**
* Draw the velocity related properties of the CacheFile.
*/
void uiTemplateCacheFileVelocity(uiLayout *layout, struct PointerRNA *fileptr);
void uiTemplateCacheFileVelocity(uiLayout *layout, PointerRNA *fileptr);
/**
* Draw the render procedural related properties of the CacheFile.
*/
void uiTemplateCacheFileProcedural(uiLayout *layout,
const struct bContext *C,
struct PointerRNA *fileptr);
void uiTemplateCacheFileProcedural(uiLayout *layout, const bContext *C, PointerRNA *fileptr);
/**
* Draw the time related properties of the CacheFile.
*/
void uiTemplateCacheFileTimeSettings(uiLayout *layout, struct PointerRNA *fileptr);
void uiTemplateCacheFileTimeSettings(uiLayout *layout, PointerRNA *fileptr);
/**
* Draw the override layers related properties of the CacheFile.
*/
void uiTemplateCacheFileLayers(uiLayout *layout,
const struct bContext *C,
struct PointerRNA *fileptr);
void uiTemplateCacheFileLayers(uiLayout *layout, const bContext *C, PointerRNA *fileptr);
/** Default UIList class name, keep in sync with its declaration in `bl_ui/__init__.py`. */
#define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list"
@@ -2573,12 +2492,12 @@ enum uiTemplateListFlags {
ENUM_OPERATORS(uiTemplateListFlags, UI_TEMPLATE_LIST_FLAGS_LAST);
void uiTemplateList(uiLayout *layout,
const struct bContext *C,
const bContext *C,
const char *listtype_name,
const char *list_id,
struct PointerRNA *dataptr,
PointerRNA *dataptr,
const char *propname,
struct PointerRNA *active_dataptr,
PointerRNA *active_dataptr,
const char *active_propname,
const char *item_dyntip_propname,
int rows,
@@ -2586,116 +2505,101 @@ void uiTemplateList(uiLayout *layout,
int layout_type,
int columns,
enum uiTemplateListFlags flags);
struct uiList *uiTemplateList_ex(uiLayout *layout,
const struct bContext *C,
const char *listtype_name,
const char *list_id,
struct PointerRNA *dataptr,
const char *propname,
struct PointerRNA *active_dataptr,
const char *active_propname,
const char *item_dyntip_propname,
int rows,
int maxrows,
int layout_type,
int columns,
enum uiTemplateListFlags flags,
void *customdata);
uiList *uiTemplateList_ex(uiLayout *layout,
const bContext *C,
const char *listtype_name,
const char *list_id,
PointerRNA *dataptr,
const char *propname,
PointerRNA *active_dataptr,
const char *active_propname,
const char *item_dyntip_propname,
int rows,
int maxrows,
int layout_type,
int columns,
enum uiTemplateListFlags flags,
void *customdata);
void uiTemplateNodeLink(uiLayout *layout,
struct bContext *C,
struct bNodeTree *ntree,
struct bNode *node,
struct bNodeSocket *input);
void uiTemplateNodeView(uiLayout *layout,
struct bContext *C,
struct bNodeTree *ntree,
struct bNode *node,
struct bNodeSocket *input);
void uiTemplateNodeAssetMenuItems(uiLayout *layout, struct bContext *C, const char *catalog_path);
void uiTemplateTextureUser(uiLayout *layout, struct bContext *C);
void uiTemplateNodeLink(
uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input);
void uiTemplateNodeView(
uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input);
void uiTemplateNodeAssetMenuItems(uiLayout *layout, bContext *C, const char *catalog_path);
void uiTemplateTextureUser(uiLayout *layout, bContext *C);
/**
* Button to quickly show texture in Properties Editor texture tab.
*/
void uiTemplateTextureShow(uiLayout *layout,
const struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop);
const bContext *C,
PointerRNA *ptr,
PropertyRNA *prop);
void uiTemplateMovieClip(struct uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
const char *propname,
bool compact);
void uiTemplateTrack(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname);
void uiTemplateMarker(struct uiLayout *layout,
struct PointerRNA *ptr,
void uiTemplateMovieClip(
uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, bool compact);
void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname);
void uiTemplateMarker(uiLayout *layout,
PointerRNA *ptr,
const char *propname,
struct PointerRNA *userptr,
struct PointerRNA *trackptr,
PointerRNA *userptr,
PointerRNA *trackptr,
bool compact);
void uiTemplateMovieclipInformation(struct uiLayout *layout,
struct PointerRNA *ptr,
void uiTemplateMovieclipInformation(uiLayout *layout,
PointerRNA *ptr,
const char *propname,
struct PointerRNA *userptr);
PointerRNA *userptr);
void uiTemplateColorspaceSettings(struct uiLayout *layout,
struct PointerRNA *ptr,
const char *propname);
void uiTemplateColormanagedViewSettings(struct uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
void uiTemplateColorspaceSettings(uiLayout *layout, PointerRNA *ptr, const char *propname);
void uiTemplateColormanagedViewSettings(uiLayout *layout,
bContext *C,
PointerRNA *ptr,
const char *propname);
int uiTemplateRecentFiles(struct uiLayout *layout, int rows);
void uiTemplateFileSelectPath(uiLayout *layout,
struct bContext *C,
struct FileSelectParams *params);
int uiTemplateRecentFiles(uiLayout *layout, int rows);
void uiTemplateFileSelectPath(uiLayout *layout, bContext *C, FileSelectParams *params);
enum {
UI_TEMPLATE_ASSET_DRAW_NO_NAMES = (1 << 0),
UI_TEMPLATE_ASSET_DRAW_NO_FILTER = (1 << 1),
UI_TEMPLATE_ASSET_DRAW_NO_LIBRARY = (1 << 2),
};
void uiTemplateAssetView(struct uiLayout *layout,
const struct bContext *C,
void uiTemplateAssetView(uiLayout *layout,
const bContext *C,
const char *list_id,
struct PointerRNA *asset_library_dataptr,
PointerRNA *asset_library_dataptr,
const char *asset_library_propname,
struct PointerRNA *assets_dataptr,
PointerRNA *assets_dataptr,
const char *assets_propname,
struct PointerRNA *active_dataptr,
PointerRNA *active_dataptr,
const char *active_propname,
const struct AssetFilterSettings *filter_settings,
const AssetFilterSettings *filter_settings,
int display_flags,
const char *activate_opname,
struct PointerRNA *r_activate_op_properties,
PointerRNA *r_activate_op_properties,
const char *drag_opname,
struct PointerRNA *r_drag_op_properties);
PointerRNA *r_drag_op_properties);
void uiTemplateLightLinkingCollection(struct uiLayout *layout,
struct PointerRNA *ptr,
const char *propname);
void uiTemplateLightLinkingCollection(uiLayout *layout, PointerRNA *ptr, const char *propname);
void uiTemplateGreasePencilLayerTree(uiLayout *layout, struct bContext *C);
void uiTemplateGreasePencilLayerTree(uiLayout *layout, bContext *C);
/**
* \return: A RNA pointer for the operator properties.
*/
struct PointerRNA *UI_list_custom_activate_operator_set(struct uiList *ui_list,
const char *opname,
bool create_properties);
PointerRNA *UI_list_custom_activate_operator_set(uiList *ui_list,
const char *opname,
bool create_properties);
/**
* \return: A RNA pointer for the operator properties.
*/
struct PointerRNA *UI_list_custom_drag_operator_set(struct uiList *ui_list,
const char *opname,
bool create_properties);
PointerRNA *UI_list_custom_drag_operator_set(uiList *ui_list,
const char *opname,
bool create_properties);
/* items */
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname);
void uiItemEnumO_ptr(uiLayout *layout,
struct wmOperatorType *ot,
wmOperatorType *ot,
const char *name,
int icon,
const char *propname,
@@ -2748,40 +2652,40 @@ void uiItemStringO(uiLayout *layout,
const char *value);
void uiItemFullO_ptr(uiLayout *layout,
struct wmOperatorType *ot,
wmOperatorType *ot,
const char *name,
int icon,
struct IDProperty *properties,
IDProperty *properties,
wmOperatorCallContext context,
eUI_Item_Flag flag,
struct PointerRNA *r_opptr);
PointerRNA *r_opptr);
void uiItemFullO(uiLayout *layout,
const char *opname,
const char *name,
int icon,
struct IDProperty *properties,
IDProperty *properties,
wmOperatorCallContext context,
eUI_Item_Flag flag,
struct PointerRNA *r_opptr);
PointerRNA *r_opptr);
void uiItemFullOMenuHold_ptr(uiLayout *layout,
struct wmOperatorType *ot,
wmOperatorType *ot,
const char *name,
int icon,
struct IDProperty *properties,
IDProperty *properties,
wmOperatorCallContext context,
eUI_Item_Flag flag,
const char *menu_id, /* extra menu arg. */
struct PointerRNA *r_opptr);
PointerRNA *r_opptr);
void uiItemR(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
eUI_Item_Flag flag,
const char *name,
int icon);
void uiItemFullR(uiLayout *layout,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNA *prop,
int index,
int value,
eUI_Item_Flag flag,
@@ -2791,8 +2695,8 @@ void uiItemFullR(uiLayout *layout,
* Use a wrapper function since re-implementing all the logic in this function would be messy.
*/
void uiItemFullR_with_popover(uiLayout *layout,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNA *prop,
int index,
int value,
eUI_Item_Flag flag,
@@ -2800,58 +2704,54 @@ void uiItemFullR_with_popover(uiLayout *layout,
int icon,
const char *panel_type);
void uiItemFullR_with_menu(uiLayout *layout,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNA *prop,
int index,
int value,
eUI_Item_Flag flag,
const char *name,
int icon,
const char *menu_type);
void uiItemEnumR_prop(uiLayout *layout,
const char *name,
int icon,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
int value);
void uiItemEnumR_prop(
uiLayout *layout, const char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int value);
void uiItemEnumR(uiLayout *layout,
const char *name,
int icon,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
int value);
void uiItemEnumR_string_prop(uiLayout *layout,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNA *prop,
const char *value,
const char *name,
int icon);
void uiItemEnumR_string(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
const char *value,
const char *name,
int icon);
void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
void uiItemsEnumR(uiLayout *layout, PointerRNA *ptr, const char *propname);
void uiItemPointerR_prop(uiLayout *layout,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
struct PointerRNA *searchptr,
struct PropertyRNA *searchprop,
PointerRNA *ptr,
PropertyRNA *prop,
PointerRNA *searchptr,
PropertyRNA *searchprop,
const char *name,
int icon,
bool results_are_suggestions);
void uiItemPointerR(uiLayout *layout,
struct PointerRNA *ptr,
PointerRNA *ptr,
const char *propname,
struct PointerRNA *searchptr,
PointerRNA *searchptr,
const char *searchpropname,
const char *name,
int icon);
void uiItemsFullEnumO(uiLayout *layout,
const char *opname,
const char *propname,
struct IDProperty *properties,
IDProperty *properties,
wmOperatorCallContext context,
eUI_Item_Flag flag);
/**
@@ -2860,20 +2760,20 @@ void uiItemsFullEnumO(uiLayout *layout,
* A version of #uiItemsFullEnumO that takes pre-calculated item array.
*/
void uiItemsFullEnumO_items(uiLayout *layout,
struct wmOperatorType *ot,
struct PointerRNA ptr,
struct PropertyRNA *prop,
struct IDProperty *properties,
wmOperatorType *ot,
PointerRNA ptr,
PropertyRNA *prop,
IDProperty *properties,
wmOperatorCallContext context,
eUI_Item_Flag flag,
const struct EnumPropertyItem *item_array,
const EnumPropertyItem *item_array,
int totitem);
typedef struct uiPropertySplitWrapper {
struct uiPropertySplitWrapper {
uiLayout *label_column;
uiLayout *property_row;
uiLayout *decorate_column;
} uiPropertySplitWrapper;
};
/**
* Normally, we handle the split layout in #uiItemFullR(), but there are other cases where the
@@ -2883,8 +2783,7 @@ typedef struct uiPropertySplitWrapper {
uiPropertySplitWrapper uiItemPropertySplitWrapperCreate(uiLayout *parent_layout);
void uiItemL(uiLayout *layout, const char *name, int icon); /* label */
struct uiBut *uiItemL_ex(
uiLayout *layout, const char *name, int icon, bool highlight, bool redalert);
uiBut *uiItemL_ex(uiLayout *layout, const char *name, int icon, bool highlight, bool redalert);
/**
* Helper to add a label and creates a property split layout if needed.
*/
@@ -2892,11 +2791,11 @@ uiLayout *uiItemL_respect_property_split(uiLayout *layout, const char *text, int
/**
* Label icon for dragging.
*/
void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, const char *name, int icon);
void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, const char *name, int icon);
/**
* Menu.
*/
void uiItemM_ptr(uiLayout *layout, struct MenuType *mt, const char *name, int icon);
void uiItemM_ptr(uiLayout *layout, MenuType *mt, const char *name, int icon);
void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon);
/**
* Menu contents.
@@ -2909,15 +2808,12 @@ void uiItemMContents(uiLayout *layout, const char *menuname);
* Insert a decorator item for a button with the same property as \a prop.
* To force inserting a blank dummy element, NULL can be passed for \a ptr and \a prop.
*/
void uiItemDecoratorR_prop(uiLayout *layout,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
int index);
void uiItemDecoratorR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index);
/**
* Insert a decorator item for a button with the same property as \a prop.
* To force inserting a blank dummy element, NULL can be passed for \a ptr and \a propname.
*/
void uiItemDecoratorR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int index);
void uiItemDecoratorR(uiLayout *layout, PointerRNA *ptr, const char *propname, int index);
/** Value item */
void uiItemV(uiLayout *layout, const char *name, int icon, int argval);
/** Separator item */
@@ -2934,14 +2830,11 @@ void uiItemProgressIndicator(uiLayout *layout,
/* popover */
void uiItemPopoverPanel_ptr(
uiLayout *layout, const struct bContext *C, struct PanelType *pt, const char *name, int icon);
void uiItemPopoverPanel(uiLayout *layout,
const struct bContext *C,
const char *panel_type,
const char *name,
int icon);
uiLayout *layout, const bContext *C, PanelType *pt, const char *name, int icon);
void uiItemPopoverPanel(
uiLayout *layout, const bContext *C, const char *panel_type, const char *name, int icon);
void uiItemPopoverPanelFromGroup(uiLayout *layout,
struct bContext *C,
bContext *C,
int space_id,
int region_id,
const char *context,
@@ -2956,38 +2849,35 @@ void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc
*/
void uiItemMenuFN(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *argN);
void uiItemMenuEnumFullO_ptr(uiLayout *layout,
const struct bContext *C,
struct wmOperatorType *ot,
const bContext *C,
wmOperatorType *ot,
const char *propname,
const char *name,
int icon,
struct PointerRNA *r_opptr);
PointerRNA *r_opptr);
void uiItemMenuEnumFullO(uiLayout *layout,
const struct bContext *C,
const bContext *C,
const char *opname,
const char *propname,
const char *name,
int icon,
struct PointerRNA *r_opptr);
PointerRNA *r_opptr);
void uiItemMenuEnumO(uiLayout *layout,
const struct bContext *C,
const bContext *C,
const char *opname,
const char *propname,
const char *name,
int icon);
void uiItemMenuEnumR_prop(uiLayout *layout,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
const char *name,
int icon);
void uiItemMenuEnumR_prop(
uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, const char *name, int icon);
void uiItemMenuEnumR(
uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, int icon);
uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, int icon);
void uiItemTabsEnumR_prop(uiLayout *layout,
struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
struct PointerRNA *ptr_highlight,
struct PropertyRNA *prop_highlight,
bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
PointerRNA *ptr_highlight,
PropertyRNA *prop_highlight,
bool icon_only);
/* Only for testing, inspecting layouts. */
@@ -3003,53 +2893,53 @@ const char *UI_layout_introspect(uiLayout *layout);
uiLayout *uiItemsAlertBox(uiBlock *block, int size, eAlertIcon icon);
/* UI Operators */
typedef struct uiDragColorHandle {
struct uiDragColorHandle {
float color[3];
bool gamma_corrected;
} uiDragColorHandle;
};
void ED_operatortypes_ui(void);
void ED_operatortypes_ui();
/**
* \brief User Interface Keymap
*/
void ED_keymap_ui(struct wmKeyConfig *keyconf);
void ED_dropboxes_ui(void);
void ED_uilisttypes_ui(void);
void ED_keymap_ui(wmKeyConfig *keyconf);
void ED_dropboxes_ui();
void ED_uilisttypes_ui();
void UI_drop_color_copy(struct bContext *C, struct wmDrag *drag, struct wmDropBox *drop);
bool UI_drop_color_poll(struct bContext *C, struct wmDrag *drag, const struct wmEvent *event);
void UI_drop_color_copy(bContext *C, wmDrag *drag, wmDropBox *drop);
bool UI_drop_color_poll(bContext *C, wmDrag *drag, const wmEvent *event);
bool UI_context_copy_to_selected_list(struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
struct ListBase *r_lb,
bool UI_context_copy_to_selected_list(bContext *C,
PointerRNA *ptr,
PropertyRNA *prop,
ListBase *r_lb,
bool *r_use_path_from_id,
char **r_path);
bool UI_context_copy_to_selected_check(struct PointerRNA *ptr,
struct PointerRNA *ptr_link,
struct PropertyRNA *prop,
bool UI_context_copy_to_selected_check(PointerRNA *ptr,
PointerRNA *ptr_link,
PropertyRNA *prop,
const char *path,
bool use_path_from_id,
struct PointerRNA *r_ptr,
struct PropertyRNA **r_prop);
PointerRNA *r_ptr,
PropertyRNA **r_prop);
/* Helpers for Operators */
uiBut *UI_context_active_but_get(const struct bContext *C);
uiBut *UI_context_active_but_get(const bContext *C);
/**
* Version of #UI_context_active_get() that uses the result of #CTX_wm_menu()
* if set. Does not traverse into parent menus, which may be wanted in some
* cases.
*/
uiBut *UI_context_active_but_get_respect_menu(const struct bContext *C);
uiBut *UI_context_active_but_get_respect_menu(const bContext *C);
/**
* Version of #UI_context_active_but_get that also returns RNA property info.
* Helper function for insert keyframe, reset to default, etc operators.
*
* \return active button, NULL if none found or if it doesn't contain valid RNA data.
*/
uiBut *UI_context_active_but_prop_get(const struct bContext *C,
struct PointerRNA *r_ptr,
struct PropertyRNA **r_prop,
uiBut *UI_context_active_but_prop_get(const bContext *C,
PointerRNA *r_ptr,
PropertyRNA **r_prop,
int *r_index);
/**
@@ -3057,22 +2947,22 @@ uiBut *UI_context_active_but_prop_get(const struct bContext *C,
*
* \return active button, NULL if none found or if it doesn't contain valid RNA data.
*/
uiBut *UI_region_active_but_prop_get(const struct ARegion *region,
struct PointerRNA *r_ptr,
struct PropertyRNA **r_prop,
uiBut *UI_region_active_but_prop_get(const ARegion *region,
PointerRNA *r_ptr,
PropertyRNA **r_prop,
int *r_index);
void UI_context_active_but_prop_handle(struct bContext *C, bool handle_undo);
void UI_context_active_but_clear(struct bContext *C, struct wmWindow *win, struct ARegion *region);
void UI_context_active_but_prop_handle(bContext *C, bool handle_undo);
void UI_context_active_but_clear(bContext *C, wmWindow *win, ARegion *region);
struct wmOperator *UI_context_active_operator_get(const struct bContext *C);
wmOperator *UI_context_active_operator_get(const bContext *C);
/**
* Helper function for insert keyframe, reset to default, etc operators.
*/
void UI_context_update_anim_flag(const struct bContext *C);
void UI_context_active_but_prop_get_filebrowser(const struct bContext *C,
struct PointerRNA *r_ptr,
struct PropertyRNA **r_prop,
void UI_context_update_anim_flag(const bContext *C);
void UI_context_active_but_prop_get_filebrowser(const bContext *C,
PointerRNA *r_ptr,
PropertyRNA **r_prop,
bool *r_is_undo,
bool *r_is_userdef);
/**
@@ -3080,27 +2970,25 @@ void UI_context_active_but_prop_get_filebrowser(const struct bContext *C,
*
* This is for browsing and editing the ID-blocks used.
*/
void UI_context_active_but_prop_get_templateID(struct bContext *C,
struct PointerRNA *r_ptr,
struct PropertyRNA **r_prop);
struct ID *UI_context_active_but_get_tab_ID(struct bContext *C);
void UI_context_active_but_prop_get_templateID(bContext *C,
PointerRNA *r_ptr,
PropertyRNA **r_prop);
ID *UI_context_active_but_get_tab_ID(bContext *C);
uiBut *UI_region_active_but_get(const struct ARegion *region);
uiBut *UI_region_but_find_rect_over(const struct ARegion *region, const struct rcti *rect_px);
uiBlock *UI_region_block_find_mouse_over(const struct ARegion *region,
const int xy[2],
bool only_clip);
uiBut *UI_region_active_but_get(const ARegion *region);
uiBut *UI_region_but_find_rect_over(const ARegion *region, const rcti *rect_px);
uiBlock *UI_region_block_find_mouse_over(const ARegion *region, const int xy[2], bool only_clip);
/**
* Try to find a search-box region opened from a button in \a button_region.
*/
struct ARegion *UI_region_searchbox_region_get(const struct ARegion *button_region);
ARegion *UI_region_searchbox_region_get(const ARegion *button_region);
/** #uiFontStyle.align */
typedef enum eFontStyle_Align {
enum eFontStyle_Align {
UI_STYLE_TEXT_LEFT = 0,
UI_STYLE_TEXT_CENTER = 1,
UI_STYLE_TEXT_RIGHT = 2,
} eFontStyle_Align;
};
struct uiFontStyleDraw_Params {
eFontStyle_Align align;
@@ -3108,28 +2996,28 @@ struct uiFontStyleDraw_Params {
};
/* Styled text draw */
void UI_fontstyle_set(const struct uiFontStyle *fs);
void UI_fontstyle_draw_ex(const struct uiFontStyle *fs,
const struct rcti *rect,
void UI_fontstyle_set(const uiFontStyle *fs);
void UI_fontstyle_draw_ex(const uiFontStyle *fs,
const rcti *rect,
const char *str,
size_t str_len,
const uchar col[4],
const struct uiFontStyleDraw_Params *fs_params,
const uiFontStyleDraw_Params *fs_params,
int *r_xofs,
int *r_yofs,
struct ResultBLF *r_info);
ResultBLF *r_info);
void UI_fontstyle_draw(const struct uiFontStyle *fs,
const struct rcti *rect,
void UI_fontstyle_draw(const uiFontStyle *fs,
const rcti *rect,
const char *str,
size_t str_len,
const uchar col[4],
const struct uiFontStyleDraw_Params *fs_params);
const uiFontStyleDraw_Params *fs_params);
/**
* Drawn same as above, but at 90 degree angle.
*/
void UI_fontstyle_draw_rotated(const struct uiFontStyle *fs,
const struct rcti *rect,
void UI_fontstyle_draw_rotated(const uiFontStyle *fs,
const rcti *rect,
const char *str,
const uchar col[4]);
/**
@@ -3139,19 +3027,19 @@ void UI_fontstyle_draw_rotated(const struct uiFontStyle *fs,
* For drawing on-screen labels.
*/
void UI_fontstyle_draw_simple(
const struct uiFontStyle *fs, float x, float y, const char *str, const uchar col[4]);
const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4]);
/**
* Same as #UI_fontstyle_draw but draw a colored backdrop.
*/
void UI_fontstyle_draw_simple_backdrop(const struct uiFontStyle *fs,
void UI_fontstyle_draw_simple_backdrop(const uiFontStyle *fs,
float x,
float y,
const char *str,
const float col_fg[4],
const float col_bg[4]);
int UI_fontstyle_string_width(const struct uiFontStyle *fs,
const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2);
int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2);
/**
* Return the width of `str` with the spacing & kerning of `fs` with `aspect`
* (representing #uiBlock.aspect) applied.
@@ -3162,11 +3050,11 @@ int UI_fontstyle_string_width(const struct uiFontStyle *fs,
* Resolve this by calculating the text at the on-screen size,
* returning the result scaled back to 1:1. See #92361.
*/
int UI_fontstyle_string_width_with_block_aspect(const struct uiFontStyle *fs,
int UI_fontstyle_string_width_with_block_aspect(const uiFontStyle *fs,
const char *str,
float aspect) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2);
int UI_fontstyle_height_max(const struct uiFontStyle *fs);
int UI_fontstyle_height_max(const uiFontStyle *fs);
/**
* Triangle 'icon' for panel header and other cases.
@@ -3176,17 +3064,17 @@ void UI_draw_icon_tri(float x, float y, char dir, const float[4]);
/**
* Read a style (without any scaling applied).
*/
const struct uiStyle *UI_style_get(void); /* use for fonts etc */
const uiStyle *UI_style_get(); /* use for fonts etc */
/**
* Read a style (with the current DPI applied).
*/
const struct uiStyle *UI_style_get_dpi(void);
const uiStyle *UI_style_get_dpi();
/* linker workaround ack! */
void UI_template_fix_linking(void);
void UI_template_fix_linking();
/* UI_OT_editsource helpers */
bool UI_editsource_enable_check(void);
bool UI_editsource_enable_check();
void UI_editsource_active_but_test(uiBut *but);
/**
* Remove the editsource data for \a old_but and reinsert it for \a new_but. Use when the button
@@ -3204,11 +3092,11 @@ void UI_editsource_but_replace(const uiBut *old_but, uiBut *new_but);
* \param region: The region the button is placed in. Make sure this is actually the one the button
* is placed in, not just the context region.
*/
void UI_but_ensure_in_view(const struct bContext *C, struct ARegion *region, const uiBut *but);
void UI_but_ensure_in_view(const bContext *C, ARegion *region, const uiBut *but);
/* UI_butstore_ helpers */
typedef struct uiButStore uiButStore;
typedef struct uiButStoreElem uiButStoreElem;
struct uiButStore;
struct uiButStoreElem;
/**
* Create a new button store, the caller must manage and run #UI_butstore_free
@@ -3239,7 +3127,7 @@ void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p);
* for actions that can also be activated using shortcuts while the cursor is over the button.
* Without this those shortcuts aren't discoverable for users.
*/
const char *UI_key_event_operator_string(const struct bContext *C,
const char *UI_key_event_operator_string(const bContext *C,
const char *opname,
IDProperty *properties,
const bool is_strict,
@@ -3252,26 +3140,20 @@ const char *UI_key_event_operator_string(const struct bContext *C,
* \param is_label: When true, show a small tip that only shows the name, otherwise show the full
* tooltip.
*/
struct ARegion *UI_tooltip_create_from_button(struct bContext *C,
struct ARegion *butregion,
uiBut *but,
bool is_label);
struct ARegion *UI_tooltip_create_from_button_or_extra_icon(struct bContext *C,
struct ARegion *butregion,
uiBut *but,
uiButExtraOpIcon *extra_icon,
bool is_label);
struct ARegion *UI_tooltip_create_from_gizmo(struct bContext *C, struct wmGizmo *gz);
void UI_tooltip_free(struct bContext *C, struct bScreen *screen, struct ARegion *region);
ARegion *UI_tooltip_create_from_button(bContext *C, ARegion *butregion, uiBut *but, bool is_label);
ARegion *UI_tooltip_create_from_button_or_extra_icon(
bContext *C, ARegion *butregion, uiBut *but, uiButExtraOpIcon *extra_icon, bool is_label);
ARegion *UI_tooltip_create_from_gizmo(bContext *C, wmGizmo *gz);
void UI_tooltip_free(bContext *C, bScreen *screen, ARegion *region);
typedef struct {
struct uiSearchItemTooltipData {
/** A description for the item, e.g. what happens when selecting it. */
char description[UI_MAX_DRAW_STR];
/* The full name of the item, without prefixes or suffixes (e.g. hint with UI_SEP_CHARP). */
const char *name;
/** Additional info about the item (e.g. library name of a linked data-block). */
char hint[UI_MAX_DRAW_STR];
} uiSearchItemTooltipData;
};
/**
* Create a tooltip from search-item tooltip data \a item_tooltip data.
@@ -3280,10 +3162,10 @@ typedef struct {
* \param item_rect: Rectangle of the search item in search region space (#ui_searchbox_butrect())
* which is passed to the tooltip callback.
*/
struct ARegion *UI_tooltip_create_from_search_item_generic(
struct bContext *C,
const struct ARegion *searchbox_region,
const struct rcti *item_rect,
ARegion *UI_tooltip_create_from_search_item_generic(
bContext *C,
const ARegion *searchbox_region,
const rcti *item_rect,
const uiSearchItemTooltipData *item_tooltip_data);
/* How long before a tool-tip shows. */
@@ -3305,9 +3187,9 @@ struct ARegion *UI_tooltip_create_from_search_item_generic(
int UI_calc_float_precision(int prec, double value);
/* widget batched drawing */
void UI_widgetbase_draw_cache_begin(void);
void UI_widgetbase_draw_cache_flush(void);
void UI_widgetbase_draw_cache_end(void);
void UI_widgetbase_draw_cache_begin();
void UI_widgetbase_draw_cache_flush();
void UI_widgetbase_draw_cache_end();
/* Use for resetting the theme. */
/**
@@ -3316,10 +3198,10 @@ void UI_widgetbase_draw_cache_end(void);
* \note When you add new colors, created & saved themes need initialized
* use function below, #init_userdef_do_versions.
*/
void UI_theme_init_default(void);
void UI_style_init_default(void);
void UI_theme_init_default();
void UI_style_init_default();
void UI_interface_tag_script_reload(void);
void UI_interface_tag_script_reload();
/** Special drawing for toolbar, mainly workarounds for inflexible icon sizing. */
#define USE_UI_TOOLBAR_HACK
@@ -3332,7 +3214,7 @@ void UI_interface_tag_script_reload(void);
* Typically used to enable a filter text button. Triggered on Ctrl+F by default.
* \return True when filtering was enabled successfully.
*/
bool UI_view_begin_filtering(const struct bContext *C, const uiViewHandle *view_handle);
bool UI_view_begin_filtering(const bContext *C, const uiViewHandle *view_handle);
bool UI_view_item_is_interactive(const uiViewItemHandle *item_handle);
bool UI_view_item_is_active(const uiViewItemHandle *item_handle);
@@ -3345,7 +3227,7 @@ bool UI_view_item_matches(const uiViewItemHandle *a_handle, const uiViewItemHand
bool UI_view_item_can_rename(const uiViewItemHandle *item_handle);
void UI_view_item_begin_rename(uiViewItemHandle *item_handle);
void UI_view_item_context_menu_build(struct bContext *C,
void UI_view_item_context_menu_build(bContext *C,
const uiViewItemHandle *item_handle,
uiLayout *column);
@@ -3355,21 +3237,17 @@ bool UI_view_item_supports_drag(const uiViewItemHandle *item_);
* support dragging, i.e. if it won't create a drag-controller upon request.
* \return True if dragging started successfully, otherwise false.
*/
bool UI_view_item_drag_start(struct bContext *C, const uiViewItemHandle *item_);
bool UI_view_item_drag_start(bContext *C, const uiViewItemHandle *item_);
/**
* \param xy: Coordinate to find a view item at, in window space.
* \param pad: Extra padding added to the bounding box of the view.
*/
uiViewHandle *UI_region_view_find_at(const struct ARegion *region, const int xy[2], int pad);
uiViewHandle *UI_region_view_find_at(const ARegion *region, const int xy[2], int pad);
/**
* \param xy: Coordinate to find a view item at, in window space.
*/
uiViewItemHandle *UI_region_views_find_item_at(const struct ARegion *region, const int xy[2])
uiViewItemHandle *UI_region_views_find_item_at(const ARegion *region, const int xy[2])
ATTR_NONNULL();
uiViewItemHandle *UI_region_views_find_active_item(const struct ARegion *region);
uiBut *UI_region_views_find_active_item_but(const struct ARegion *region);
#ifdef __cplusplus
}
#endif
uiViewItemHandle *UI_region_views_find_active_item(const ARegion *region);
uiBut *UI_region_views_find_active_item_but(const ARegion *region);

View File

@@ -15,20 +15,21 @@
struct Collection;
struct ID;
struct ImBuf;
struct PointerRNA;
struct PreviewImage;
struct Scene;
struct bContext;
typedef struct IconFile {
struct IconFile *next, *prev;
struct IconFile {
IconFile *next, *prev;
char filename[256]; /* FILE_MAXFILE size */
int index;
} IconFile;
};
typedef struct IconTextOverlay {
struct IconTextOverlay {
char text[5];
} IconTextOverlay;
};
#define UI_NO_ICON_OVERLAY_TEXT NULL
@@ -42,26 +43,26 @@ typedef struct IconTextOverlay {
#define PREVIEW_DEFAULT_HEIGHT 128
typedef enum eAlertIcon {
enum eAlertIcon {
ALERT_ICON_WARNING = 0,
ALERT_ICON_QUESTION = 1,
ALERT_ICON_ERROR = 2,
ALERT_ICON_INFO = 3,
ALERT_ICON_BLENDER = 4,
ALERT_ICON_MAX,
} eAlertIcon;
};
struct ImBuf *UI_icon_alert_imbuf_get(eAlertIcon icon);
ImBuf *UI_icon_alert_imbuf_get(eAlertIcon icon);
/**
* Resizable Icons for Blender
*/
void UI_icons_init(void);
void UI_icons_init();
/**
* Reload the textures for internal icons.
* This function will release the previous textures.
*/
void UI_icons_reload_internal_textures(void);
void UI_icons_reload_internal_textures();
/**
* NOTE: returns unscaled by DPI.
@@ -75,21 +76,18 @@ bool UI_icon_get_theme_color(int icon_id, unsigned char color[4]);
*
* Note that if an ID doesn't support jobs for preview creation, \a use_job will be ignored.
*/
void UI_icon_render_id(const struct bContext *C,
struct Scene *scene,
struct ID *id,
enum eIconSizes size,
bool use_job);
void UI_icon_render_id(
const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job);
/**
* Render the data block into the provided #PreviewImage.
*/
void UI_icon_render_id_ex(const struct bContext *C,
struct Scene *scene,
struct ID *id_to_render,
void UI_icon_render_id_ex(const bContext *C,
Scene *scene,
ID *id_to_render,
const enum eIconSizes size,
const bool use_job,
struct PreviewImage *r_preview_image);
PreviewImage *r_preview_image);
/**
* Render size for preview images and icons
@@ -111,24 +109,24 @@ void UI_icon_draw_ex(float x,
float desaturate,
const uchar mono_color[4],
bool mono_border,
const struct IconTextOverlay *text_overlay);
const IconTextOverlay *text_overlay);
void UI_icons_free(void);
void UI_icons_free();
void UI_icons_free_drawinfo(void *drawinfo);
void UI_icon_draw_cache_begin(void);
void UI_icon_draw_cache_end(void);
void UI_icon_draw_cache_begin();
void UI_icon_draw_cache_end();
struct ListBase *UI_iconfile_list(void);
ListBase *UI_iconfile_list();
int UI_iconfile_get_index(const char *filename);
struct PreviewImage *UI_icon_to_preview(int icon_id);
PreviewImage *UI_icon_to_preview(int icon_id);
int UI_icon_from_rnaptr(const struct bContext *C, struct PointerRNA *ptr, int rnaicon, bool big);
int UI_icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, bool big);
int UI_icon_from_idcode(int idcode);
int UI_icon_from_library(const struct ID *id);
int UI_icon_from_library(const ID *id);
int UI_icon_from_object_mode(int mode);
int UI_icon_color_from_collection(const struct Collection *collection);
int UI_icon_color_from_collection(const Collection *collection);
void UI_icon_text_overlay_init_from_count(struct IconTextOverlay *text_overlay,
void UI_icon_text_overlay_init_from_count(IconTextOverlay *text_overlay,
const int icon_indicator_number);

View File

@@ -10,24 +10,26 @@
#include "BLI_sys_types.h"
struct bTheme;
/* Define icon enum. */
#define DEF_ICON(name) ICON_##name,
#define DEF_ICON_VECTOR(name) ICON_##name,
#define DEF_ICON_COLOR(name) ICON_##name,
#define DEF_ICON_BLANK(name) ICON_BLANK_##name,
typedef enum {
enum BIFIconID {
/* ui */
#include "UI_icons.hh"
BIFICONID_LAST,
} BIFIconID;
};
#define BIFICONID_FIRST (ICON_NONE)
/* use to denote intentionally unset theme color */
#define TH_UNDEFINED -1
typedef enum ThemeColorID {
enum ThemeColorID {
TH_REDALERT,
TH_THEMEUI,
@@ -339,14 +341,12 @@ typedef enum ThemeColorID {
TH_EDGE_BEVEL,
TH_VERTEX_BEVEL,
} ThemeColorID;
};
/* Specific defines per space should have higher define values. */
struct bTheme;
struct bThemeState {
struct bTheme *theme;
bTheme *theme;
int spacetype, regionid;
};
@@ -474,13 +474,13 @@ void UI_SetTheme(int spacetype, int regionid);
/**
* Get current theme.
*/
struct bTheme *UI_GetTheme(void);
bTheme *UI_GetTheme(void);
/**
* For the rare case we need to temp swap in a different theme (off-screen render).
*/
void UI_Theme_Store(struct bThemeState *theme_state);
void UI_Theme_Restore(struct bThemeState *theme_state);
void UI_Theme_Store(bThemeState *theme_state);
void UI_Theme_Restore(bThemeState *theme_state);
/**
* Return shadow width outside menus and popups.
@@ -490,6 +490,6 @@ int UI_ThemeMenuShadowWidth(void);
/**
* Only for buttons in theme editor!
*/
const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid);
void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3], char axis);

View File

@@ -137,21 +137,21 @@ struct wmOperatorType;
* this is called before #UI_view2d_size_update(),
* as this one checks that the rects are properly initialized.
*/
void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy);
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy);
void UI_view2d_curRect_validate(struct View2D *v2d);
void UI_view2d_curRect_validate(View2D *v2d);
/**
* Restore 'cur' rect to standard orientation (i.e. optimal maximum view of tot).
* This does not take into account if zooming the view on an axis
* will improve the view (if allowed).
*/
void UI_view2d_curRect_reset(struct View2D *v2d);
bool UI_view2d_area_supports_sync(struct ScrArea *area);
void UI_view2d_curRect_reset(View2D *v2d);
bool UI_view2d_area_supports_sync(ScrArea *area);
/**
* Called by menus to activate it, or by view2d operators
* to make sure 'related' views stay in synchrony.
*/
void UI_view2d_sync(struct bScreen *screen, struct ScrArea *area, struct View2D *v2dcur, int flag);
void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag);
/**
* Perform all required updates after `v2d->cur` as been modified.
@@ -159,19 +159,19 @@ void UI_view2d_sync(struct bScreen *screen, struct ScrArea *area, struct View2D
*
* Current intent is to use it from user code, such as view navigation and zoom operations.
*/
void UI_view2d_curRect_changed(const struct bContext *C, struct View2D *v2d);
void UI_view2d_curRect_changed(const bContext *C, View2D *v2d);
void UI_view2d_totRect_set(struct View2D *v2d, int width, int height);
void UI_view2d_totRect_set(View2D *v2d, int width, int height);
void UI_view2d_mask_from_win(const struct View2D *v2d, struct rcti *r_mask);
void UI_view2d_mask_from_win(const View2D *v2d, rcti *r_mask);
void UI_view2d_zoom_cache_reset(void);
void UI_view2d_zoom_cache_reset();
/**
* Clamp view2d area to what's visible, preventing
* scrolling vertically to infinity.
*/
void UI_view2d_curRect_clamp_y(struct View2D *v2d);
void UI_view2d_curRect_clamp_y(View2D *v2d);
/** \} */
@@ -182,18 +182,18 @@ void UI_view2d_curRect_clamp_y(struct View2D *v2d);
/**
* Set view matrices to use 'cur' rect as viewing frame for View2D drawing.
*/
void UI_view2d_view_ortho(const struct View2D *v2d);
void UI_view2d_view_ortho(const View2D *v2d);
/**
* Set view matrices to only use one axis of 'cur' only
*
* \param xaxis: if non-zero, only use cur x-axis,
* otherwise use cur-yaxis (mostly this will be used for x).
*/
void UI_view2d_view_orthoSpecial(struct ARegion *region, struct View2D *v2d, bool xaxis);
void UI_view2d_view_orthoSpecial(ARegion *region, View2D *v2d, bool xaxis);
/**
* Restore view matrices after drawing.
*/
void UI_view2d_view_restore(const struct bContext *C);
void UI_view2d_view_restore(const bContext *C);
/** \} */
@@ -205,7 +205,7 @@ void UI_view2d_view_restore(const struct bContext *C);
* Draw a multi-level grid in given 2d-region.
*/
void UI_view2d_multi_grid_draw(
const struct View2D *v2d, int colorid, float step, int level_size, int totlevels);
const View2D *v2d, int colorid, float step, int level_size, int totlevels);
/**
* Draw a multi-level grid of dots, with a dynamic number of levels based on the fading.
*
@@ -214,51 +214,51 @@ void UI_view2d_multi_grid_draw(
* a larger step size.
* \param grid_subdivisions: The maximum number of sub-levels drawn at once.
*/
void UI_view2d_dot_grid_draw(const struct View2D *v2d,
void UI_view2d_dot_grid_draw(const View2D *v2d,
int grid_color_id,
float min_step,
int grid_subdivisions);
void UI_view2d_draw_lines_y__values(const struct View2D *v2d);
void UI_view2d_draw_lines_x__values(const struct View2D *v2d);
void UI_view2d_draw_lines_x__discrete_values(const struct View2D *v2d, bool display_minor_lines);
void UI_view2d_draw_lines_x__discrete_time(const struct View2D *v2d,
const struct Scene *scene,
void UI_view2d_draw_lines_y__values(const View2D *v2d);
void UI_view2d_draw_lines_x__values(const View2D *v2d);
void UI_view2d_draw_lines_x__discrete_values(const View2D *v2d, bool display_minor_lines);
void UI_view2d_draw_lines_x__discrete_time(const View2D *v2d,
const Scene *scene,
bool display_minor_lines);
void UI_view2d_draw_lines_x__discrete_frames_or_seconds(const struct View2D *v2d,
const struct Scene *scene,
void UI_view2d_draw_lines_x__discrete_frames_or_seconds(const View2D *v2d,
const Scene *scene,
bool display_seconds,
bool display_minor_lines);
void UI_view2d_draw_lines_x__frames_or_seconds(const struct View2D *v2d,
const struct Scene *scene,
void UI_view2d_draw_lines_x__frames_or_seconds(const View2D *v2d,
const Scene *scene,
bool display_seconds);
float UI_view2d_grid_resolution_x__frames_or_seconds(const struct View2D *v2d,
const struct Scene *scene,
float UI_view2d_grid_resolution_x__frames_or_seconds(const View2D *v2d,
const Scene *scene,
bool display_seconds);
float UI_view2d_grid_resolution_y__values(const struct View2D *v2d);
float UI_view2d_grid_resolution_y__values(const View2D *v2d);
/**
* Scale indicator text drawing.
*/
void UI_view2d_draw_scale_y__values(const struct ARegion *region,
const struct View2D *v2d,
const struct rcti *rect,
void UI_view2d_draw_scale_y__values(const ARegion *region,
const View2D *v2d,
const rcti *rect,
int colorid);
void UI_view2d_draw_scale_y__block(const struct ARegion *region,
const struct View2D *v2d,
const struct rcti *rect,
void UI_view2d_draw_scale_y__block(const ARegion *region,
const View2D *v2d,
const rcti *rect,
int colorid);
void UI_view2d_draw_scale_x__discrete_frames_or_seconds(const struct ARegion *region,
const struct View2D *v2d,
const struct rcti *rect,
const struct Scene *scene,
void UI_view2d_draw_scale_x__discrete_frames_or_seconds(const ARegion *region,
const View2D *v2d,
const rcti *rect,
const Scene *scene,
bool display_seconds,
int colorid);
void UI_view2d_draw_scale_x__frames_or_seconds(const struct ARegion *region,
const struct View2D *v2d,
const struct rcti *rect,
const struct Scene *scene,
void UI_view2d_draw_scale_x__frames_or_seconds(const ARegion *region,
const View2D *v2d,
const rcti *rect,
const Scene *scene,
bool display_seconds,
int colorid);
@@ -271,10 +271,8 @@ void UI_view2d_draw_scale_x__frames_or_seconds(const struct ARegion *region,
/**
* Draw scroll-bars in the given 2D-region.
*/
void UI_view2d_scrollers_draw_ex(struct View2D *v2d,
const struct rcti *mask_custom,
bool use_full_hide);
void UI_view2d_scrollers_draw(struct View2D *v2d, const struct rcti *mask_custom);
void UI_view2d_scrollers_draw_ex(View2D *v2d, const rcti *mask_custom, bool use_full_hide);
void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom);
/** \} */
@@ -309,8 +307,8 @@ void UI_view2d_listview_view_to_cell(float columnwidth,
/** \name Coordinate Conversion
* \{ */
float UI_view2d_region_to_view_x(const struct View2D *v2d, float x);
float UI_view2d_region_to_view_y(const struct View2D *v2d, float y);
float UI_view2d_region_to_view_x(const View2D *v2d, float x);
float UI_view2d_region_to_view_y(const View2D *v2d, float y);
/**
* Convert from screen/region space to 2d-View space
*
@@ -318,13 +316,12 @@ float UI_view2d_region_to_view_y(const struct View2D *v2d, float y);
* \param r_view_x, r_view_y: resultant coordinates
*/
void UI_view2d_region_to_view(
const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL();
void UI_view2d_region_to_view_rctf(const struct View2D *v2d,
const struct rctf *rect_src,
struct rctf *rect_dst) ATTR_NONNULL();
const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL();
void UI_view2d_region_to_view_rctf(const View2D *v2d, const rctf *rect_src, rctf *rect_dst)
ATTR_NONNULL();
float UI_view2d_view_to_region_x(const struct View2D *v2d, float x);
float UI_view2d_view_to_region_y(const struct View2D *v2d, float y);
float UI_view2d_view_to_region_x(const View2D *v2d, float x);
float UI_view2d_view_to_region_y(const View2D *v2d, float y);
/**
* Convert from 2d-View space to screen/region space
* \note Coordinates are clamped to lie within bounds of region
@@ -333,7 +330,7 @@ float UI_view2d_view_to_region_y(const struct View2D *v2d, float y);
* \param r_region_x, r_region_y: Resultant coordinates.
*/
bool UI_view2d_view_to_region_clip(
const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL();
const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL();
bool UI_view2d_view_to_region_segment_clip(const View2D *v2d,
const float xy_a[2],
@@ -350,19 +347,14 @@ bool UI_view2d_view_to_region_segment_clip(const View2D *v2d,
* \param r_region_x, r_region_y: Resultant coordinates.
*/
void UI_view2d_view_to_region(
const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL();
void UI_view2d_view_to_region_fl(const struct View2D *v2d,
float x,
float y,
float *r_region_x,
float *r_region_y) ATTR_NONNULL();
void UI_view2d_view_to_region_m4(const struct View2D *v2d, float matrix[4][4]) ATTR_NONNULL();
void UI_view2d_view_to_region_rcti(const struct View2D *v2d,
const struct rctf *rect_src,
struct rcti *rect_dst) ATTR_NONNULL();
bool UI_view2d_view_to_region_rcti_clip(const struct View2D *v2d,
const struct rctf *rect_src,
struct rcti *rect_dst) ATTR_NONNULL();
const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL();
void UI_view2d_view_to_region_fl(
const View2D *v2d, float x, float y, float *r_region_x, float *r_region_y) ATTR_NONNULL();
void UI_view2d_view_to_region_m4(const View2D *v2d, float matrix[4][4]) ATTR_NONNULL();
void UI_view2d_view_to_region_rcti(const View2D *v2d, const rctf *rect_src, rcti *rect_dst)
ATTR_NONNULL();
bool UI_view2d_view_to_region_rcti_clip(const View2D *v2d, const rctf *rect_src, rcti *rect_dst)
ATTR_NONNULL();
/** \} */
@@ -373,11 +365,11 @@ bool UI_view2d_view_to_region_rcti_clip(const struct View2D *v2d,
/**
* View2D data by default resides in region, so get from region stored in context.
*/
struct View2D *UI_view2d_fromcontext(const struct bContext *C);
View2D *UI_view2d_fromcontext(const bContext *C);
/**
* Same as above, but it returns region-window. Utility for pull-downs or buttons.
*/
struct View2D *UI_view2d_fromcontext_rwin(const struct bContext *C);
View2D *UI_view2d_fromcontext_rwin(const bContext *C);
/**
* Get scroll-bar sizes of the current 2D view.
@@ -385,7 +377,7 @@ struct View2D *UI_view2d_fromcontext_rwin(const struct bContext *C);
*
* \param mapped: whether to use view2d_scroll_mapped which changes flags
*/
void UI_view2d_scroller_size_get(const struct View2D *v2d, bool mapped, float *r_x, float *r_y);
void UI_view2d_scroller_size_get(const View2D *v2d, bool mapped, float *r_x, float *r_y);
/**
* Calculate the scale per-axis of the drawing-area
*
@@ -394,20 +386,20 @@ void UI_view2d_scroller_size_get(const struct View2D *v2d, bool mapped, float *r
*
* \param r_x, r_y: scale on each axis
*/
void UI_view2d_scale_get(const struct View2D *v2d, float *r_x, float *r_y);
float UI_view2d_scale_get_x(const struct View2D *v2d);
float UI_view2d_scale_get_y(const struct View2D *v2d);
void UI_view2d_scale_get(const View2D *v2d, float *r_x, float *r_y);
float UI_view2d_scale_get_x(const View2D *v2d);
float UI_view2d_scale_get_y(const View2D *v2d);
/**
* Same as `UI_view2d_scale_get() - 1.0f / x, y`.
*/
void UI_view2d_scale_get_inverse(const struct View2D *v2d, float *r_x, float *r_y);
void UI_view2d_scale_get_inverse(const View2D *v2d, float *r_x, float *r_y);
/**
* Simple functions for consistent center offset access.
* Used by node editor to shift view center for each individual node tree.
*/
void UI_view2d_center_get(const struct View2D *v2d, float *r_x, float *r_y);
void UI_view2d_center_set(struct View2D *v2d, float x, float y);
void UI_view2d_center_get(const View2D *v2d, float *r_x, float *r_y);
void UI_view2d_center_set(View2D *v2d, float x, float y);
/**
* Simple pan function
@@ -415,12 +407,12 @@ void UI_view2d_center_set(struct View2D *v2d, float x, float y);
* (0.5, 0.5) center
* (1.0, 1.0) top right.
*/
void UI_view2d_offset(struct View2D *v2d, float xfac, float yfac);
void UI_view2d_offset(View2D *v2d, float xfac, float yfac);
/**
* Scrolls the view so that the upper edge is at a multiple of the page size.
*/
void UI_view2d_offset_y_snap_to_closest_page(struct View2D *v2d);
void UI_view2d_offset_y_snap_to_closest_page(View2D *v2d);
/**
* Check if mouse is within scrollers
@@ -433,39 +425,33 @@ void UI_view2d_offset_y_snap_to_closest_page(struct View2D *v2d);
* - 'v' = in vertical scroller.
* - 0 = not in scroller.
*/
char UI_view2d_mouse_in_scrollers_ex(const struct ARegion *region,
const struct View2D *v2d,
char UI_view2d_mouse_in_scrollers_ex(const ARegion *region,
const View2D *v2d,
const int xy[2],
int *r_scroll) ATTR_NONNULL(1, 2, 3, 4);
char UI_view2d_mouse_in_scrollers(const struct ARegion *region,
const struct View2D *v2d,
const int xy[2]) ATTR_NONNULL(1, 2, 3);
char UI_view2d_rect_in_scrollers_ex(const struct ARegion *region,
const struct View2D *v2d,
const struct rcti *rect,
char UI_view2d_mouse_in_scrollers(const ARegion *region, const View2D *v2d, const int xy[2])
ATTR_NONNULL(1, 2, 3);
char UI_view2d_rect_in_scrollers_ex(const ARegion *region,
const View2D *v2d,
const rcti *rect,
int *r_scroll) ATTR_NONNULL(1, 2, 3);
char UI_view2d_rect_in_scrollers(const struct ARegion *region,
const struct View2D *v2d,
const struct rcti *rect) ATTR_NONNULL(1, 2, 3);
char UI_view2d_rect_in_scrollers(const ARegion *region, const View2D *v2d, const rcti *rect)
ATTR_NONNULL(1, 2, 3);
/**
* Cached text drawing in v2d, to allow pixel-aligned draw as post process.
*/
void UI_view2d_text_cache_add(struct View2D *v2d,
float x,
float y,
const char *str,
size_t str_len,
const unsigned char col[4]);
void UI_view2d_text_cache_add(
View2D *v2d, float x, float y, const char *str, size_t str_len, const unsigned char col[4]);
/**
* No clip (yet).
*/
void UI_view2d_text_cache_add_rectf(struct View2D *v2d,
const struct rctf *rect_view,
void UI_view2d_text_cache_add_rectf(View2D *v2d,
const rctf *rect_view,
const char *str,
size_t str_len,
const unsigned char col[4]);
void UI_view2d_text_cache_draw(struct ARegion *region);
void UI_view2d_text_cache_draw(ARegion *region);
/** \} */
@@ -473,17 +459,14 @@ void UI_view2d_text_cache_draw(struct ARegion *region);
/** \name Operators
* \{ */
void ED_operatortypes_view2d(void);
void ED_keymap_view2d(struct wmKeyConfig *keyconf);
void ED_operatortypes_view2d();
void ED_keymap_view2d(wmKeyConfig *keyconf);
/**
* Will start timer if appropriate.
* the arguments are the desired situation.
*/
void UI_view2d_smooth_view(const struct bContext *C,
struct ARegion *region,
const struct rctf *cur,
int smooth_viewtx);
void UI_view2d_smooth_view(const bContext *C, ARegion *region, const rctf *cur, int smooth_viewtx);
#define UI_MARKER_MARGIN_Y (42 * UI_SCALE_FAC)
#define UI_TIME_SCRUB_MARGIN_Y (23 * UI_SCALE_FAC)
@@ -499,7 +482,7 @@ void UI_view2d_smooth_view(const struct bContext *C,
/**
* Caller defines the name for gizmo group.
*/
void VIEW2D_GGT_navigate_impl(struct wmGizmoGroupType *gzgt, const char *idname);
void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname);
/** \} */
@@ -510,7 +493,7 @@ void VIEW2D_GGT_navigate_impl(struct wmGizmoGroupType *gzgt, const char *idname)
/**
* Custom-data for view panning operators.
*/
typedef struct View2DEdgePanData {
struct View2DEdgePanData {
/** Screen where view pan was initiated. */
struct bScreen *screen;
/** Area where view pan was initiated. */
@@ -554,10 +537,10 @@ typedef struct View2DEdgePanData {
/* Timers. */
double edge_pan_last_time;
double edge_pan_start_time_x, edge_pan_start_time_y;
} View2DEdgePanData;
};
void UI_view2d_edge_pan_init(struct bContext *C,
struct View2DEdgePanData *vpd,
void UI_view2d_edge_pan_init(bContext *C,
View2DEdgePanData *vpd,
float inside_pad,
float outside_pad,
float speed_ramp,
@@ -569,28 +552,26 @@ void UI_view2d_edge_pan_init(struct bContext *C,
* Set area which can be panned
*/
void UI_view2d_edge_pan_set_limits(
struct View2DEdgePanData *vpd, float xmin, float xmax, float ymin, float ymax);
View2DEdgePanData *vpd, float xmin, float xmax, float ymin, float ymax);
void UI_view2d_edge_pan_reset(struct View2DEdgePanData *vpd);
void UI_view2d_edge_pan_reset(View2DEdgePanData *vpd);
/**
* Apply transform to view (i.e. adjust 'cur' rect).
*/
void UI_view2d_edge_pan_apply(struct bContext *C, struct View2DEdgePanData *vpd, const int xy[2])
void UI_view2d_edge_pan_apply(bContext *C, View2DEdgePanData *vpd, const int xy[2])
ATTR_NONNULL(1, 2, 3);
/**
* Apply transform to view using mouse events.
*/
void UI_view2d_edge_pan_apply_event(struct bContext *C,
struct View2DEdgePanData *vpd,
const struct wmEvent *event);
void UI_view2d_edge_pan_apply_event(bContext *C, View2DEdgePanData *vpd, const wmEvent *event);
void UI_view2d_edge_pan_cancel(struct bContext *C, struct View2DEdgePanData *vpd);
void UI_view2d_edge_pan_cancel(bContext *C, View2DEdgePanData *vpd);
void UI_view2d_edge_pan_operator_properties(struct wmOperatorType *ot);
void UI_view2d_edge_pan_operator_properties(wmOperatorType *ot);
void UI_view2d_edge_pan_operator_properties_ex(struct wmOperatorType *ot,
void UI_view2d_edge_pan_operator_properties_ex(wmOperatorType *ot,
float inside_pad,
float outside_pad,
float speed_ramp,
@@ -601,8 +582,6 @@ void UI_view2d_edge_pan_operator_properties_ex(struct wmOperatorType *ot,
/**
* Initialize panning data with operator settings.
*/
void UI_view2d_edge_pan_operator_init(struct bContext *C,
struct View2DEdgePanData *vpd,
struct wmOperator *op);
void UI_view2d_edge_pan_operator_init(bContext *C, View2DEdgePanData *vpd, wmOperator *op);
/** \} */

View File

@@ -27,7 +27,6 @@
#include "BKE_node_tree_update.h"
#include "BKE_workspace.h"
#include "ED_node.hh" /* own include */
#include "ED_node.hh" /* own include */
#include "ED_screen.hh"
#include "ED_select_utils.hh"