Custom UI Button Not Respecting Render Layer Settings #36710

Closed
opened 2013-09-12 15:01:48 +02:00 by Jaroslav Novotny · 5 comments

%%%--- Operating System, Graphics card ---
win 7 64 bit, GeForce GTX680

- Blender version with error, and version that worked ---

2.68a r58537

- Short description of error ---

Custom UI render button will render wrong layer (renders selected layer of 3D viewport containing button) instead of rendering layer thats set in Render Layer panel.

Some other commands other then bpy.ops.render.render() might be affected when placed inside UI element.

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

Open attached file, Custom UI Render Button should be created in View 3D Property Panel
Left 3D window renders nothing (renders empty 2nd layer)
Right 3D window renders cube in 1st layer%%%

%%%--- Operating System, Graphics card --- win 7 64 bit, GeForce GTX680 - Blender version with error, and version that worked --- 2.68a r58537 - Short description of error --- Custom UI render button will render wrong layer (renders selected layer of 3D viewport containing button) instead of rendering layer thats set in Render Layer panel. Some other commands other then bpy.ops.render.render() might be affected when placed inside UI element. - Steps for others to reproduce the error (preferably based on attached .blend file) --- Open attached file, Custom UI Render Button should be created in View 3D Property Panel Left 3D window renders nothing (renders empty 2nd layer) Right 3D window renders cube in 1st layer%%%

Changed status to: 'Open'

Changed status to: 'Open'

%%%This is a feature, when the 3d view layers are decoupled from the scene layers and your mouse is over the 3D view or the render operator is called from within it, the render operator will render with the layers from the 3D view. It's quite useful for quickly rendering different elements though confusing if you don't know it.%%%

%%%This is a feature, when the 3d view layers are decoupled from the scene layers and your mouse is over the 3D view or the render operator is called from within it, the render operator will render with the layers from the 3D view. It's quite useful for quickly rendering different elements though confusing if you don't know it.%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

%%%Hi Brecht, well i disagree. Here is why:

  • when i decouple 3d view layers from scene layers, in 3d view I want to see something else and render something else. If I wanted behaviour you described i would leave them coupled. (and yes, when coupled you cannot have multiple 3d views with different view layers and put mouse inside any viewport and hit f12 to render that window, i know, see next... also we have rendered view now, but its a new feature)

  • global render command should render what is in Render Layers, thats what my report is all about. if it doesn't, it's definitely not a feature. I would expect some parameter to be passed to render just the 3d view, that would be a nice feature you are describing.

  • with behaviour like it is now, its complicated to write any batch render script and put it inside 3d view gui with layers decoupled. The viewport layers then must be set by code prior to every batch pass and then returned back. Someone else that uses the .blend file not good with scripts will have problems changing the code, would be easier for him to change the scene layers if it worked.

Well these are my arguments. I understand what you said, but the way the code behaves now is illogical (i like how it behaves with mouse cursor, i dont like how the code works) Took me some time to figure out whats going on. I am sure other people could be having problems with global code calls secretly dependent from within where they were called in future. I dont know how much rework would it require, but please consider removing this ugly behaviour from blender API ;)

Regards, Jerry%%%

%%%Hi Brecht, well i disagree. Here is why: - when i decouple 3d view layers from scene layers, in 3d view I want to see something else and render something else. If I wanted behaviour you described i would leave them coupled. (and yes, when coupled you cannot have multiple 3d views with different view layers and put mouse inside any viewport and hit f12 to render that window, i know, see next... also we have rendered view now, but its a new feature) - global render command should render what is in Render Layers, thats what my report is all about. if it doesn't, it's definitely not a feature. I would expect some parameter to be passed to render just the 3d view, that would be a nice feature you are describing. - with behaviour like it is now, its complicated to write any batch render script and put it inside 3d view gui with layers decoupled. The viewport layers then must be set by code prior to every batch pass and then returned back. Someone else that uses the .blend file not good with scripts will have problems changing the code, would be easier for him to change the scene layers if it worked. Well these are my arguments. I understand what you said, but the way the code behaves now is illogical (i like how it behaves with mouse cursor, i dont like how the code works) Took me some time to figure out whats going on. I am sure other people could be having problems with global code calls secretly dependent from within where they were called in future. I dont know how much rework would it require, but please consider removing this ugly behaviour from blender API ;) Regards, Jerry%%%

%%%I've added a use_viewport option to the operator now, which is disabled by default for scripts, so that should fix the issue for you.

Be careful assuming things about operator context though, you may think it's a 'global' render command, but operators in general always execute within the current context by default, unless you specify otherwise. They are actually tools for the user in the first place.%%%

%%%I've added a use_viewport option to the operator now, which is disabled by default for scripts, so that should fix the issue for you. Be careful assuming things about operator context though, you may think it's a 'global' render command, but operators in general always execute within the current context by default, unless you specify otherwise. They are actually tools for the user in the first place.%%%
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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-addons#36710
No description provided.