Page MenuHome

RNA: support setting default values for custom properties.
ClosedPublic

Authored by Alexander Gavrilov (angavrilov) on Dec 16 2018, 3:16 PM.

Details

Summary

NLA requires a usable default value for all properties that
are to be animated via it, without any exceptions. This is
the real cause of T36496: using the default of 0 for a scale
related custom property obviously doesn't work.

Thus, to really fix this it is necessary to support configurable
default values for custom properties, which are very frequently
used in rigs for auxiliary settings. For common use it is enough
to support this for scalar float and integer properties.

The default can be set via the custom property configuration
popup, or a right click menu option. In addition, to help in
updating old rigs, an operator that saves current values as
defaults for all object and bone properties is added.

Diff Detail

Repository
rB Blender
Branch
temp-angavrilov-prop-defaults (branched from blender2.8)
Build Status
Buildable 2655
Build 2655: arc lint + arc unit

Event Timeline

To elaborate on the NLA design concerns that motivate this a bit more:

NLA has a big problem that if not all actions keyframe all properties, evaluation result may depend not only on the current frame, but on the sequence of frame changes that led to it, because properties may be updated at some points in the timeline, but not others. This has awful effects on usability.

The well known workaround for this is to create a rest pose action that includes all properties that you want to use, and put it at the bottom of the stack. The obvious downside is that this is very error prone.

The only easy and reasonable solution I see to this is to basically make the workaround automatic, using the default values of properties instead of an action. With this approach, property defaults in rigs can in a way be considered to constitute a part of the rest pose.

However this means that all animatable properties now must have reasonable defaults. For transform properties this is already the case, and other RNA properties can be fixed in RNA where needed, but custom properties defined by the user through UI need a new UI mechanism to specify appropriate custom defaults.

Brecht Van Lommel (brecht) requested changes to this revision.Dec 17 2018, 1:04 PM

Overall functionality seems fine, just some comments about the UI.

release/scripts/startup/bl_operators/object.py
947

Can you extend this description to explain why this is useful for animation / NLA blending?

release/scripts/startup/bl_ui/space_view3d.py
1994

It seems rather arbitrary to have it in this menu. Wouldn't it make more sense to have it in the Custom Properties panel in the object properties?

The layout of that panel could perhaps be a bit more similar to others like Vertex Groups, with a (+) button and dropdown menu with various operations on the side.

This revision now requires changes to proceed.Dec 17 2018, 1:04 PM

Naming changes; removed the assign all defaults operator from the Object mode Ctrl-A menu.

This revision is now accepted and ready to land.Dec 19 2018, 12:02 PM
This revision was automatically updated to reflect the committed changes.