diff options
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 11 | ||||
-rw-r--r-- | source/blender/editors/include/ED_armature.h | 14 | ||||
-rw-r--r-- | source/blender/editors/include/ED_manipulator_library.h | 46 | ||||
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 25 | ||||
-rw-r--r-- | source/blender/editors/include/ED_object.h | 4 | ||||
-rw-r--r-- | source/blender/editors/include/ED_particle.h | 8 | ||||
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_transform.h | 15 | ||||
-rw-r--r-- | source/blender/editors/include/ED_transform_snap_object_context.h | 9 | ||||
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 51 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 12 | ||||
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 7 | ||||
-rw-r--r-- | source/blender/editors/include/UI_view2d.h | 1 |
13 files changed, 137 insertions, 68 deletions
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index a65c6eec6ae..797262c685b 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -125,6 +125,15 @@ typedef struct bAnimListElem { void *key_data; /* motion data - mostly F-Curves, but can be other types too */ + /* NOTE: id here is the "IdAdtTemplate"-style datablock (e.g. Object, Material, Texture, NodeTree) + * from which evaluation of the RNA-paths takes place. It's used to figure out how deep + * channels should be nested (e.g. for Textures/NodeTrees) in the tree, and allows property + * lookups (e.g. for sliders and for inserting keyframes) to work. If we had instead used + * bAction or something similar, none of this would be possible: although it's trivial + * to use an IdAdtTemplate type to find the source action a channel (e.g. F-Curve) comes from + * (i.e. in the AnimEditors, it *must* be the active action, as only that can be edited), + * it's impossible to go the other way (i.e. one action may be used in multiple places). + */ struct ID *id; /* ID block that channel is attached to */ struct AnimData *adt; /* source of the animation data attached to ID block (for convenience) */ @@ -257,7 +266,7 @@ typedef enum eAnimFilter_Flags { ANIMFILTER_TMP_PEEK = (1 << 30), /* ignore ONLYSEL flag from filterflag, (internal use only!) */ - ANIMFILTER_TMP_IGNORE_ONLYSEL = (1 << 31) + ANIMFILTER_TMP_IGNORE_ONLYSEL = (1u << 31) } eAnimFilter_Flags; /* ---------- Flag Checking Macros ------------ */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 7866bed8666..d65ea8e79f0 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -39,6 +39,7 @@ struct BaseLegacy; struct bContext; struct Bone; struct bPoseChannel; +struct EvaluationContext; struct IDProperty; struct ListBase; struct MeshDeformModifierData; @@ -166,16 +167,17 @@ void ED_armature_ebone_from_mat4(EditBone *ebone, float mat[4][4]); void transform_armature_mirror_update(struct Object *obedit); void ED_armature_origin_set(struct Scene *scene, struct Object *ob, float cursor[3], int centermode, int around); -void ED_armature_transform_bones(struct bArmature *arm, float mat[4][4]); -void ED_armature_apply_transform(struct Object *ob, float mat[4][4]); -void ED_armature_transform(struct bArmature *arm, float mat[4][4]); +void ED_armature_transform_bones(struct bArmature *arm, float mat[4][4], const bool do_props); +void ED_armature_apply_transform(struct Object *ob, float mat[4][4], const bool do_props); +void ED_armature_transform(struct bArmature *arm, float mat[4][4], const bool do_props); #define ARM_GROUPS_NAME 1 #define ARM_GROUPS_ENVELOPE 2 #define ARM_GROUPS_AUTO 3 -void create_vgroups_from_armature(struct ReportList *reports, struct Scene *scene, struct Object *ob, - struct Object *par, const int mode, const bool mirror); +void create_vgroups_from_armature( + struct ReportList *reports, const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct Object *ob, struct Object *par, const int mode, const bool mirror); /* if bone is already in list, pass it as param to ignore it */ void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); @@ -196,7 +198,7 @@ void ED_armature_exit_posemode(struct bContext *C, struct Base *base); void ED_armature_enter_posemode(struct bContext *C, struct Base *base); void ED_pose_de_selectall(struct Object *ob, int select_mode, const bool ignore_visibility); void ED_pose_bone_select(struct Object *ob, struct bPoseChannel *pchan, bool select); -void ED_pose_recalculate_paths(struct Scene *scene, struct Object *ob); +void ED_pose_recalculate_paths(struct bContext *C, struct Scene *scene, struct Object *ob); struct Object *ED_pose_object_from_context(struct bContext *C); /* sketch */ diff --git a/source/blender/editors/include/ED_manipulator_library.h b/source/blender/editors/include/ED_manipulator_library.h index b1970a7bab3..14e28e18ced 100644 --- a/source/blender/editors/include/ED_manipulator_library.h +++ b/source/blender/editors/include/ED_manipulator_library.h @@ -57,7 +57,8 @@ void ED_manipulator_draw_preset_arrow( void ED_manipulator_draw_preset_circle( const struct wmManipulator *mpr, float mat[4][4], int axis, int select_id); void ED_manipulator_draw_preset_facemap( - const struct wmManipulator *mpr, struct Scene *scene, struct Object *ob, const int facemap, int select_id); + const struct bContext *C, const struct wmManipulator *mpr, struct Scene *scene, + struct Object *ob, const int facemap, int select_id); /* -------------------------------------------------------------------- */ @@ -89,10 +90,40 @@ void ED_manipulator_arrow3d_set_range_fac(struct wmManipulator *mpr, const float /* Cage Manipulator */ enum { - ED_MANIPULATOR_RECT_TRANSFORM_FLAG_TRANSLATE = (1 << 0), /* Manipulator translates */ - ED_MANIPULATOR_RECT_TRANSFORM_FLAG_ROTATE = (1 << 1), /* Manipulator rotates */ - ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE = (1 << 2), /* Manipulator scales */ - ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE_UNIFORM = (1 << 3), /* Manipulator scales uniformly */ + ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE = (1 << 0), /* Translates */ + ED_MANIPULATOR_CAGE2D_XFORM_FLAG_ROTATE = (1 << 1), /* Rotates */ + ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE = (1 << 2), /* Scales */ + ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_UNIFORM = (1 << 3), /* Scales uniformly */ + ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_SIGNED = (1 << 4), /* Negative scale allowed */ +}; + +/* draw_style */ +enum { + ED_MANIPULATOR_CAGE2D_STYLE_BOX = 0, + ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE = 1, +}; + +/* draw_options */ +enum { + /** Draw a central handle (instead of having the entire area selectable) + * Needed for large rectangles that we don't want to swallow all events. */ + ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE = (1 << 0), +}; + +/** #wmManipulator.highlight_part */ +enum { + ED_MANIPULATOR_CAGE2D_PART_TRANSLATE = 0, + ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X = 1, + ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X = 2, + ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_Y = 3, + ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_Y = 4, + /* Corners */ + ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MIN_Y = 5, + ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MAX_Y = 6, + ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MIN_Y = 7, + ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MAX_Y = 8, + + ED_MANIPULATOR_CAGE2D_PART_ROTATE = 9, }; /* -------------------------------------------------------------------- */ @@ -113,11 +144,14 @@ enum { /* draw_options */ enum { ED_MANIPULATOR_GRAB_DRAW_FLAG_NOP = 0, + /* only for solid shapes */ ED_MANIPULATOR_GRAB_DRAW_FLAG_FILL = (1 << 0), + ED_MANIPULATOR_GRAB_DRAW_FLAG_ALIGN_VIEW = (1 << 1), }; enum { - ED_MANIPULATOR_GRAB_STYLE_RING = 0, + ED_MANIPULATOR_GRAB_STYLE_RING_2D = 0, + ED_MANIPULATOR_GRAB_STYLE_CROSS_2D = 1, }; diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 0ee60471357..1703ec6194f 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -36,6 +36,7 @@ extern "C" { #endif struct ID; +struct EvaluationContext; struct View3D; struct ARegion; struct bContext; @@ -134,35 +135,36 @@ void EDBM_select_mirrored( int *r_totmirr, int *r_totfail); void EDBM_automerge(struct Scene *scene, struct Object *ob, bool update, const char hflag); -bool EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); +bool EDBM_backbuf_border_init(const struct EvaluationContext *eval_ctx, struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); bool EDBM_backbuf_check(unsigned int index); void EDBM_backbuf_free(void); -bool EDBM_backbuf_border_mask_init(struct ViewContext *vc, const int mcords[][2], short tot, - short xmin, short ymin, short xmax, short ymax); -bool EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads); +bool EDBM_backbuf_border_mask_init( + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, const int mcords[][2], short tot, + short xmin, short ymin, short xmax, short ymax); +bool EDBM_backbuf_circle_init(const struct EvaluationContext *eval_ctx, struct ViewContext *vc, short xs, short ys, short rads); struct BMVert *EDBM_vert_find_nearest_ex( - struct ViewContext *vc, float *r_dist, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, float *r_dist, const bool use_select_bias, bool use_cycle); struct BMVert *EDBM_vert_find_nearest( - struct ViewContext *vc, float *r_dist); + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, float *r_dist); struct BMEdge *EDBM_edge_find_nearest_ex( - struct ViewContext *vc, float *r_dist, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, float *r_dist, float *r_dist_center, const bool use_select_bias, const bool use_cycle, struct BMEdge **r_eed_zbuf); struct BMEdge *EDBM_edge_find_nearest( - struct ViewContext *vc, float *r_dist); + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, float *r_dist); struct BMFace *EDBM_face_find_nearest_ex( - struct ViewContext *vc, float *r_dist, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, float *r_dist, float *r_dist_center, const bool use_select_bias, const bool use_cycle, struct BMFace **r_efa_zbuf); struct BMFace *EDBM_face_find_nearest( - struct ViewContext *vc, float *r_dist); + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, float *r_dist); bool EDBM_select_pick(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); @@ -199,7 +201,7 @@ void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEd /* editface.c */ void paintface_flush_flags(struct Object *ob, short flag); bool paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], bool extend, bool deselect, bool toggle); -int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, bool select, bool extend); +int do_paintface_box_select(const struct EvaluationContext *eval_ctx, struct ViewContext *vc, struct rcti *rect, bool select, bool extend); void paintface_deselect_all_visible(struct Object *ob, int action, bool flush_flags); void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], const bool select); bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]); @@ -281,6 +283,7 @@ bool ED_mesh_uv_texture_remove_active(struct Mesh *me); bool ED_mesh_uv_texture_remove_named(struct Mesh *me, const char *name); void ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me); void ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum); +bool ED_mesh_color_ensure(struct Mesh *me, const char *name); int ED_mesh_color_add(struct Mesh *me, const char *name, const bool active_set); bool ED_mesh_color_remove_index(struct Mesh *me, const int n); bool ED_mesh_color_remove_active(struct Mesh *me); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 9e5d55dd031..56a91d9846c 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -88,7 +88,7 @@ extern struct EnumPropertyItem prop_clear_parent_types[]; extern struct EnumPropertyItem prop_make_parent_types[]; #endif -bool ED_object_parent_set(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, +bool ED_object_parent_set(struct ReportList *reports, const struct bContext *C, struct Scene *scene, struct Object *ob, struct Object *par, int partype, const bool xmirror, const bool keep_transform, const int vert_par[3]); void ED_object_parent_clear(struct Object *ob, const int type); @@ -200,7 +200,7 @@ int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md); int ED_object_modifier_convert(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct SceneLayer *sl, struct Object *ob, struct ModifierData *md); -int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene, +int ED_object_modifier_apply(struct ReportList *reports, const struct bContext *C, struct Scene *scene, struct Object *ob, struct ModifierData *md, int mode); int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md); diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index 41c746aa421..f8bd8a22897 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -46,14 +46,16 @@ int PE_start_edit(struct PTCacheEdit *edit); /* access */ struct PTCacheEdit *PE_get_current(struct Scene *scene, struct SceneLayer *sl, struct Object *ob); -struct PTCacheEdit *PE_create_current(struct Scene *scene, struct Object *ob); -void PE_current_changed(struct Scene *scene, struct Object *ob); +struct PTCacheEdit *PE_create_current(const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob); +void PE_current_changed(const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob); int PE_minmax(struct Scene *scene, struct SceneLayer *sl, float min[3], float max[3]); struct ParticleEditSettings *PE_settings(struct Scene *scene); /* update calls */ void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra); -void PE_update_object(struct Scene *scene, struct SceneLayer *sl, struct Object *ob, int useflag); +void PE_update_object( + const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct SceneLayer *sl, struct Object *ob, int useflag); /* selection tools */ int PE_mouse_particles(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 524ee01c30f..7ebf0e921ac 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -140,7 +140,7 @@ struct WorkSpace *ED_workspace_duplicate( bool ED_workspace_delete( struct WorkSpace *workspace, struct Main *bmain, struct bContext *C, - struct wmWindowManager *wm, struct wmWindow *win) ATTR_NONNULL(); + struct wmWindowManager *wm) ATTR_NONNULL(); void ED_workspace_scene_data_sync( struct WorkSpaceInstanceHook *hook, Scene *scene) ATTR_NONNULL(); void ED_workspace_render_layer_unset( diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 483caf7c475..c6702ae3eaf 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -151,7 +151,8 @@ int BIF_countTransformOrientation(const struct bContext *C); #define P_CORRECT_UV (1 << 8) #define P_NO_DEFAULTS (1 << 10) #define P_NO_TEXSPACE (1 << 11) -#define P_GPENCIL_EDIT (1 << 12) +#define P_CENTER (1 << 12) +#define P_GPENCIL_EDIT (1 << 13) void Transform_Properties(struct wmOperatorType *ot, int flags); @@ -167,12 +168,6 @@ void ED_widgetgroup_manipulator2d_draw_prepare(const struct bContext *C, struct /* Snapping */ -typedef enum SnapSelect { - SNAP_ALL = 0, - SNAP_NOT_SELECTED = 1, - SNAP_NOT_ACTIVE = 2, -} SnapSelect; - #define SNAP_MIN_DISTANCE 30 bool peelObjectsTransform( @@ -195,11 +190,7 @@ bool snapObjectsTransform( /* return args */ float r_loc[3], float r_no[3]); bool snapNodesTransform( - struct TransInfo *t, const int mval[2], SnapSelect snap_select, - /* return args */ - float r_loc[2], float *r_dist_px, char *r_node_border); -bool snapNodesContext( - struct bContext *C, const int mval[2], SnapSelect snap_select, + struct TransInfo *t, const int mval[2], /* return args */ float r_loc[2], float *r_dist_px, char *r_node_border); diff --git a/source/blender/editors/include/ED_transform_snap_object_context.h b/source/blender/editors/include/ED_transform_snap_object_context.h index 010f7929e90..b802694444b 100644 --- a/source/blender/editors/include/ED_transform_snap_object_context.h +++ b/source/blender/editors/include/ED_transform_snap_object_context.h @@ -36,11 +36,18 @@ struct Main; struct Object; struct ARegion; struct View3D; +struct bContext; /* transform_snap_object.c */ /* ED_transform_snap_object_*** API */ +typedef enum SnapSelect { + SNAP_ALL = 0, + SNAP_NOT_SELECTED = 1, + SNAP_NOT_ACTIVE = 2, +} SnapSelect; + /** used for storing multiple hits */ struct SnapObjectHitDepth { struct SnapObjectHitDepth *next, *prev; @@ -85,7 +92,6 @@ void ED_transform_snap_object_context_set_editmesh_callbacks( bool ED_transform_snap_object_project_ray_ex( struct SnapObjectContext *sctx, - const unsigned short snap_to, const struct SnapObjectParams *params, const float ray_start[3], const float ray_normal[3], float *ray_depth, /* return args */ @@ -99,7 +105,6 @@ bool ED_transform_snap_object_project_ray( bool ED_transform_snap_object_project_ray_all( SnapObjectContext *sctx, - const unsigned short snap_to, const struct SnapObjectParams *params, const float ray_start[3], const float ray_normal[3], float ray_depth, bool sort, diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 69d27e30b1f..0dcfd68c0f1 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -42,6 +42,7 @@ struct BezTriple; struct BoundBox; struct Depsgraph; struct EditBone; +struct EvaluationContext; struct ImBuf; struct MVert; struct Main; @@ -109,7 +110,14 @@ void ED_view3d_lastview_store(struct RegionView3D *rv3d); /* Depth buffer */ void ED_view3d_depth_update(struct ARegion *ar); -float ED_view3d_depth_read_cached(const struct ViewContext *vc, int x, int y); +float ED_view3d_depth_read_cached(const struct ViewContext *vc, const int mval[2]); +bool ED_view3d_depth_read_cached_normal( + const ViewContext *vc, const int mval[2], + float r_normal[3]); +bool ED_view3d_depth_unproject( + const struct ARegion *ar, + const int mval[2], const double depth, + float r_location_world[3]); void ED_view3d_depth_tag_update(struct RegionView3D *rv3d); /* Projection */ @@ -144,20 +152,20 @@ typedef enum { /* foreach iterators */ void meshobject_foreachScreenVert( - struct ViewContext *vc, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, void (*func)(void *userData, struct MVert *eve, const float screen_co[2], int index), void *userData, const eV3DProjTest clip_flag); void mesh_foreachScreenVert( - struct ViewContext *vc, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, void (*func)(void *userData, struct BMVert *eve, const float screen_co[2], int index), void *userData, const eV3DProjTest clip_flag); void mesh_foreachScreenEdge( - struct ViewContext *vc, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, void (*func)(void *userData, struct BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *userData, const eV3DProjTest clip_flag); void mesh_foreachScreenFace( - struct ViewContext *vc, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, void (*func)(void *userData, struct BMFace *efa, const float screen_co[2], int index), void *userData, const eV3DProjTest clip_flag); void nurbs_foreachScreenVert( @@ -287,21 +295,23 @@ float ED_view3d_radius_to_dist( void imm_drawcircball(const float cent[3], float rad, const float tmat[4][4], unsigned pos); /* backbuffer select and draw support */ -void ED_view3d_backbuf_validate(struct ViewContext *vc); -struct ImBuf *ED_view3d_backbuf_read(struct ViewContext *vc, int xmin, int ymin, int xmax, int ymax); +void ED_view3d_backbuf_validate(const struct EvaluationContext *eval_ctx, struct ViewContext *vc); +struct ImBuf *ED_view3d_backbuf_read( + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, int xmin, int ymin, int xmax, int ymax); unsigned int ED_view3d_backbuf_sample_rect( - struct ViewContext *vc, const int mval[2], int size, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, const int mval[2], int size, unsigned int min, unsigned int max, float *r_dist); int ED_view3d_backbuf_sample_size_clamp(struct ARegion *ar, const float dist); -unsigned int ED_view3d_backbuf_sample(struct ViewContext *vc, int x, int y); +unsigned int ED_view3d_backbuf_sample( + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, int x, int y); bool ED_view3d_autodist( - struct Depsgraph *graph, struct ARegion *ar, struct View3D *v3d, + const struct EvaluationContext *eval_ctx, struct Depsgraph *graph, struct ARegion *ar, struct View3D *v3d, const int mval[2], float mouse_worldloc[3], const bool alphaoverride, const float fallback_depth_pt[3]); /* only draw so ED_view3d_autodist_simple can be called many times after */ -void ED_view3d_autodist_init(struct Depsgraph *graph, struct ARegion *ar, struct View3D *v3d, int mode); +void ED_view3d_autodist_init(const struct EvaluationContext *eval_ctx, struct Depsgraph *graph, struct ARegion *ar, struct View3D *v3d, int mode); bool ED_view3d_autodist_simple(struct ARegion *ar, const int mval[2], float mouse_worldloc[3], int margin, float *force_depth); bool ED_view3d_autodist_depth(struct ARegion *ar, const int mval[2], int margin, float *depth); bool ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], const int mval_end[2], int margin, float *depth); @@ -323,7 +333,7 @@ void view3d_opengl_select_cache_begin(void); void view3d_opengl_select_cache_end(void); int view3d_opengl_select( - struct ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const struct rcti *input, + const struct EvaluationContext *eval_ctx, struct ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const struct rcti *input, eV3DSelectMode select_mode); /* view3d_select.c */ @@ -355,26 +365,27 @@ int ED_view3d_scene_layer_set(int lay, const int *values, int *active); struct RV3DMatrixStore *ED_view3d_mats_rv3d_backup(struct RegionView3D *rv3d); void ED_view3d_mats_rv3d_restore(struct RegionView3D *rv3d, struct RV3DMatrixStore *rv3dmat); -void ED_draw_object_facemap(struct Scene *scene, struct Object *ob, const float col[4], const int facemap); +void ED_draw_object_facemap(const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob, const float col[4], const int facemap); bool ED_view3d_context_activate(struct bContext *C); -void ED_view3d_draw_offscreen_init(struct Scene *scene, struct SceneLayer *sl, struct View3D *v3d); +void ED_view3d_draw_offscreen_init( + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct SceneLayer *sl, struct View3D *v3d); void ED_view3d_draw_offscreen( - struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int winx, int winy, float viewmat[4][4], + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct SceneLayer *sl, struct View3D *v3d, struct ARegion *ar, int winx, int winy, float viewmat[4][4], float winmat[4][4], bool do_bgpic, bool do_sky, bool is_persp, const char *viewname, struct GPUFX *fx, struct GPUFXSettings *fx_settings, struct GPUOffScreen *ofs); void ED_view3d_draw_setup_view( - struct wmWindow *win, struct Scene *scene, struct ARegion *ar, struct View3D *v3d, + struct wmWindow *win, const struct EvaluationContext *eval_ctx, struct Scene *scene, struct ARegion *ar, struct View3D *v3d, float viewmat[4][4], float winmat[4][4], const struct rcti *rect); struct ImBuf *ED_view3d_draw_offscreen_imbuf( - struct Scene *scene, struct SceneLayer *sl, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, - unsigned int flag, bool draw_background, + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct SceneLayer *sl, struct View3D *v3d, struct ARegion *ar, + int sizex, int sizey, unsigned int flag, bool draw_background, int alpha_mode, int samples, bool full_samples, const char *viewname, struct GPUFX *fx, struct GPUOffScreen *ofs, char err_out[256]); struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple( - struct Scene *scene, struct SceneLayer *sl, struct Object *camera, int width, int height, + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct SceneLayer *sl, struct Object *camera, int width, int height, unsigned int flag, int drawtype, bool use_solid_tex, bool use_gpencil, bool draw_background, int alpha_mode, int samples, bool full_samples, const char *viewname, struct GPUFX *fx, struct GPUOffScreen *ofs, char err_out[256]); @@ -382,7 +393,7 @@ struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple( struct BaseLegacy *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]); void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, bool do_clip); void ED_view3d_update_viewmat( - struct Scene *scene, struct View3D *v3d, struct ARegion *ar, + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct View3D *v3d, struct ARegion *ar, float viewmat[4][4], float winmat[4][4], const struct rcti *rect); bool ED_view3d_quat_from_axis_view(const char view, float quat[4]); char ED_view3d_quat_to_axis_view(const float quat[4], const float epsilon); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b3c95aa0712..f6826deaf3a 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -212,6 +212,8 @@ enum { UI_BUT_ALIGN_STITCH_TOP = (1 << 18), UI_BUT_ALIGN_STITCH_LEFT = (1 << 19), UI_BUT_ALIGN_ALL = (UI_BUT_ALIGN | UI_BUT_ALIGN_STITCH_TOP | UI_BUT_ALIGN_STITCH_LEFT), + + UI_BUT_BOX_ITEM = (1 << 20), /* This but is "inside" a box item (currently used to change theme colors). */ }; /* scale fixed button widths by this to account for DPI */ @@ -956,7 +958,11 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C); void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C); void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr); -void uiTemplateOverrideProperty(uiLayout *layout, struct PointerRNA *collection_props_ptr, struct PointerRNA *scene_props_ptr, const char *name, const char *custom_template); +void uiTemplateOverrideProperty( + uiLayout *layout, struct PointerRNA *collection_props_ptr, struct PointerRNA *scene_props_ptr, + const char *propname, + const char *name, const char *text_ctxt, int translate, int icon, + const char *custom_template); void uiTemplateComponentMenu(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name); void uiTemplateNodeSocket(uiLayout *layout, struct bContext *C, float *color); void uiTemplateCacheFile(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname); @@ -1007,7 +1013,7 @@ void uiItemsFullEnumO( struct IDProperty *properties, int context, int flag); void uiItemsFullEnumO_items( uiLayout *layout, struct wmOperatorType *ot, PointerRNA ptr, PropertyRNA *prop, - IDProperty *properties, int context, int flag, + struct IDProperty *properties, int context, int flag, const EnumPropertyItem *item_array, int totitem); void uiItemL(uiLayout *layout, const char *name, int icon); /* label */ @@ -1097,7 +1103,7 @@ void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p); /* Float precision helpers */ -#define UI_PRECISION_FLOAT_MAX 7 +#define UI_PRECISION_FLOAT_MAX 6 /* For float buttons the 'step' (or a1), is scaled */ #define UI_PRECISION_FLOAT_SCALE 0.01f diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index ac657a4ac73..7d2837ffe4e 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -279,6 +279,12 @@ enum { TH_AXIS_Y, TH_AXIS_Z, + TH_MANIPULATOR_HI, + TH_MANIPULATOR_PRIMARY, + TH_MANIPULATOR_SECONDARY, + TH_MANIPULATOR_A, + TH_MANIPULATOR_B, + TH_LOW_GRAD, TH_HIGH_GRAD, TH_SHOW_BACK_GRAD, @@ -303,7 +309,6 @@ enum { TH_EDGE_BEVEL, TH_VERTEX_BEVEL }; -/* XXX WARNING: previous is saved in file, so do not change order! */ /* specific defines per space should have higher define values */ diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 4caacb65f5f..4c0493a881c 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -203,6 +203,7 @@ bool UI_view2d_view_to_region_clip(struct View2D *v2d, float x, float y, int *r void UI_view2d_view_to_region(struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL(); void UI_view2d_view_to_region_fl(struct View2D *v2d, float x, float y, float *r_region_x, float *r_region_y) ATTR_NONNULL(); +void UI_view2d_view_to_region_m4(struct View2D *v2d, float matrix[4][4]) ATTR_NONNULL(); void UI_view2d_view_to_region_rcti(struct View2D *v2d, const struct rctf *rect_src, struct rcti *rect_dst) ATTR_NONNULL(); bool UI_view2d_view_to_region_rcti_clip(struct View2D *v2d, const struct rctf *rect_src, struct rcti *rect_dst) ATTR_NONNULL(); |