This is very early version of override, obviously still very basic, limited and un-finished! Goal of this review is to ensure we agree on general code design for the feature, before starting implementing it fully.
This patch is hopefully not cluttered by too much 'details noise', and make general process to handle static override quite easy to follow.
Reminder: “static override” only allows overriding linked data. Since those do not change, we can evaluate static overrides once (when loading .blend, or re-loading a library). This could also be named 'partially localized data-blocks'. On the other hand, “dynamic override” would allow overriding local data, and would be handled by the depsgraph evaluation to generate final data.
A large part of the code should be sharable between both though, if we use same process (based on rna paths), only the place where application of override happens would change…
Right now, only object's location is overridden, you can test the code by:
- Starting blender with new depsgraph (mandatory, automated override creation is not hooked into old one).
- linking an object;
- make an override of it (through operator in space-bar search menu);
- change e.g. location, rotation and/or scale of the override;
- save file;
- open file again, and see that changed location/rotation/scale were kept.
You may also note that non-overridable properties remain grayed-out in UI.
Further more, to test & demonstrate differential override, scale is currently stored as a multiplication factor, which means that if you scale up or down your object in library file, it will scale accordingly in its overriden copy (once file is reloaded of course).
PS: for now, this is based on master, we can always merge blender2.8 in later when required...