Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

blender - how do I add a color to an object?

Tags:

python

blender

When I try, nothing happens. I select a color and click the object and nothing.

Maybe a python command?

like image 628
tekknolagi Avatar asked Jan 10 '11 07:01

tekknolagi


2 Answers

  1. Select an object.
  2. In Button window (at bottom) select 'Shading' (a gray ball) and then 'Material buttons' (red ball)
  3. In 'Link and pipeline', press 'Add new'.
  4. Edit material color ('Col').

See it http://s3.amazonaws.com/twitpic/photos/large/222981727.png?AWSAccessKeyId=0ZRYP5X5F6FSMBCCSE82&Expires=1294658484&Signature=jDJpFXu7QI/7vGbW9BwBgL0trBU%3D

like image 78
9000 Avatar answered Sep 24 '22 07:09

9000


As @9000 mentioned, you might not have a material linked.

If you open a TextEditor window, you should be able to paste this script:

from random import random
import Blender
from Blender import *

scn = Blender.Scene.GetCurrent()
ob  = scn.objects.active
m   = ob.getData(mesh=True)
if(len(m.materials) < 1):
    mat = Material.New('newMat')
    m.materials += [mat]
m.materials[0].rgbCol = [random(), random(), random()]


Blender.Redraw()

This should set random colours, if you have a material linked, otherwise creates a new material and links it.

Note that you need Python installed on Windows for the console, and you need to start Blender from Terminal on OSX/Linux to see the console. Also, the snippet works for Blender 2.49, not 2.5x. You didn't mention which version of Blender you use.

HTH

like image 35
George Profenza Avatar answered Sep 24 '22 07:09

George Profenza