Collection visibility not working when render opengl using python #53618

Closed
opened 2017-12-23 12:28:04 +01:00 by Antonio Vazquez · 16 comments

System Information
Windows 10 / Ubuntu

Blender Version
Blender 2.8 2012-12-22 21:18

Short description of error

If disable a collection and render opengl using button, the hidden collection is not visible, but running the operator using python, the disable collection is render.

  1. Open attached file
  2. Press opengll render button
  3. Run script and compare results.

After running the script,the collection is visible, but the hidden flag is still disabled in outline and the flag is not working fine anymore. I have noticed that if you save the file and open again, the flag is disabled but the collection is still visisble.

Using button
Using_Button.png

Using script
Using_Python.png

OpenGL_Render_Test.blend

**System Information** Windows 10 / Ubuntu **Blender Version** Blender 2.8 2012-12-22 21:18 **Short description of error** If disable a collection and render opengl using button, the hidden collection is not visible, but running the operator using python, the disable collection is render. 1) Open attached file 2) Press opengll render button 3) Run script and compare results. After running the script,the collection is visible, but the hidden flag is still disabled in outline and the flag is not working fine anymore. I have noticed that if you save the file and open again, the flag is disabled but the collection is still visisble. Using button ![Using_Button.png](https://archive.blender.org/developer/F1502110/Using_Button.png) Using script ![Using_Python.png](https://archive.blender.org/developer/F1502114/Using_Python.png) [OpenGL_Render_Test.blend](https://archive.blender.org/developer/F1502130/OpenGL_Render_Test.blend)
Author
Member

Added subscriber: @antoniov

Added subscriber: @antoniov
Author
Member

Added subscriber: @pepe-school-land

Added subscriber: @pepe-school-land

Added subscriber: @dfelinto

Added subscriber: @dfelinto
Dalai Felinto self-assigned this 2017-12-23 12:46:46 +01:00

Can you paste the script content here? This way I may be able to help without going to the computer and opening the file.

Can you paste the script content here? This way I may be able to help without going to the computer and opening the file.
Author
Member

The script is only this:

import bpy
bpy.ops.render.opengl(write_still=True)

The script is only this: import bpy bpy.ops.render.opengl(write_still=True)
Author
Member

@dfelinto Really, the "real" script is longer and is to help the Hero team with compositing., but I have reduced it to find the line with problems, so you can reproduce the error with this tiny script.

@dfelinto Really, the "real" script is longer and is to help the Hero team with compositing., but I have reduced it to find the line with problems, so you can reproduce the error with this tiny script.

Let me rephrase it, can it be reproduced from scratch?

Let me rephrase it, can it be reproduced from scratch?
Author
Member

To reproduce:

  1. Open default
  2. Add new collection
  3. Add suzanne in new collection
  4. Disable collection 1 (with default cube)
  5. Press render opengl button

Now, create the simple script and run it. You will see in the result of script that Cube is not hidden, but in the result of pressing the button, the Cube is hidden as expected.

To reproduce: 1) Open default 2) Add new collection 3) Add suzanne in new collection 4) Disable collection 1 (with default cube) 5) Press render opengl button Now, create the simple script and run it. You will see in the result of script that Cube is not hidden, but in the result of pressing the button, the Cube is hidden as expected.

Added subscriber: @Sergey

Added subscriber: @Sergey

Confirmed, it feels like OpenGL render via script is making all objects visible doesn't matter what. Looking into it.

Confirmed, it feels like OpenGL render via script is making all objects visible doesn't matter what. Looking into it.

@antoniov for now can they delete the view layers they are not using? This should be a workaround until we fix this issue.

@antoniov for now can they delete the view layers they are not using? This should be a workaround until we fix this issue.
Author
Member

@dfelinto I don't think he can delete them.

The script I did is to generate separated images to make composition.

The scene is very complex with a mixture of 3D objects and GP drawings. To make the compositing, each element must be in a separated image (something like renderlayers), but as renderlayers is not working for GP, we need the script or make it all manually.

@pepe-school-land What do you think?

@dfelinto I don't think he can delete them. The script I did is to generate separated images to make composition. The scene is very complex with a mixture of 3D objects and GP drawings. To make the compositing, each element must be in a separated image (something like renderlayers), but as renderlayers is not working for GP, we need the script or make it all manually. @pepe-school-land What do you think?

@antoniov change your script to do: bpy.ops.render.opengl('INVOKE_DEFAULT', write_still=True);
The issue I believe has to do with copy-on-write (or the lack of).

@antoniov change your script to do: `bpy.ops.render.opengl('INVOKE_DEFAULT', write_still=True);` The issue I believe has to do with copy-on-write (or the lack of).

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

I will even close it. This will be fixed once we get copy on write by default (I belive).

I will even close it. This will be fixed once we get copy on write by default (I belive).
Author
Member

@dfelinto Thanks for the idea, I'm going to test.

I think is good idea to close this bug. Really, it's a "ToDo".

@dfelinto Thanks for the idea, I'm going to test. I think is good idea to close this bug. Really, it's a "ToDo".
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
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#53618
No description provided.