[Bf-blender-cvs] [a77c3d5cb31] greasepencil-object: Fix: Pinning GP Object data in Properties Editor wasn't showing the GP Data tab

Joshua Leung noreply at git.blender.org
Tue Jul 10 09:15:14 CEST 2018


Commit: a77c3d5cb31feaaea0c796d372134df8400f30ff
Author: Joshua Leung
Date:   Tue Jul 10 17:59:45 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBa77c3d5cb31feaaea0c796d372134df8400f30ff

Fix: Pinning GP Object data in Properties Editor wasn't showing the GP Data tab

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

M	source/blender/editors/space_buttons/buttons_context.c

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

diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 8d8af62f4c5..67632f6a53a 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -237,6 +237,7 @@ static int buttons_context_path_data(ButsContextPath *path, int type)
 	else if (RNA_struct_is_a(ptr->type, &RNA_Light) && (type == -1 || type == OB_LAMP)) return 1;
 	else if (RNA_struct_is_a(ptr->type, &RNA_Speaker) && (type == -1 || type == OB_SPEAKER)) return 1;
 	else if (RNA_struct_is_a(ptr->type, &RNA_LightProbe) && (type == -1 || type == OB_LIGHTPROBE)) return 1;
+	else if (RNA_struct_is_a(ptr->type, &RNA_GreasePencil) && (type == -1 || type == OB_GPENCIL)) return 1;
 	/* try to get an object in the path, no pinning supported here */
 	else if (buttons_context_path_object(path)) {
 		ob = path->ptr[path->len - 1].data;
@@ -571,13 +572,14 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
 			found = buttons_context_path_particle(path);
 			break;
 		case BCONTEXT_MATERIAL:
-			/* the colors of grease pencil are not real materials, but to keep UI consistency, we
-			   simulate and generate a path */
+			/* NOTE: Grease Pencil materials use different panels... */
 			if (ob && ob->type == OB_GPENCIL) {
+				/* XXX: Why path_data? */
 				found = buttons_context_path_data(path, -1);
-				break;
 			}
-			found = buttons_context_path_material(path);
+			else {
+				found = buttons_context_path_material(path);
+			}
 			break;
 		case BCONTEXT_TEXTURE:
 			found = buttons_context_path_texture(C, path, sbuts->texuser);



More information about the Bf-blender-cvs mailing list