Properties panel Pinning is broken #39562

Closed
opened 2014-04-02 14:52:14 +02:00 by Maverick · 10 comments

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.

**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.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @dragostanasie

Added subscriber: @dragostanasie

Added subscriber: @mont29

Added subscriber: @mont29
Bastien Montagne self-assigned this 2014-04-02 15:46:56 +02:00

Added subscriber: @brecht

Added subscriber: @brecht

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…

P32: Fix #39562

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;

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… [P32: Fix #39562](https://archive.blender.org/developer/P32.txt) ```diff 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; ```

Looks good to me.

Looks good to me.

This issue was referenced by blender/blender-addons-contrib@95b25e7333

This issue was referenced by blender/blender-addons-contrib@95b25e7333c4ac9077812b06cfa203ffcbab26a5

This issue was referenced by 95b25e7333

This issue was referenced by 95b25e7333c4ac9077812b06cfa203ffcbab26a5

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 95b25e7333.

Closed by commit 95b25e7333.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#39562
No description provided.