Custom UI Button Not Respecting Render Layer Settings #36710
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#36710
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%--- Operating System, Graphics card ---
win 7 64 bit, GeForce GTX680
2.68a r58537
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.
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'
%%%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'
%%%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.%%%