Maniphest T39562

Properties panel Pinning is broken
Closed, Resolved

Assigned To
Bastien Montagne (mont29)
Authored By
Maverick (maverick)
Apr 2 2014, 2:52 PM
Tags
  • User Interface
  • BF Blender
Subscribers
Bastien Montagne (mont29)
Brecht Van Lommel (brecht)
Maverick (maverick)

Description

System Information
win7 64bit gtx titan i7

Blender Version
blender-2.70-6aa75d3-win64

Short description of error
Pin does not work when you have multiple scenes.

Exact steps for others to reproduce the error
Just create a new scene (Scene2) and change some settings, like disable the anti-aliasing.
Go back to the first scene(Scene1) and pin it.
Now if you change to Scene2 the Properties panel shows the name of the pinned scene (Scene1) but the panels are from Scene2..

Thank you.

Revisions and Commits

rB Blender
rBAC Blender Add-ons Contrib

Event Timeline

Maverick (maverick) created this task.Apr 2 2014, 2:52 PM
Maverick (maverick) raised the priority of this task from to 90.
Maverick (maverick) updated the task description.
Maverick (maverick) added a project: User Interface.
Maverick (maverick) edited a custom field.
Maverick (maverick) added a subscriber: Maverick (maverick).
Bastien Montagne (mont29) claimed this task.Apr 2 2014, 3:46 PM
Bastien Montagne (mont29) lowered the priority of this task from 90 to Normal.
Bastien Montagne (mont29) added a project: BF Blender.
Bastien Montagne (mont29) added a subscriber: Bastien Montagne (mont29).
Bastien Montagne (mont29) added a subscriber: Brecht Van Lommel (brecht).Apr 6 2014, 12:35 PM

The following patch fix it (scene were simply ignored in the pinning handling process in buttons).

Now I’d rather get Brecht’s green light before committing this, esp. as I had to add a small "hack" to CTX_data_scene(), else it would crash on startup. I would assume it is safe, since Blender cannot work without a valid Scene anyway, but…

1diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
2index eeb1f4b..9dc6242 100644
3--- a/source/blender/blenkernel/intern/context.c
4+++ b/source/blender/blenkernel/intern/context.c
5@@ -873,7 +873,7 @@ Scene *CTX_data_scene(const bContext *C)
6 {
7 Scene *scene;
8
9- if (ctx_data_pointer_verify(C, "scene", (void *)&scene))
10+ if (ctx_data_pointer_verify(C, "scene", (void *)&scene) && scene)
11 return scene;
12 else
13 return C->data.scene;
14diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
15index a14ed72..f71ffd8 100644
16--- a/source/blender/editors/space_buttons/buttons_context.c
17+++ b/source/blender/editors/space_buttons/buttons_context.c
18@@ -656,7 +656,7 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
19 /************************* Context Callback ************************/
20
21 const char *buttons_context_dir[] = {
22- "texture_slot", "world", "object", "mesh", "armature", "lattice", "curve",
23+ "texture_slot", "scene", "world", "object", "mesh", "armature", "lattice", "curve",
24 "meta_ball", "lamp", "speaker", "camera", "material", "material_slot",
25 "texture", "texture_user", "texture_user_property", "bone", "edit_bone",
26 "pose_bone", "particle_system", "particle_system_editable", "particle_settings",
27@@ -681,6 +681,10 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
28 CTX_data_dir_set(result, buttons_context_dir);
29 return 1;
30 }
31+ else if (CTX_data_equals(member, "scene")) {
32+ set_pointer_type(path, result, &RNA_Scene);
33+ return 1;
34+ }
35 else if (CTX_data_equals(member, "world")) {
36 set_pointer_type(path, result, &RNA_World);
37 return 1;

Brecht Van Lommel (brecht) added a comment.Apr 7 2014, 12:35 AM

Looks good to me.

Bastien Montagne (mont29) edited this Maniphest Task.Apr 7 2014, 12:25 PM
Bastien Montagne (mont29) changed the task status from Unknown Status to Resolved.Apr 7 2014, 12:25 PM

Closed by commit rB95b25e7333c4.

Bastien Montagne (mont29) edited this Maniphest Task.May 12 2014, 4:47 PM