Page MenuHome

Outliner: dedicated ContextMenus for constraints/modifiers
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Jan 16 2015, 3:59 PM.

Details

Summary

This patch will add dedicated ContextMenus for constraints/modifiers in the outliner (the formely used 'data operations' didnt make sense and were not implemented anyways)
atm. constraints will have a context menu with following entries:

  • enable
  • disable
  • delete

and. modifiers will have a context menu with following entries:

  • toggle render
  • toggle viewport
  • delete

I remember seeing a couple of reports mentioning that stuff from the ContextMenus is not implemented or just not doing anything at all, so this should also take care of those reports (at least for constraints/modifiers now)...

(this is part of more work on the outliner, I've split this up in smaller pieces for review now...)

Let me know what you think...

Diff Detail

Event Timeline

Philipp Oeser (lichtwerk) retitled this revision from to Outliner: dedicated ContextMenus for constraints/modifiers.
Philipp Oeser (lichtwerk) updated this object.
Campbell Barton (campbellbarton) requested changes to this revision.Jan 21 2015, 2:41 PM
Campbell Barton (campbellbarton) added inline comments.
source/blender/editors/space_outliner/outliner_tools.c
625

This seems very low level for outliner to worry about, I think it would be better to have some BKE API function.

That this is a direct copy of object_constraint.c:1194 is a hint this could be made into an API function and shared.

1439

Names here are a bit mixed up, but could follow - prop_object_op_types since its an internal operator.

This revision now requires changes to proceed.Jan 21 2015, 2:41 PM
Philipp Oeser (lichtwerk) edited edge metadata.

hopefully adressed issues raised in first review by @Campbell Barton (campbellbarton) (thanx for having a look!)

Sergey Sharybin (sergey) requested changes to this revision.Jan 28 2015, 5:45 PM
Sergey Sharybin (sergey) added inline comments.
source/blender/blenkernel/BKE_constraint.h
135

Can it be BKE_constraint_remove_ex with bool argument to remove all the dependent data? Then it could be easily reused by, i.e. constraint delete operator.

Wouldn't create such a specific name anyway..

source/blender/editors/space_outliner/outliner_tools.c
1525

Could it be more verbose?

This revision now requires changes to proceed.Jan 28 2015, 5:45 PM

Ideally it should be able to use single function to remove constraint and all the data it was dependent on. That would be more clear than having _post function which is a bit creepy.

Philipp Oeser (lichtwerk) edited edge metadata.

hopefully adressed issues raised in review by @Sergey Sharybin (sergey) (thanx for having a look!)

  • also moved/renamed "get_constraint_lb" into BKE
  • tweaked update/notifier for constraints enable/disable (wasnt updating 3DView correctly in previous patch version)
Campbell Barton (campbellbarton) requested changes to this revision.Feb 4 2015, 6:21 PM
Campbell Barton (campbellbarton) edited edge metadata.

I should have thought of this before. But the outliner element can inspect its parent, so there should be no need to expose get_constraint_lb,

Just get the ListBase from the parent which will be a bPoseChannel or an Object

This revision now requires changes to proceed.Feb 4 2015, 6:21 PM
  • dont expose get_constraint_lb (pass constraint ListBase to BKE_constraint_remove_ex directly)
  • also fixed tree update and selection

sidenote: something along this line has also been requested on BA (see here)

Campbell Barton (campbellbarton) edited edge metadata.

Looks good, only tiny changes - can can make when applying.

source/blender/editors/space_outliner/outliner_tools.c
519–520

remove

634

This is used for the constraint UI, this comment can just be removed.

1349–1350

remove dead code.

1449

can be OPERATOR_INTERNAL, since its only useful within the context of the outliner.

Sergey Sharybin (sergey) edited edge metadata.
This revision is now accepted and ready to land.Feb 11 2015, 6:44 PM

Committed rB23214ecad03bfef75c78b6a812970959da363344

remove some paranoid checks

source/blender/editors/space_outliner/outliner_tools.c
1415–1417

removed, poll checks

1422–1423

removed, cant happen.