ReTiCo icon indicating copy to clipboard operation
ReTiCo copied to clipboard

assign random object color but same for instances

Open Vinc3r opened this issue 3 years ago • 2 comments

need to take into account instances (so they get same color):

import bpy
import random

def returnRandColor():
    return random.randrange(0, 1000000) / 1000000

for obj in bpy.context.selected_objects:
    obj.color = (returnRandColor(), returnRandColor(), returnRandColor(), 1)

Vinc3r avatar Oct 18 '21 15:10 Vinc3r

https://github.com/Vinc3r/Blender-Python-Snippets/blob/master/blender-2.8%2B/random-color-on-selected.py

Vinc3r avatar Oct 29 '21 15:10 Vinc3r

also useful for wireframe > object color

Vinc3r avatar Nov 10 '21 16:11 Vinc3r