Page MenuHome

Select Group for all selected objects instead of just active
Needs ReviewPublic

Authored by mangostaniko on Jun 22 2016, 6:37 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Possible solution for T48677 and T7423.

Adds UI option for Select Group operator to be applied to all selected objects instead of active object only.
Works for Children, Parents, Siblings and Groups of selected objects. Not sure if it makes sense for any other types.

Possibly there are nicer ways to structure these changes?

Note that this patch also includes D2067.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D2068_2
Build Status
Buildable 13
Build 13: arc lint + arc unit

Event Timeline

mangostaniko retitled this revision from to Select Group for all selected objects instead of just active.
mangostaniko updated this object.
mangostaniko set the repository for this revision to rB Blender.
mangostaniko added a project: BF Blender.
mangostaniko changed the edit policy from "All Users" to "Administrators".
mangostaniko added a subscriber: Dmiotry (HCMTR).
  • Sync with master
  • Name option 'only_active' to match others.

@mangostaniko, I commandeered the patch to update it with master, please commandeer back.

I've raised some concerns inline.


Note that it could be good to get selectable_bases once, then pass the list to each function, so its not needing to be created every time, however that could be done as a separate patch, to keep this patch simpler to review.

source/blender/editors/object/object_select.c
843

This is no longer correct - when operating on the selection theres no need for an active object.

853–927

Logic in this function could be simplified by making the active-object case a list of one.

So:

if (!only_active) {
    for (ctx_base = ctx_selected_base_list.first; ctx_base; ctx_base = ctx_base->next) {
        changed |= ...;
    }
}
else {
    changed |= ...;
}

Can be replaced with:

for (ctx_base = ctx_selected_base_list.first; ctx_base; ctx_base = ctx_base->next) {
    changed |= ...;
}
895–897

This may popup a menu for every object that has multiple groups.

Probably better to show a menu with all groups used by the current selection?

906–910

Color and pass could use all objects in the selection.

930–933

Don't think this is correct, since its possible objects from the original selection would have been de-selected, then reselected based on matching properties.

Best move this directly below CTX_data_selected_bases(C, &ctx_selected_base_list);

mangostaniko commandeered this revision.Jul 17 2016, 11:20 PM
mangostaniko edited reviewers, added: Campbell Barton (campbellbarton); removed: mangostaniko.

Here is an updated draft. Can you update the revision if appropriate?
extend and only_active mode work for all mentioned cases. In the latter case it uses a single element list as suggested, not sure if the implementation is ok, it feels a bit hacky.

Have not yet looked into the popup menu for the selection by groups, i guess that would be done via uiPopupMenu. Do predefined layouts already exist for the groups or what structs / enums could they be generated from?

mangostaniko marked 4 inline comments as done.Jul 17 2016, 11:22 PM
mangostaniko added inline comments.
source/blender/editors/object/object_select.c
895–897

Have not yet looked into the popup menu for the selection by groups, i guess that would be done via uiPopupMenu. Do predefined layouts already exist for the groups or what structs / enums could they be generated from?