Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_layout.cc
| Show First 20 Lines • Show All 3,133 Lines • ▼ Show 20 Lines | if (ELEM(nullptr, ptr, prop) || !RNA_property_animateable(ptr, prop)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const bool is_expand = ui_item_rna_is_expand(prop, index, 0); | const bool is_expand = ui_item_rna_is_expand(prop, index, 0); | ||||
| const bool is_array = RNA_property_array_check(prop); | const bool is_array = RNA_property_array_check(prop); | ||||
| /* Loop for the array-case, but only do in case of an expanded array. */ | /* Loop for the array-case, but only do in case of an expanded array. */ | ||||
| for (int i = 0; i < (is_expand ? RNA_property_array_length(ptr, prop) : 1); i++) { | for (int i = 0; i < (is_expand ? RNA_property_array_length(ptr, prop) : 1); i++) { | ||||
| uiButDecorator *decorator_but = (uiButDecorator *)uiDefIconBut(block, | uiButDecorator *but = (uiButDecorator *)uiDefIconBut(block, | ||||
| UI_BTYPE_DECORATOR, | UI_BTYPE_DECORATOR, | ||||
| 0, | 0, | ||||
| ICON_DOT, | ICON_DOT, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| UI_UNIT_X, | UI_UNIT_X, | ||||
| UI_UNIT_Y, | UI_UNIT_Y, | ||||
| nullptr, | nullptr, | ||||
| 0.0, | 0.0, | ||||
| 0.0, | 0.0, | ||||
| 0.0, | 0.0, | ||||
| 0.0, | 0.0, | ||||
| TIP_("Animate property")); | TIP_("Animate property")); | ||||
| UI_but_func_set(&decorator_but->but, ui_but_anim_decorate_cb, decorator_but, nullptr); | UI_but_func_set(but, ui_but_anim_decorate_cb, but, nullptr); | ||||
| decorator_but->but.flag |= UI_BUT_UNDO | UI_BUT_DRAG_LOCK; | but->flag |= UI_BUT_UNDO | UI_BUT_DRAG_LOCK; | ||||
| /* Reusing RNA search members, setting actual RNA data has many side-effects. */ | /* Reusing RNA search members, setting actual RNA data has many side-effects. */ | ||||
| decorator_but->rnapoin = *ptr; | but->rnapoin = *ptr; | ||||
| decorator_but->rnaprop = prop; | but->rnaprop = prop; | ||||
| /* ui_def_but_rna() sets non-array buttons to have a RNA index of 0. */ | /* ui_def_but_rna() sets non-array buttons to have a RNA index of 0. */ | ||||
| decorator_but->rnaindex = (!is_array || is_expand) ? i : index; | but->rnaindex = (!is_array || is_expand) ? i : index; | ||||
| } | } | ||||
| } | } | ||||
| void uiItemDecoratorR(uiLayout *layout, PointerRNA *ptr, const char *propname, int index) | void uiItemDecoratorR(uiLayout *layout, PointerRNA *ptr, const char *propname, int index) | ||||
| { | { | ||||
| PropertyRNA *prop = nullptr; | PropertyRNA *prop = nullptr; | ||||
| if (ptr && propname) { | if (ptr && propname) { | ||||
| ▲ Show 20 Lines • Show All 2,985 Lines • Show Last 20 Lines | |||||