Page MenuHome

Viewport colour (Solid shading mode, Object color) shows one colour but another is displayed instead for more than 4096 objects
Closed, ResolvedPublic

Description

System Information
Operating system: Gentoo Linux
Graphics card:

Blender Version
Broken: (example: 2.80, edbf15d3c044, master, 2018-11-28, as found on the splash screen) 2.83.3
Worked: (newest version of Blender that worked as expected) none

See attached Blend file.

  1. Create array of 100 x 100 cubes, and split by loose parts. This creates 10,000 cube objects.
  2. Run the following script to colour the cubes randomly:
import bpy
import random
for obj in bpy.context.visible_objects:
    x = random.randint(1,4)
    if x == 1:
        obj.color = (1,0,0,.2)
    elif x == 2:
        obj.color = (0,1,0,.2)
    elif x == 3:
        obj.color = (0,0,1,.2)
    else:
        obj.color = (1,1,1,.2)
  1. You will see a colourful mosaic of cubes. However, some colours are correct, some colours are wrong. Click some cubes to check. I _think_ that after the 4,096th Cube, the colours start becoming wrong. All cubes prior to that object is the right colour. If you hide or show some cubes in the outliner, you will also see colours start randomly changing.

Event Timeline

Yes i can reproduce it


And as you said it seems like after the 4096th cube it starts to give wrong viewport to object color property relation.
@Clément Foucault (fclem) maybe for you?

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Aug 4 2020, 11:50 AM

Can also confirm.
This is only the case for Solid shading mode (set to Object color) though, Material Preview or Eevee Rendered mode seems fine (if you use the Object Info > color socket)

Philipp Oeser (lichtwerk) renamed this task from Viewport colour shows one colour but another is displayed instead to Viewport colour (Solid shading mode, Object color) shows one colour but another is displayed instead for more than 4096 objects.Aug 4 2020, 11:51 AM

You guys are awesome! Thank you so much!