Page MenuHome

Outliner: DragDrop objects to modifiers and constraints
Changes PlannedPublic

Authored by Philipp Oeser (lichtwerk) on Jan 15 2015, 7:05 PM.

Details

Reviewers
None
Summary

This patch will allow drag n drop objects to modifiers and constraints to set properties that an object can be assigned to (where appropriate).
e.g.: if a mesh object is dropped on the DataTransfer modifier, the "source" object will be set. a popup will be created to choose which property to set

(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: DragDrop objects to modifiers.
Philipp Oeser (lichtwerk) updated this object.
Philipp Oeser (lichtwerk) updated this object.

add new DataTransfer modifier as well

Campbell Barton (campbellbarton) requested changes to this revision.Jan 21 2015, 2:55 PM

Realize quite some work into this, but at some point I think its not useful to expose all settings in the outliner.

If your editing an array modifier for eg, you better just use the UI for the modifier...

Talked with Sergey, and in prindible this could work.

It could for example - loop over all RNA propeties of a modifier and expose them in the outliner. then use RNA pointer poll function to check if you can drop different data.

However Im still not totally convinced of this, it moves the outliner towards the 'data' view where you can edit all settings (rather then only high level relationships).
Each item in this list has a different purpose - so the outliner needs to make that clear.

source/blender/editors/space_outliner/outliner_edit.c
1843

really dont think having hard coded property list in outliner is good design.

we should have a more general way of handling this.

This revision now requires changes to proceed.Jan 21 2015, 2:55 PM

agree on the issues of hardcoding/compactness and will try to solve this with rna struct inspection...

And yes, this moves the outliner in the direction of being able to edit the relationships it displays [ which I think is a good thing :) ]
Doing this with drag n drop feels very natural/intuitive for users. Plus you save a couple of clicks doing that in the outliner [because it is not mandatory to change selection all the time when you work with multiple objects]. Of course this is just my opinion (but this is one of the first things that came up when talking to convert users of softimage... -- I know, I know, that doesnt mean a thing... but they love their outliner and actually do/edit a lot in it).

Would it make more sense to make that work in "Datablocks" view?

Not sure what you mean by "Each item in this list has a different purpose - so the outliner needs to make that clear."?

re:

Each item in this list has a different purpose - so the outliner needs to make that clear.

For parent/child its implicit, objects which are group members too.

But for array-cap-end, This is a very spesific value which needs to be labelled so you know what exactly what you're changing.

In the case of 'array-cap-end' you will already have to explicitly click on it [because a popup comes up with two choices: "Start Cap"/"End Cap"]
Whenever there is more than one possible option to set such a popup will come up.
Would it help to always spawn a popup [so e.g. you drop an object on the mirror modifier --> popup with one choice "Mirror Object"]?

(I initially followed what we do for parent/child as well: if you drop on object it is implicit, but in case you drop on armature its not implicit anymore and you get a popup)

Philipp Oeser (lichtwerk) edited edge metadata.
  • redid the op, this time using only RNA information -- so no more hardcoded stuff there...and a lot less code :)
  • still need to update the poll to also only use RNA there...
Campbell Barton (campbellbarton) requested changes to this revision.Feb 4 2015, 6:31 PM
Campbell Barton (campbellbarton) edited edge metadata.

Am not keen on having hard coded modifier assignment, this should be done in a generic way, or not at all.
RNA is used for assignment, but the poll is still hard coded.

Realize this isnt so simple to get working, but its just adding too much overhead.

This revision now requires changes to proceed.Feb 4 2015, 6:31 PM
Philipp Oeser (lichtwerk) edited edge metadata.
  • RNA used for poll & assignement now...

This still feels really weak to me - modifiers can have multiple object properties - so drag & drop just uses the first object found ... which means re-ordering object properties will change outliner behavior.

It also means that Warp modifier for eg, you will be able to set the From but never the To field.

And I just can't help but thinking the outliner just isnt a good place to be manipulating modifiers in the first place (visibility - I suppose works OK)... but changing modifier settings. you can only access a few.

AFAICS this only makes sense for modifiers that obviously only have a single object (same for constraints).

Modifiers that make sense:

  • Armature
  • Lattice
  • Curve
  • Hook

... maybe other.

... other modifiers may happen to have a single object property but thats pretty much incidental.

Would like feedback from others, but am not sure if its worth to go ahead with this patch.

source/blender/editors/space_outliner/space_outliner.c
275

no need to cast.

276–277

These are small and can just be stack memory.

@Campbell Barton (campbellbarton): thanx for looking at it again.
regarding your comment:
This still feels really weak to me - modifiers can have multiple object properties - so drag & drop just uses the first object found ... which means re-ordering object properties will change outliner behavior. It also means that Warp modifier for eg, you will be able to set the From but never the To field.

not sure what you mean?
polll() will return true when a first possible object property is found, thats true but that only means the op is called at all.
The op itself will spawn a popup with every possible object property. So in your example of the Warp modifier you will be able to set the From as well as the To field.

Happy to make the other changes [inline comments] (and also noticed the rna poll functions are not really checking reliably in every case...)
So yeah, guess I'll be making one more update on this [might take a day or two] and also would like feedback from others... otherwise this will go to my list of patches applied locally...

Ah, I should have tried the patch (my bad!), OK, this is more useful.
Still have reservations (some modifiers need to have other settings changed for the object's to be useful) -

but this is at least working in a more generally useful way.

now the modifier part is fairly small and this property poll & menu code can be split out and used for constraints too.

source/blender/editors/space_outliner/outliner_edit.c
2046–2049

For me empty strings assert (using CMake's WITH_ASSERT_ABORT), just pass NULL.

Campbell Barton (campbellbarton) requested changes to this revision.Feb 10 2015, 6:11 AM
Campbell Barton (campbellbarton) edited edge metadata.
This revision now requires changes to proceed.Feb 10 2015, 6:11 AM
Philipp Oeser (lichtwerk) edited edge metadata.
  • adressed review by @Campbell Barton (campbellbarton)
  • also brought back check for ID_OB (cause rna poll is not defined for every pointer prop -- also letting e.g. texture props through the poll...)

will do the same thing for D993: Outliner: DragDrop objects to constraints (to assign constraint target) now and split of the code that can be shared between the two...

Campbell Barton (campbellbarton) requested changes to this revision.Feb 11 2015, 6:19 PM
Campbell Barton (campbellbarton) edited edge metadata.

Can the diff for constraints be moved into this patch, the logic for object menu be shared between them?

Then I think this will be OK for master.

This revision now requires changes to proceed.Feb 11 2015, 6:19 PM
Philipp Oeser (lichtwerk) edited edge metadata.

review by @Campbell Barton (campbellbarton):

  • constraints functionality moved into this patch
  • shared logic for poll and menu creation between the two
Philipp Oeser (lichtwerk) retitled this revision from Outliner: DragDrop objects to modifiers to Outliner: DragDrop objects to modifiers and constraints.Feb 12 2015, 5:57 PM
Philipp Oeser (lichtwerk) updated this object.
Philipp Oeser (lichtwerk) edited edge metadata.
Philipp Oeser (lichtwerk) planned changes to this revision.Aug 16 2021, 3:35 PM

Maybe again at some other point in time.