Skip to content

Instantly share code, notes, and snippets.

@iCyP
Created November 2, 2019 09:20
Show Gist options
  • Save iCyP/613f77e16ccd4653f66854b4e71856dc to your computer and use it in GitHub Desktop.
Save iCyP/613f77e16ccd4653f66854b4e71856dc to your computer and use it in GitHub Desktop.
import bpy
import math
width = max(1,math.ceil(len(bpy.data.materials)**(1/3) ))
for i in range(width):
for j in range(width):
for n in range(width):
try:
bpy.data.materials[i*width*width+j*width+n].diffuse_color = (i/width,j/width,n/width,1)
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment