diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-16 17:27:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-16 18:56:50 +0300 |
commit | bfc9d426bb95e2bc0dd4541d6b4c5f802909149c (patch) | |
tree | 37702887bc3185309a13612613efd2752ebe0639 /source/blender/editors/include | |
parent | 80bb4254c6fb638cee0d33868c81c76c104817bf (diff) |
Multi-Object Editing
This adds initial multi-object editing support.
- Selected objects are used when entering edit & pose modes.
- Selection & tools work on all objects however many tools need porting
See: T54641 for remaining tasks.
Indentation will be done separately.
See patch: D3101
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_armature.h | 13 | ||||
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 3 | ||||
-rw-r--r-- | source/blender/editors/include/ED_object.h | 3 | ||||
-rw-r--r-- | source/blender/editors/include/ED_undo.h | 5 | ||||
-rw-r--r-- | source/blender/editors/include/ED_uvedit.h | 9 | ||||
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 1 |
6 files changed, 30 insertions, 4 deletions
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 186ca5313e5..e6284cb1656 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -142,19 +142,29 @@ void ED_armature_edit_free(struct bArmature *arm); void ED_armature_edit_deselect_all(struct Object *obedit); void ED_armature_edit_deselect_all_visible(struct Object *obedit); +void ED_armature_edit_deselect_all_multi(struct Object **objects, uint objects_len); +void ED_armature_edit_deselect_all_visible_multi(struct Object **objects, uint objects_len); + bool ED_armature_pose_select_pick_with_buffer( struct ViewLayer *view_layer, struct Base *base, const unsigned int *buffer, short hits, bool extend, bool deselect, bool toggle, bool do_nearest); bool ED_armature_edit_select_pick( struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); int join_armature_exec(struct bContext *C, struct wmOperator *op); -struct Bone *ED_armature_bone_find_index(struct Object *ob, int index); float ED_armature_ebone_roll_to_vector(const EditBone *bone, const float new_up_axis[3], const bool axis_only); EditBone *ED_armature_ebone_find_name(const struct ListBase *edbo, const char *name); EditBone *ED_armature_ebone_get_mirrored(const struct ListBase *edbo, EditBone *ebo); void ED_armature_edit_sync_selection(struct ListBase *edbo); void ED_armature_edit_validate_active(struct bArmature *arm); +struct Base *ED_armature_base_and_ebone_from_select_buffer( + struct Base **bases, uint bases_len, int hit, struct EditBone **r_ebone); +struct Object *ED_armature_object_and_ebone_from_select_buffer( + struct Object **objects, uint objects_len, int hit, struct EditBone **r_ebone); + +struct Base *ED_armature_base_and_bone_from_select_buffer( + struct Base **bases, uint bases_len, int hit, struct Bone **r_bone); + EditBone *ED_armature_ebone_add_primitive(struct Object *obedit_arm, float length, bool view_aligned); EditBone *ED_armature_ebone_add(struct bArmature *arm, const char *name); @@ -211,6 +221,7 @@ bool ED_object_posemode_exit(struct bContext *C, struct Object *ob); bool ED_object_posemode_enter_ex(struct Main *bmain, struct Object *ob); bool ED_object_posemode_enter(struct bContext *C, struct Object *ob); void ED_pose_deselect_all(struct Object *ob, int select_mode, const bool ignore_visibility); +void ED_pose_deselect_all_multi(struct Object **objects, uint objects_len, 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 bContext *C, struct Scene *scene, struct Object *ob); struct Object *ED_pose_object_from_context(struct bContext *C); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 3217433204e..d3f2e1fff85 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -340,6 +340,9 @@ struct MDeformVert *ED_mesh_active_dvert_get_em(struct Object *ob, struct BMVert 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); +void EDBM_mesh_stats_multi(struct Object **objects, const uint objects_len, int totelem[3], int totelem_sel[3]); +void EDBM_mesh_elem_index_ensure_multi(struct Object **objects, const uint objects_len, const char htype); + #define ED_MESH_PICK_DEFAULT_VERT_SIZE 50 #define ED_MESH_PICK_DEFAULT_FACE_SIZE 3 diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 83119062203..bfc3325d7eb 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -124,10 +124,13 @@ enum { EM_WAITCURSOR = (1 << 1), EM_DO_UNDO = (1 << 2), EM_IGNORE_LAYER = (1 << 3), + EM_NO_CONTEXT = (1 << 4), }; void ED_object_editmode_exit_ex( struct bContext *C, struct Scene *scene, struct Object *obedit, int flag); void ED_object_editmode_exit(struct bContext *C, int flag); + +void ED_object_editmode_enter_ex(struct Scene *scene, struct Object *ob, int flag); void ED_object_editmode_enter(struct bContext *C, int flag); bool ED_object_editmode_load(struct Object *obedit); diff --git a/source/blender/editors/include/ED_undo.h b/source/blender/editors/include/ED_undo.h index b3814ab5899..43ffb091666 100644 --- a/source/blender/editors/include/ED_undo.h +++ b/source/blender/editors/include/ED_undo.h @@ -26,6 +26,7 @@ #define __ED_UNDO_H__ struct bContext; +struct CLG_LogRef; struct wmOperator; struct wmOperatorType; struct UndoStack; @@ -53,6 +54,10 @@ bool ED_undo_is_valid(const struct bContext *C, const char *undoname); struct UndoStack *ED_undo_stack_get(void); +/* helpers */ +void ED_undo_object_set_active_or_warn( + struct ViewLayer *view_layer, struct Object *ob, const char *info, struct CLG_LogRef *log); + /* undo_system_types.c */ void ED_undosys_type_init(void); void ED_undosys_type_free(void); diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index 2a5ad494643..fd532e70478 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -119,17 +119,20 @@ void ED_uvedit_live_unwrap_end(short cancel); void ED_uvedit_live_unwrap(struct Scene *scene, struct Object *obedit); void ED_uvedit_pack_islands( -struct Scene *scene, struct Object *ob, struct BMesh *bm, bool selected, bool correct_aspect, bool do_rotate); + struct Scene *scene, struct Object *ob, struct BMesh *bm, bool selected, bool correct_aspect, bool do_rotate); +void ED_uvedit_pack_islands_multi( + struct Scene *scene, struct Object **objects, const uint objects_len, + bool selected, bool correct_aspect, bool do_rotate); void ED_uvedit_unwrap_cube_project( struct BMesh *bm, float cube_size, bool use_select, const float center[3]); /* single call up unwrap using scene settings, used for edge tag unwrapping */ -void ED_unwrap_lscm(struct Scene *scene, struct Object *obedit, const short sel); +void ED_unwrap_lscm(struct Scene *scene, struct Object *obedit, const short sel, const bool pack); /* uvedit_draw.c */ void ED_image_draw_cursor( -struct ARegion *ar, const float cursor[2]); + struct ARegion *ar, const float cursor[2]); void ED_uvedit_draw_main( struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct ViewLayer *view_layer, diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 7f18c10f970..c5b99013610 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -352,6 +352,7 @@ int view3d_opengl_select( /* view3d_select.c */ float ED_view3d_select_dist_px(void); void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc); +void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact); void view3d_operator_needs_opengl(const struct bContext *C); void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar); void view3d_opengl_read_pixels(struct ARegion *ar, int x, int y, int w, int h, int format, int type, void *data); |