[Bf-blender-cvs] [dc6cdfb8d54] lanpr-under-gp: Merge remote-tracking branch 'origin/master' into lanpr-under-gp
YimingWu
noreply at git.blender.org
Tue Sep 15 07:34:37 CEST 2020
Commit: dc6cdfb8d543de9bb21ebc00cdbac5441274473c
Author: YimingWu
Date: Tue Sep 15 13:34:20 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBdc6cdfb8d543de9bb21ebc00cdbac5441274473c
Merge remote-tracking branch 'origin/master' into lanpr-under-gp
===================================================================
===================================================================
diff --cc source/blender/editors/space_buttons/space_buttons.c
index b77665c369b,377a9a6c1e4..3d236a4c51d
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@@ -234,76 -230,58 +234,64 @@@ int ED_buttons_tabs_list(SpacePropertie
return length;
}
- static void buttons_main_region_layout_properties(const bContext *C,
- SpaceProperties *sbuts,
- ARegion *region)
+ static const char *buttons_main_region_context_string(const short mainb)
{
- buttons_context_compute(C, sbuts);
-
- const char *contexts[2] = {NULL, NULL};
-
- switch (sbuts->mainb) {
+ switch (mainb) {
case BCONTEXT_SCENE:
- contexts[0] = "scene";
- break;
+ return "scene";
case BCONTEXT_RENDER:
- contexts[0] = "render";
- break;
+ return "render";
case BCONTEXT_OUTPUT:
- contexts[0] = "output";
- break;
+ return "output";
case BCONTEXT_VIEW_LAYER:
- contexts[0] = "view_layer";
- break;
+ return "view_layer";
case BCONTEXT_WORLD:
- contexts[0] = "world";
- break;
-
+ return "world";
+ case BCONTEXT_COLLECTION:
+#ifdef WITH_LINEART
- contexts[0] = "collection";
++ return "collection";
+#else
+ BLI_assert(!"'WITH_LINEART' disabled - should not possible to access 'BCONTEXT_COLLECTION'");
+#endif
- break;
case BCONTEXT_OBJECT:
- contexts[0] = "object";
- break;
+ return "object";
case BCONTEXT_DATA:
- contexts[0] = "data";
- break;
+ return "data";
case BCONTEXT_MATERIAL:
- contexts[0] = "material";
- break;
+ return "material";
case BCONTEXT_TEXTURE:
- contexts[0] = "texture";
- break;
+ return "texture";
case BCONTEXT_PARTICLE:
- contexts[0] = "particle";
- break;
+ return "particle";
case BCONTEXT_PHYSICS:
- contexts[0] = "physics";
- break;
+ return "physics";
case BCONTEXT_BONE:
- contexts[0] = "bone";
- break;
+ return "bone";
case BCONTEXT_MODIFIER:
- contexts[0] = "modifier";
- break;
+ return "modifier";
case BCONTEXT_SHADERFX:
- contexts[0] = "shaderfx";
- break;
+ return "shaderfx";
case BCONTEXT_CONSTRAINT:
- contexts[0] = "constraint";
- break;
+ return "constraint";
case BCONTEXT_BONE_CONSTRAINT:
- contexts[0] = "bone_constraint";
- break;
+ return "bone_constraint";
case BCONTEXT_TOOL:
- contexts[0] = "tool";
- break;
+ return "tool";
}
+ /* All the cases should be handled. */
+ BLI_assert(false);
+ return "";
+ }
+
+ static void buttons_main_region_layout_properties(const bContext *C,
+ SpaceProperties *sbuts,
+ ARegion *region)
+ {
+ buttons_context_compute(C, sbuts);
+
+ const char *contexts[2] = {buttons_main_region_context_string(sbuts->mainb), NULL};
+
ED_region_panels_layout_ex(C, region, ®ion->type->paneltypes, contexts, NULL);
}
More information about the Bf-blender-cvs
mailing list