[Bf-blender-cvs] [570331ca96a] blender-v3.0-release: Fix T92928: Geometry nodes animation decorator wrong for vectors

Philipp Oeser noreply at git.blender.org
Tue Nov 9 17:06:48 CET 2021


Commit: 570331ca96a5e7a30c8896a07aad1960d5bd706e
Author: Philipp Oeser
Date:   Tue Nov 9 14:16:20 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB570331ca96a5e7a30c8896a07aad1960d5bd706e

Fix T92928: Geometry nodes animation decorator wrong for vectors

Decorators were only added for the first item of an array.

Decorators for all items of an array are added:
- if the layout is flagged `UI_ITEM_PROP_DECORATE` automatically in
`uiItemFullR` or
- calling `uiItemDecoratorR` (but only in certain situations, see below)

When calling `uiItemDecoratorR` with an index of 0, the following
happens:
- the index is passed to `uiItemDecoratorR_prop`
- that checks with `ui_item_rna_is_expand` if decorators should be added
to all items of an array
- the check fails (because it only permits RNA_NO_INDEX -- which is -1)

So two things we can do:
- remain using `uiItemDecoratorR` (that would require to pass an index
of RNA_NO_INDEX -- a bad level include -- or -1
- just use `uiLayoutSetPropDecorate` to flag the row properly

This patch does later.

Differential Revision: https://developer.blender.org/D13159

===================================================================

M	source/blender/modifiers/intern/MOD_nodes.cc

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index a48210e4cf4..6ea47881982 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -1362,8 +1362,8 @@ static void draw_property_for_socket(const bContext &C,
       }
       else {
         uiLayout *row = uiLayoutRow(layout, false);
+        uiLayoutSetPropDecorate(row, true);
         uiItemR(row, md_ptr, rna_path, 0, socket.name, ICON_NONE);
-        uiItemDecoratorR(row, md_ptr, rna_path, 0);
       }
     }
   }



More information about the Bf-blender-cvs mailing list