diff options
author | Jacques Lucke <jacques@blender.org> | 2021-10-25 13:46:28 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-10-25 13:46:39 +0300 |
commit | 06ae3c98ebf549959454e25b0fb7fd8a0405af76 (patch) | |
tree | c8ac65941acee241368dacf657f7da2d9f04ae46 /source | |
parent | 892e5f4a9f8a3f4e67a6ff00e4195b628decc127 (diff) |
Spreadsheet: fix updating active domain when component type changes
The mesh and instances case wasn't handled before.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index c91ef25daa8..03976967e9f 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -3074,12 +3074,34 @@ static void rna_SpaceSpreadsheet_geometry_component_type_update(Main *UNUSED(bma PointerRNA *ptr) { SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data; - if (sspreadsheet->geometry_component_type == GEO_COMPONENT_TYPE_POINT_CLOUD) { - sspreadsheet->attribute_domain = ATTR_DOMAIN_POINT; - } - if (sspreadsheet->geometry_component_type == GEO_COMPONENT_TYPE_CURVE && - !ELEM(sspreadsheet->attribute_domain, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CURVE)) { - sspreadsheet->attribute_domain = ATTR_DOMAIN_POINT; + switch (sspreadsheet->geometry_component_type) { + case GEO_COMPONENT_TYPE_MESH: { + if (!ELEM(sspreadsheet->attribute_domain, + ATTR_DOMAIN_POINT, + ATTR_DOMAIN_EDGE, + ATTR_DOMAIN_FACE, + ATTR_DOMAIN_CORNER)) { + sspreadsheet->attribute_domain = ATTR_DOMAIN_POINT; + } + break; + } + case GEO_COMPONENT_TYPE_POINT_CLOUD: { + sspreadsheet->attribute_domain = ATTR_DOMAIN_POINT; + break; + } + case GEO_COMPONENT_TYPE_INSTANCES: { + sspreadsheet->attribute_domain = ATTR_DOMAIN_POINT; + break; + } + case GEO_COMPONENT_TYPE_VOLUME: { + break; + } + case GEO_COMPONENT_TYPE_CURVE: { + if (!ELEM(sspreadsheet->attribute_domain, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CURVE)) { + sspreadsheet->attribute_domain = ATTR_DOMAIN_POINT; + } + break; + } } } |