Cleanup: Unused parameters in Outliner

These were only passed to own recursion calls.
This commit is contained in:
Julian Eisel
2016-10-16 15:19:18 +02:00
parent b659cb8dbc
commit d59079c5e1
6 changed files with 69 additions and 75 deletions

View File

@@ -155,7 +155,7 @@ static void restrictbutton_recursive_ebone(bContext *C, EditBone *ebone_parent,
} }
} }
static void restrictbutton_recursive_bone(bContext *C, bArmature *arm, Bone *bone_parent, int flag, bool set_flag) static void restrictbutton_recursive_bone(Bone *bone_parent, int flag, bool set_flag)
{ {
Bone *bone; Bone *bone;
for (bone = bone_parent->childbase.first; bone; bone = bone->next) { for (bone = bone_parent->childbase.first; bone; bone = bone->next) {
@@ -166,7 +166,7 @@ static void restrictbutton_recursive_bone(bContext *C, bArmature *arm, Bone *bon
else { else {
bone->flag &= ~flag; bone->flag &= ~flag;
} }
restrictbutton_recursive_bone(C, arm, bone, flag, set_flag); restrictbutton_recursive_bone(bone, flag, set_flag);
} }
} }
@@ -294,29 +294,27 @@ static void restrictbutton_modifier_cb(bContext *C, void *UNUSED(poin), void *po
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
} }
static void restrictbutton_bone_visibility_cb(bContext *C, void *poin, void *poin2) static void restrictbutton_bone_visibility_cb(bContext *C, void *UNUSED(poin), void *poin2)
{ {
bArmature *arm = (bArmature *)poin;
Bone *bone = (Bone *)poin2; Bone *bone = (Bone *)poin2;
if (bone->flag & BONE_HIDDEN_P) if (bone->flag & BONE_HIDDEN_P)
bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
if (CTX_wm_window(C)->eventstate->ctrl) { if (CTX_wm_window(C)->eventstate->ctrl) {
restrictbutton_recursive_bone(C, arm, bone, BONE_HIDDEN_P, (bone->flag & BONE_HIDDEN_P) != 0); restrictbutton_recursive_bone(bone, BONE_HIDDEN_P, (bone->flag & BONE_HIDDEN_P) != 0);
} }
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL); WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
} }
static void restrictbutton_bone_select_cb(bContext *C, void *poin, void *poin2) static void restrictbutton_bone_select_cb(bContext *C, void *UNUSED(poin), void *poin2)
{ {
bArmature *arm = (bArmature *)poin;
Bone *bone = (Bone *)poin2; Bone *bone = (Bone *)poin2;
if (bone->flag & BONE_UNSELECTABLE) if (bone->flag & BONE_UNSELECTABLE)
bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
if (CTX_wm_window(C)->eventstate->ctrl) { if (CTX_wm_window(C)->eventstate->ctrl) {
restrictbutton_recursive_bone(C, arm, bone, BONE_UNSELECTABLE, (bone->flag & BONE_UNSELECTABLE) != 0); restrictbutton_recursive_bone(bone, BONE_UNSELECTABLE, (bone->flag & BONE_UNSELECTABLE) != 0);
} }
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL); WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
@@ -893,7 +891,7 @@ static void outliner_draw_rnacols(ARegion *ar, int sizex)
miny); miny);
} }
static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, SpaceOops *soops, int sizex, ListBase *lb) static void outliner_draw_rnabuts(uiBlock *block, ARegion *ar, SpaceOops *soops, int sizex, ListBase *lb)
{ {
TreeElement *te; TreeElement *te;
TreeStoreElem *tselem; TreeStoreElem *tselem;
@@ -932,7 +930,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa
} }
} }
if (TSELEM_OPEN(tselem, soops)) outliner_draw_rnabuts(block, scene, ar, soops, sizex, &te->subtree); if (TSELEM_OPEN(tselem, soops)) outliner_draw_rnabuts(block, ar, soops, sizex, &te->subtree);
} }
UI_block_emboss_set(block, UI_EMBOSS); UI_block_emboss_set(block, UI_EMBOSS);
@@ -1414,7 +1412,7 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa
} }
/* closed tree element */ /* closed tree element */
static void outliner_set_coord_tree_element(SpaceOops *soops, TreeElement *te, int startx, int starty) static void outliner_set_coord_tree_element(TreeElement *te, int startx, int starty)
{ {
TreeElement *ten; TreeElement *ten;
@@ -1423,7 +1421,7 @@ static void outliner_set_coord_tree_element(SpaceOops *soops, TreeElement *te, i
te->ys = starty; te->ys = starty;
for (ten = te->subtree.first; ten; ten = ten->next) { for (ten = te->subtree.first; ten; ten = ten->next) {
outliner_set_coord_tree_element(soops, ten, startx + UI_UNIT_X, starty); outliner_set_coord_tree_element(ten, startx + UI_UNIT_X, starty);
} }
} }
@@ -1649,7 +1647,7 @@ static void outliner_draw_tree_element(
} }
else { else {
for (ten = te->subtree.first; ten; ten = ten->next) { for (ten = te->subtree.first; ten; ten = ten->next) {
outliner_set_coord_tree_element(soops, ten, startx, *starty); outliner_set_coord_tree_element(ten, startx, *starty);
} }
*starty -= UI_UNIT_Y; *starty -= UI_UNIT_Y;
@@ -1889,7 +1887,7 @@ void draw_outliner(const bContext *C)
if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) { if (ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) {
/* draw rna buttons */ /* draw rna buttons */
outliner_draw_rnacols(ar, sizex_rna); outliner_draw_rnacols(ar, sizex_rna);
outliner_draw_rnabuts(block, scene, ar, soops, sizex_rna, &soops->tree); outliner_draw_rnabuts(block, ar, soops, sizex_rna, &soops->tree);
} }
else if ((soops->outlinevis == SO_ID_ORPHANS) && !(soops->flag & SO_HIDE_RESTRICTCOLS)) { else if ((soops->outlinevis == SO_ID_ORPHANS) && !(soops->flag & SO_HIDE_RESTRICTCOLS)) {
/* draw user toggle columns */ /* draw user toggle columns */

View File

@@ -117,9 +117,7 @@ static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *te
} }
#endif #endif
static TreeElement *outliner_dropzone_element( static TreeElement *outliner_dropzone_element(TreeElement *te, const float fmval[2], const bool children)
const SpaceOops *soops, TreeElement *te,
const float fmval[2], const bool children)
{ {
if ((fmval[1] > te->ys) && (fmval[1] < (te->ys + UI_UNIT_Y))) { if ((fmval[1] > te->ys) && (fmval[1] < (te->ys + UI_UNIT_Y))) {
/* name and first icon */ /* name and first icon */
@@ -129,7 +127,7 @@ static TreeElement *outliner_dropzone_element(
/* Not it. Let's look at its children. */ /* Not it. Let's look at its children. */
if (children && (TREESTORE(te)->flag & TSE_CLOSED) == 0 && (te->subtree.first)) { if (children && (TREESTORE(te)->flag & TSE_CLOSED) == 0 && (te->subtree.first)) {
for (te = te->subtree.first; te; te = te->next) { for (te = te->subtree.first; te; te = te->next) {
TreeElement *te_valid = outliner_dropzone_element(soops, te, fmval, children); TreeElement *te_valid = outliner_dropzone_element(te, fmval, children);
if (te_valid) if (te_valid)
return te_valid; return te_valid;
} }
@@ -143,7 +141,7 @@ TreeElement *outliner_dropzone_find(const SpaceOops *soops, const float fmval[2]
TreeElement *te; TreeElement *te;
for (te = soops->tree.first; te; te = te->next) { for (te = soops->tree.first; te; te = te->next) {
TreeElement *te_valid = outliner_dropzone_element(soops, te, fmval, children); TreeElement *te_valid = outliner_dropzone_element(te, fmval, children);
if (te_valid) if (te_valid)
return te_valid; return te_valid;
} }
@@ -164,7 +162,7 @@ static int do_outliner_item_openclose(bContext *C, SpaceOops *soops, TreeElement
/* all below close/open? */ /* all below close/open? */
if (all) { if (all) {
tselem->flag &= ~TSE_CLOSED; tselem->flag &= ~TSE_CLOSED;
outliner_set_flag(soops, &te->subtree, TSE_CLOSED, !outliner_has_one_flag(soops, &te->subtree, TSE_CLOSED, 1)); outliner_set_flag(&te->subtree, TSE_CLOSED, !outliner_has_one_flag(&te->subtree, TSE_CLOSED, 1));
} }
else { else {
if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED; if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
@@ -252,7 +250,7 @@ void item_rename_cb(
do_item_rename(ar, te, tselem, reports); do_item_rename(ar, te, tselem, reports);
} }
static int do_outliner_item_rename(ReportList *reports, ARegion *ar, SpaceOops *soops, TreeElement *te, const float mval[2]) static int do_outliner_item_rename(ReportList *reports, ARegion *ar, TreeElement *te, const float mval[2])
{ {
if (mval[1] > te->ys && mval[1] < te->ys + UI_UNIT_Y) { if (mval[1] > te->ys && mval[1] < te->ys + UI_UNIT_Y) {
TreeStoreElem *tselem = TREESTORE(te); TreeStoreElem *tselem = TREESTORE(te);
@@ -266,7 +264,7 @@ static int do_outliner_item_rename(ReportList *reports, ARegion *ar, SpaceOops *
} }
for (te = te->subtree.first; te; te = te->next) { for (te = te->subtree.first; te; te = te->next) {
if (do_outliner_item_rename(reports, ar, soops, te, mval)) return 1; if (do_outliner_item_rename(reports, ar, te, mval)) return 1;
} }
return 0; return 0;
} }
@@ -282,7 +280,7 @@ static int outliner_item_rename(bContext *C, wmOperator *op, const wmEvent *even
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]);
for (te = soops->tree.first; te; te = te->next) { for (te = soops->tree.first; te; te = te->next) {
if (do_outliner_item_rename(op->reports, ar, soops, te, fmval)) { if (do_outliner_item_rename(op->reports, ar, te, fmval)) {
changed = true; changed = true;
break; break;
} }
@@ -713,20 +711,20 @@ void lib_reload_cb(
/* Apply Settings ------------------------------- */ /* Apply Settings ------------------------------- */
static int outliner_count_levels(SpaceOops *soops, ListBase *lb, const int curlevel) static int outliner_count_levels(ListBase *lb, const int curlevel)
{ {
TreeElement *te; TreeElement *te;
int level = curlevel, lev; int level = curlevel, lev;
for (te = lb->first; te; te = te->next) { for (te = lb->first; te; te = te->next) {
lev = outliner_count_levels(soops, &te->subtree, curlevel + 1); lev = outliner_count_levels(&te->subtree, curlevel + 1);
if (lev > level) level = lev; if (lev > level) level = lev;
} }
return level; return level;
} }
int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, const int curlevel) int outliner_has_one_flag(ListBase *lb, short flag, const int curlevel)
{ {
TreeElement *te; TreeElement *te;
TreeStoreElem *tselem; TreeStoreElem *tselem;
@@ -736,13 +734,13 @@ int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, const int
tselem = TREESTORE(te); tselem = TREESTORE(te);
if (tselem->flag & flag) return curlevel; if (tselem->flag & flag) return curlevel;
level = outliner_has_one_flag(soops, &te->subtree, flag, curlevel + 1); level = outliner_has_one_flag(&te->subtree, flag, curlevel + 1);
if (level) return level; if (level) return level;
} }
return 0; return 0;
} }
void outliner_set_flag(SpaceOops *soops, ListBase *lb, short flag, short set) void outliner_set_flag(ListBase *lb, short flag, short set)
{ {
TreeElement *te; TreeElement *te;
TreeStoreElem *tselem; TreeStoreElem *tselem;
@@ -751,7 +749,7 @@ void outliner_set_flag(SpaceOops *soops, ListBase *lb, short flag, short set)
tselem = TREESTORE(te); tselem = TREESTORE(te);
if (set == 0) tselem->flag &= ~flag; if (set == 0) tselem->flag &= ~flag;
else tselem->flag |= flag; else tselem->flag |= flag;
outliner_set_flag(soops, &te->subtree, flag, set); outliner_set_flag(&te->subtree, flag, set);
} }
} }
@@ -964,10 +962,10 @@ static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op))
SpaceOops *soops = CTX_wm_space_outliner(C); SpaceOops *soops = CTX_wm_space_outliner(C);
ARegion *ar = CTX_wm_region(C); ARegion *ar = CTX_wm_region(C);
if (outliner_has_one_flag(soops, &soops->tree, TSE_CLOSED, 1)) if (outliner_has_one_flag(&soops->tree, TSE_CLOSED, 1))
outliner_set_flag(soops, &soops->tree, TSE_CLOSED, 0); outliner_set_flag(&soops->tree, TSE_CLOSED, 0);
else else
outliner_set_flag(soops, &soops->tree, TSE_CLOSED, 1); outliner_set_flag(&soops->tree, TSE_CLOSED, 1);
ED_region_tag_redraw(ar); ED_region_tag_redraw(ar);
@@ -996,10 +994,10 @@ static int outliner_toggle_selected_exec(bContext *C, wmOperator *UNUSED(op))
ARegion *ar = CTX_wm_region(C); ARegion *ar = CTX_wm_region(C);
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
if (outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1)) if (outliner_has_one_flag(&soops->tree, TSE_SELECTED, 1))
outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0); outliner_set_flag(&soops->tree, TSE_SELECTED, 0);
else else
outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 1); outliner_set_flag(&soops->tree, TSE_SELECTED, 1);
soops->storeflag |= SO_TREESTORE_REDRAW; soops->storeflag |= SO_TREESTORE_REDRAW;
@@ -1097,13 +1095,13 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op))
if (obact->mode & OB_MODE_POSE) { if (obact->mode & OB_MODE_POSE) {
bPoseChannel *pchan = CTX_data_active_pose_bone(C); bPoseChannel *pchan = CTX_data_active_pose_bone(C);
if (pchan) { if (pchan) {
te = outliner_find_posechannel(so, &te_obact->subtree, pchan); te = outliner_find_posechannel(&te_obact->subtree, pchan);
} }
} }
else if (obact->mode & OB_MODE_EDIT) { else if (obact->mode & OB_MODE_EDIT) {
EditBone *ebone = CTX_data_active_bone(C); EditBone *ebone = CTX_data_active_bone(C);
if (ebone) { if (ebone) {
te = outliner_find_editbone(so, &te_obact->subtree, ebone); te = outliner_find_editbone(&te_obact->subtree, ebone);
} }
} }
} }
@@ -1298,7 +1296,7 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so
/* Show One Level ----------------------------------------------- */ /* Show One Level ----------------------------------------------- */
/* helper function for Show/Hide one level operator */ /* helper function for Show/Hide one level operator */
static void outliner_openclose_level(SpaceOops *soops, ListBase *lb, int curlevel, int level, int open) static void outliner_openclose_level(ListBase *lb, int curlevel, int level, int open)
{ {
TreeElement *te; TreeElement *te;
TreeStoreElem *tselem; TreeStoreElem *tselem;
@@ -1313,7 +1311,7 @@ static void outliner_openclose_level(SpaceOops *soops, ListBase *lb, int curleve
if (curlevel >= level) tselem->flag |= TSE_CLOSED; if (curlevel >= level) tselem->flag |= TSE_CLOSED;
} }
outliner_openclose_level(soops, &te->subtree, curlevel + 1, level, open); outliner_openclose_level(&te->subtree, curlevel + 1, level, open);
} }
} }
@@ -1324,13 +1322,13 @@ static int outliner_one_level_exec(bContext *C, wmOperator *op)
const bool add = RNA_boolean_get(op->ptr, "open"); const bool add = RNA_boolean_get(op->ptr, "open");
int level; int level;
level = outliner_has_one_flag(soops, &soops->tree, TSE_CLOSED, 1); level = outliner_has_one_flag(&soops->tree, TSE_CLOSED, 1);
if (add == 1) { if (add == 1) {
if (level) outliner_openclose_level(soops, &soops->tree, 1, level, 1); if (level) outliner_openclose_level(&soops->tree, 1, level, 1);
} }
else { else {
if (level == 0) level = outliner_count_levels(soops, &soops->tree, 0); if (level == 0) level = outliner_count_levels(&soops->tree, 0);
if (level) outliner_openclose_level(soops, &soops->tree, 1, level - 1, 0); if (level) outliner_openclose_level(&soops->tree, 1, level - 1, 0);
} }
ED_region_tag_redraw(ar); ED_region_tag_redraw(ar);
@@ -1361,7 +1359,7 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot)
/* Show Hierarchy ----------------------------------------------- */ /* Show Hierarchy ----------------------------------------------- */
/* helper function for tree_element_shwo_hierarchy() - recursively checks whether subtrees have any objects*/ /* helper function for tree_element_shwo_hierarchy() - recursively checks whether subtrees have any objects*/
static int subtree_has_objects(SpaceOops *soops, ListBase *lb) static int subtree_has_objects(ListBase *lb)
{ {
TreeElement *te; TreeElement *te;
TreeStoreElem *tselem; TreeStoreElem *tselem;
@@ -1369,7 +1367,7 @@ static int subtree_has_objects(SpaceOops *soops, ListBase *lb)
for (te = lb->first; te; te = te->next) { for (te = lb->first; te; te = te->next) {
tselem = TREESTORE(te); tselem = TREESTORE(te);
if (tselem->type == 0 && te->idcode == ID_OB) return 1; if (tselem->type == 0 && te->idcode == ID_OB) return 1;
if (subtree_has_objects(soops, &te->subtree)) return 1; if (subtree_has_objects(&te->subtree)) return 1;
} }
return 0; return 0;
} }
@@ -1390,7 +1388,7 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOops *soops, ListBase
else tselem->flag &= ~TSE_CLOSED; else tselem->flag &= ~TSE_CLOSED;
} }
else if (te->idcode == ID_OB) { else if (te->idcode == ID_OB) {
if (subtree_has_objects(soops, &te->subtree)) tselem->flag &= ~TSE_CLOSED; if (subtree_has_objects(&te->subtree)) tselem->flag &= ~TSE_CLOSED;
else tselem->flag |= TSE_CLOSED; else tselem->flag |= TSE_CLOSED;
} }
} }

View File

@@ -133,8 +133,8 @@ void outliner_cleanup_tree(struct SpaceOops *soops);
TreeElement *outliner_find_tse(struct SpaceOops *soops, const TreeStoreElem *tse); TreeElement *outliner_find_tse(struct SpaceOops *soops, const TreeStoreElem *tse);
TreeElement *outliner_find_tree_element(ListBase *lb, const TreeStoreElem *store_elem); TreeElement *outliner_find_tree_element(ListBase *lb, const TreeStoreElem *store_elem);
TreeElement *outliner_find_id(struct SpaceOops *soops, ListBase *lb, const struct ID *id); TreeElement *outliner_find_id(struct SpaceOops *soops, ListBase *lb, const struct ID *id);
TreeElement *outliner_find_posechannel(struct SpaceOops *soops, ListBase *lb, const struct bPoseChannel *pchan); TreeElement *outliner_find_posechannel(ListBase *lb, const struct bPoseChannel *pchan);
TreeElement *outliner_find_editbone(struct SpaceOops *soops, ListBase *lb, const struct EditBone *ebone); TreeElement *outliner_find_editbone(ListBase *lb, const struct EditBone *ebone);
struct ID *outliner_search_back(SpaceOops *soops, TreeElement *te, short idcode); struct ID *outliner_search_back(SpaceOops *soops, TreeElement *te, short idcode);
void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct SpaceOops *soops); void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct SpaceOops *soops);
@@ -166,8 +166,8 @@ void outliner_do_object_operation(
int common_restrict_check(struct bContext *C, struct Object *ob); int common_restrict_check(struct bContext *C, struct Object *ob);
int outliner_has_one_flag(struct SpaceOops *soops, ListBase *lb, short flag, const int curlevel); int outliner_has_one_flag(ListBase *lb, short flag, const int curlevel);
void outliner_set_flag(struct SpaceOops *soops, ListBase *lb, short flag, short set); void outliner_set_flag(ListBase *lb, short flag, short set);
void object_toggle_visibility_cb( void object_toggle_visibility_cb(
struct bContext *C, struct ReportList *reports, struct Scene *scene, struct bContext *C, struct ReportList *reports, struct Scene *scene,

View File

@@ -904,7 +904,7 @@ static bool do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Sp
/* all below close/open? */ /* all below close/open? */
if (extend) { if (extend) {
tselem->flag &= ~TSE_CLOSED; tselem->flag &= ~TSE_CLOSED;
outliner_set_flag(soops, &te->subtree, TSE_CLOSED, !outliner_has_one_flag(soops, &te->subtree, TSE_CLOSED, 1)); outliner_set_flag(&te->subtree, TSE_CLOSED, !outliner_has_one_flag(&te->subtree, TSE_CLOSED, 1));
} }
else { else {
if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED; if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
@@ -1062,7 +1062,7 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
/* ****************************************************** */ /* ****************************************************** */
/* **************** Border Select Tool ****************** */ /* **************** Border Select Tool ****************** */
static void outliner_item_border_select(Scene *scene, SpaceOops *soops, rctf *rectf, TreeElement *te, int gesture_mode) static void outliner_item_border_select(Scene *scene, rctf *rectf, TreeElement *te, int gesture_mode)
{ {
TreeStoreElem *tselem = TREESTORE(te); TreeStoreElem *tselem = TREESTORE(te);
@@ -1078,7 +1078,7 @@ static void outliner_item_border_select(Scene *scene, SpaceOops *soops, rctf *re
/* Look at its children. */ /* Look at its children. */
if ((tselem->flag & TSE_CLOSED) == 0) { if ((tselem->flag & TSE_CLOSED) == 0) {
for (te = te->subtree.first; te; te = te->next) { for (te = te->subtree.first; te; te = te->next) {
outliner_item_border_select(scene, soops, rectf, te, gesture_mode); outliner_item_border_select(scene, rectf, te, gesture_mode);
} }
} }
} }
@@ -1096,7 +1096,7 @@ static int outliner_border_select_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view_rctf(&ar->v2d, &rectf, &rectf); UI_view2d_region_to_view_rctf(&ar->v2d, &rectf, &rectf);
for (te = soops->tree.first; te; te = te->next) { for (te = soops->tree.first; te; te = te->next) {
outliner_item_border_select(scene, soops, &rectf, te, gesture_mode); outliner_item_border_select(scene, &rectf, te, gesture_mode);
} }
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);

View File

@@ -1832,8 +1832,8 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot)
/* ******************** */ /* ******************** */
static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops, static int do_outliner_operation_event(bContext *C, ARegion *ar, SpaceOops *soops,
TreeElement *te, const wmEvent *event, const float mval[2]) TreeElement *te, const float mval[2])
{ {
ReportList *reports = CTX_wm_reports(C); // XXX... ReportList *reports = CTX_wm_reports(C); // XXX...
@@ -1844,8 +1844,8 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
/* select object that's clicked on and popup context menu */ /* select object that's clicked on and popup context menu */
if (!(tselem->flag & TSE_SELECTED)) { if (!(tselem->flag & TSE_SELECTED)) {
if (outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1)) if (outliner_has_one_flag(&soops->tree, TSE_SELECTED, 1))
outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0); outliner_set_flag(&soops->tree, TSE_SELECTED, 0);
tselem->flag |= TSE_SELECTED; tselem->flag |= TSE_SELECTED;
/* redraw, same as outliner_select function */ /* redraw, same as outliner_select function */
@@ -1916,7 +1916,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
} }
for (te = te->subtree.first; te; te = te->next) { for (te = te->subtree.first; te; te = te->next) {
if (do_outliner_operation_event(C, scene, ar, soops, te, event, mval)) if (do_outliner_operation_event(C, ar, soops, te, mval))
return 1; return 1;
} }
return 0; return 0;
@@ -1925,7 +1925,6 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{ {
Scene *scene = CTX_data_scene(C);
ARegion *ar = CTX_wm_region(C); ARegion *ar = CTX_wm_region(C);
SpaceOops *soops = CTX_wm_space_outliner(C); SpaceOops *soops = CTX_wm_space_outliner(C);
uiBut *but = UI_context_active_but_get(C); uiBut *but = UI_context_active_but_get(C);
@@ -1939,7 +1938,7 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]);
for (te = soops->tree.first; te; te = te->next) { for (te = soops->tree.first; te; te = te->next) {
if (do_outliner_operation_event(C, scene, ar, soops, te, event, fmval)) { if (do_outliner_operation_event(C, ar, soops, te, fmval)) {
break; break;
} }
} }

View File

@@ -249,7 +249,7 @@ TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, const ID *id)
return NULL; return NULL;
} }
TreeElement *outliner_find_posechannel(SpaceOops *soops, ListBase *lb, const bPoseChannel *pchan) TreeElement *outliner_find_posechannel(ListBase *lb, const bPoseChannel *pchan)
{ {
for (TreeElement *te = lb->first; te; te = te->next) { for (TreeElement *te = lb->first; te; te = te->next) {
if (te->directdata == pchan) { if (te->directdata == pchan) {
@@ -258,7 +258,7 @@ TreeElement *outliner_find_posechannel(SpaceOops *soops, ListBase *lb, const bPo
TreeStoreElem *tselem = TREESTORE(te); TreeStoreElem *tselem = TREESTORE(te);
if (ELEM(tselem->type, TSE_POSE_BASE, TSE_POSE_CHANNEL)) { if (ELEM(tselem->type, TSE_POSE_BASE, TSE_POSE_CHANNEL)) {
TreeElement *tes = outliner_find_posechannel(soops, &te->subtree, pchan); TreeElement *tes = outliner_find_posechannel(&te->subtree, pchan);
if (tes) { if (tes) {
return tes; return tes;
} }
@@ -267,7 +267,7 @@ TreeElement *outliner_find_posechannel(SpaceOops *soops, ListBase *lb, const bPo
return NULL; return NULL;
} }
TreeElement *outliner_find_editbone(SpaceOops *soops, ListBase *lb, const EditBone *ebone) TreeElement *outliner_find_editbone(ListBase *lb, const EditBone *ebone)
{ {
for (TreeElement *te = lb->first; te; te = te->next) { for (TreeElement *te = lb->first; te; te = te->next) {
if (te->directdata == ebone) { if (te->directdata == ebone) {
@@ -276,7 +276,7 @@ TreeElement *outliner_find_editbone(SpaceOops *soops, ListBase *lb, const EditBo
TreeStoreElem *tselem = TREESTORE(te); TreeStoreElem *tselem = TREESTORE(te);
if (ELEM(tselem->type, 0, TSE_EBONE)) { if (ELEM(tselem->type, 0, TSE_EBONE)) {
TreeElement *tes = outliner_find_editbone(soops, &te->subtree, ebone); TreeElement *tes = outliner_find_editbone(&te->subtree, ebone);
if (tes) { if (tes) {
return tes; return tes;
} }
@@ -1475,15 +1475,12 @@ static int treesort_obtype_alpha(const void *v1, const void *v2)
#endif #endif
/* sort happens on each subtree individual */ /* sort happens on each subtree individual */
static void outliner_sort(SpaceOops *soops, ListBase *lb) static void outliner_sort(ListBase *lb)
{ {
TreeElement *te; TreeElement *te;
TreeStoreElem *tselem; TreeStoreElem *tselem;
int totelem = 0; int totelem = 0;
if (soops->flag & SO_SKIP_SORT_ALPHA)
return;
te = lb->last; te = lb->last;
if (te == NULL) return; if (te == NULL) return;
tselem = TREESTORE(te); tselem = TREESTORE(te);
@@ -1537,7 +1534,7 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb)
} }
for (te = lb->first; te; te = te->next) { for (te = lb->first; te; te = te->next) {
outliner_sort(soops, &te->subtree); outliner_sort(&te->subtree);
} }
} }
@@ -1830,7 +1827,9 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
if (ten) ten->directdata = BASACT; if (ten) ten->directdata = BASACT;
} }
outliner_sort(soops, &soops->tree); if ((soops->flag & SO_SKIP_SORT_ALPHA) == 0) {
outliner_sort(&soops->tree);
}
outliner_filter_tree(soops, &soops->tree); outliner_filter_tree(soops, &soops->tree);
} }