[Bf-blender-cvs] [95b25e7] master: Fix T39562: Properties panel Pinning is broken

Bastien Montagne noreply at git.blender.org
Mon Apr 7 12:24:33 CEST 2014


Commit: 95b25e7333c4ac9077812b06cfa203ffcbab26a5
Author: Bastien Montagne
Date:   Mon Apr 7 12:23:24 2014 +0200
https://developer.blender.org/rB95b25e7333c4ac9077812b06cfa203ffcbab26a5

Fix T39562: Properties panel Pinning is broken

'scene' was simply not handled in button context.

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

M	source/blender/blenkernel/intern/context.c
M	source/blender/editors/space_buttons/buttons_context.c

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

diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index eeb1f4b..9dc6242 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -873,7 +873,7 @@ Scene *CTX_data_scene(const bContext *C)
 {
 	Scene *scene;
 
-	if (ctx_data_pointer_verify(C, "scene", (void *)&scene))
+	if (ctx_data_pointer_verify(C, "scene", (void *)&scene) && scene)
 		return scene;
 	else
 		return C->data.scene;
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index a14ed72..f71ffd8 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -656,7 +656,7 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
 /************************* Context Callback ************************/
 
 const char *buttons_context_dir[] = {
-	"texture_slot", "world", "object", "mesh", "armature", "lattice", "curve",
+	"texture_slot", "scene", "world", "object", "mesh", "armature", "lattice", "curve",
 	"meta_ball", "lamp", "speaker", "camera", "material", "material_slot",
 	"texture", "texture_user", "texture_user_property", "bone", "edit_bone",
 	"pose_bone", "particle_system", "particle_system_editable", "particle_settings",
@@ -681,6 +681,10 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
 			CTX_data_dir_set(result, buttons_context_dir);
 		return 1;
 	}
+	else if (CTX_data_equals(member, "scene")) {
+		set_pointer_type(path, result, &RNA_Scene);
+		return 1;
+	}
 	else if (CTX_data_equals(member, "world")) {
 		set_pointer_type(path, result, &RNA_World);
 		return 1;




More information about the Bf-blender-cvs mailing list