Can't sort Linked objects transparency in viewport #51964

Closed
opened 2017-07-03 13:23:45 +02:00 by Corrado Piscitelli · 11 comments

Blender Version
Broken: 2.76 f337fea and above

Short description of error
It seems that object transparency sorting is directly related to object creation order.
This behaviour makes impossible to correctly sort the objects transparency in linked dupligroups.
Even if a possible workaround is to manually delete in the source file all the meshes and recreate them in the desired order, this is not a handy way of dealing with very complex files with multiple dupligroups and links.source.blend

scene.blend

Exact steps for others to reproduce the error
Open the included scene.blend file and you'll see on the left a CubeMonkey geometry and on the right a MonkeyCube one.
They are both linked from the included source.blend file.
The CubeMonkey dupligroup has inside two meshes, a cube and a suzanne, with the cube, having a transparent material, created before the monkey.
The MonkeyCube dupligroup has inside a duplicate of those meshes, but the cube duplicate was created after the monkey one.
As you can see, transparency works only if the object with the transparent material is created first.

**Blender Version** Broken: 2.76 f337fea and above **Short description of error** It seems that object transparency sorting is directly related to object creation order. This behaviour makes impossible to correctly sort the objects transparency in linked dupligroups. Even if a possible workaround is to manually delete in the source file all the meshes and recreate them in the desired order, this is not a handy way of dealing with very complex files with multiple dupligroups and links.[source.blend](https://archive.blender.org/developer/F650638/source.blend) [scene.blend](https://archive.blender.org/developer/F650637/scene.blend) **Exact steps for others to reproduce the error** Open the included scene.blend file and you'll see on the left a CubeMonkey geometry and on the right a MonkeyCube one. They are both linked from the included source.blend file. The CubeMonkey dupligroup has inside two meshes, a cube and a suzanne, with the cube, having a transparent material, created before the monkey. The MonkeyCube dupligroup has inside a duplicate of those meshes, but the cube duplicate was created after the monkey one. As you can see, transparency works only if the object with the transparent material is created first.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @CorradoPiscitelli

Added subscriber: @CorradoPiscitelli

Added subscribers: @icappiello, @PaoloAcampora

Added subscribers: @icappiello, @PaoloAcampora

Added subscriber: @mont29

Added subscriber: @mont29

Also depends on active object in source file…

Not sure, but would say this is limitation of OpenGL code in 2.7x series, especially for BI? Maybe some OGL guys around know better…

Also depends on active object in source file… Not sure, but would say this is limitation of OpenGL code in 2.7x series, especially for BI? Maybe some OGL guys around know better…
Member

as most developers soon find out
sorting.jpg

transparency sorting is one of the hardest problems in computer graphics, so we cannot blame blender for not being able to visualize a bunch of semitrasparent monkeys dancing in a row.

The way blender resolves which objects are to be rendered in a different pass is "asking", i.e. the user is required to flag wether an object is transparent or not.

The "bug" with dupligroups is that such setting is ignored, and semitransparent objects are rendered in the same pass as the opaque ones, so it would be nice to fix at least that.

A temporary workaround is a script in scene.blend that sorts the objects inside a dupligroup

import bpy

for grp in bpy.data.groups:
    for ob in reversed(grp.objects[:-1]):
        if ob.show_transparent:
            # make it last object
            grp.objects.unlink(ob)
            grp.objects.link(ob)

different dupligroups will still overlap, but at least you will be able to animate characters with glasses or other common scenarios (need to check transparency on the cube in source.blend, otherwise it won't work)

as most developers soon find out ![sorting.jpg](https://archive.blender.org/developer/F650917/sorting.jpg) transparency sorting is one of the hardest problems in computer graphics, so we cannot blame blender for not being able to visualize a bunch of semitrasparent monkeys dancing in a row. The way blender resolves which objects are to be rendered in a different pass is "asking", i.e. the user is required to flag wether an object is transparent or not. The "bug" with dupligroups is that such setting is ignored, and semitransparent objects are rendered in the same pass as the opaque ones, so it would be nice to fix at least that. A temporary workaround is a script in scene.blend that sorts the objects inside a dupligroup ``` import bpy for grp in bpy.data.groups: for ob in reversed(grp.objects[:-1]): if ob.show_transparent: # make it last object grp.objects.unlink(ob) grp.objects.link(ob) ``` different dupligroups will still overlap, but at least you will be able to animate characters with glasses or other common scenarios (need to check transparency on the cube in source.blend, otherwise it won't work)
Member

@PaoloAcampora, i remember you wrote for us a patch to fix that while we were rendering our animated feature GL previews. I think it's here https://developer.blender.org/T48983. @mont29 We are stil using it in studio, even if rejected (and still unclear to me why) i think it could be at least a good starting point to address the issue, can you please consider it?

@PaoloAcampora, i remember you wrote for us a patch to fix that while we were rendering our animated feature GL previews. I think it's here https://developer.blender.org/T48983. @mont29 We are stil using it in studio, even if rejected (and still unclear to me why) i think it could be at least a good starting point to address the issue, can you please consider it?

I think this should be tested against Eevee engine in Blender2.8 then, really not worth spending time on this for BI currently, since it's doomed to be removed.

Anyway, thanks for pointers to older reports, will merge that one then.

I think this should be tested against Eevee engine in Blender2.8 then, really not worth spending time on this for BI currently, since it's doomed to be removed. Anyway, thanks for pointers to older reports, will merge that one then.

Closed as duplicate of #43093

Closed as duplicate of #43093
Member

@mont29 since 2.79 is going to be last stable build till the official 2.8 release, i thought it could be worth a look at this patch since, even if doomed, BI will stay as long as needed to make 2.8 stable. What benefit could come from not having a workaround for that issue in 2.79 as long as it doesn't break anything else?

@mont29 since 2.79 is going to be last stable build till the official 2.8 release, i thought it could be worth a look at this patch since, even if doomed, BI will stay as long as needed to make 2.8 stable. What benefit could come from not having a workaround for that issue in 2.79 as long as it doesn't break anything else?
Member

while this report is indeed about a transparency issue, this one is different as it is not about having a better sorting in blender (not going to happen anytime soon), but about the "transparent" flag being ignored when dupligroups are visualized.

It's not blender lacking a feature, it's blender not honouring its own drawing settings

while this report is indeed about a transparency issue, this one is different as it is not about having a better sorting in blender (not going to happen anytime soon), but about the "transparent" flag being ignored when dupligroups are visualized. It's not blender lacking a feature, it's blender not honouring its own drawing settings
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#51964
No description provided.