简体   繁体   中英

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

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

Maybe a python command?

  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

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

Use vertex paint in the options at the bottom:

点击图片

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM