Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-03-15 20:43:26 +0300
committerJulian Eisel <julian@blender.org>2022-03-15 20:48:52 +0300
commitd8e3bcf770c25b0780b2c35a72afae00171ba914 (patch)
tree521ff41e4a4e8cd7c77e0f4ec51187f01ceb897b /source/blender/editors/interface
parent7f77bd95d982279766c2bfb38829b18fdbe55f02 (diff)
Outliner: Display buttons to edit library override properties
As proposed in T95802, this adds buttons to a new column on the right to modify the override in the Library Override display mode. Some further usability improvements are planned. E.g. this does not yet expand collections (modifiers, constraints, etc) nicely or group modified properties of a modifier together. Vector properties with more than 3 items or matrices aren't displayed nicely yet, they are just squeezed into the column. If this actually becomes a problem there are some ideas to address this. Differential Revision: https://developer.blender.org/D14268
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_utils.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 814bd956096..728d42a9353 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -320,6 +320,7 @@ uiBut *uiDefAutoButR(uiBlock *block,
-1,
-1,
NULL);
+ ui_but_add_search(but, ptr, prop, NULL, NULL);
break;
}
case PROP_COLLECTION: {
@@ -338,6 +339,29 @@ uiBut *uiDefAutoButR(uiBlock *block,
return but;
}
+void uiDefAutoButsArrayR(uiBlock *block,
+ PointerRNA *ptr,
+ PropertyRNA *prop,
+ const int icon,
+ const int x,
+ const int y,
+ const int tot_width,
+ const int height)
+{
+ const int len = RNA_property_array_length(ptr, prop);
+ if (len == 0) {
+ return;
+ }
+
+ const int item_width = tot_width / len;
+
+ UI_block_align_begin(block);
+ for (int i = 0; i < len; i++) {
+ uiDefAutoButR(block, ptr, prop, i, "", icon, x + i * item_width, y, item_width, height);
+ }
+ UI_block_align_end(block);
+}
+
eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout,
PointerRNA *ptr,
bool (*check_prop)(PointerRNA *ptr,