Manipulator: option to draw all while interacting

This commit is contained in:
Campbell Barton 2017-07-25 22:02:16 +10:00
parent 0612011b91
commit 5d327eda98
3 changed files with 10 additions and 4 deletions

View File

@ -1170,6 +1170,8 @@ static void rna_def_manipulatorgroup(BlenderRNA *brna)
"Supports selection"},
{WM_MANIPULATORGROUPTYPE_PERSISTENT, "PERSISTENT", 0, "Persistent",
""},
{WM_MANIPULATORGROUPTYPE_ACTIVE_ALL, "ACTIVE_ALL", 0, "Active All",
"Show all while interacting"},
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);

View File

@ -349,6 +349,8 @@ enum {
WM_MANIPULATORGROUPTYPE_SELECT = (1 << 3),
/* The manipulator group is to be kept (not removed on loading a new file for eg). */
WM_MANIPULATORGROUPTYPE_PERSISTENT = (1 << 4),
/* Show all other manipulators when interacting. */
WM_MANIPULATORGROUPTYPE_ACTIVE_ALL = (1 << 5),
};

View File

@ -240,11 +240,13 @@ static void manipulatormap_prepare_drawing(
/* only active manipulator needs updating */
if (active_manipulator) {
if (manipulator_prepare_drawing(mmap, active_manipulator, C, draw_manipulators)) {
manipulatormap_tag_updated(mmap);
if ((active_manipulator->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_ACTIVE_ALL) == 0) {
if (manipulator_prepare_drawing(mmap, active_manipulator, C, draw_manipulators)) {
manipulatormap_tag_updated(mmap);
}
/* don't draw any other manipulators */
return;
}
/* don't draw any other manipulators */
return;
}
for (wmManipulatorGroup *mgroup = mmap->groups.first; mgroup; mgroup = mgroup->next) {