简体   繁体   English

搅拌机 - 如何为对象添加颜色?

[英]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? 也许是python命令?

  1. Select an object. 选择一个对象。
  2. In Button window (at bottom) select 'Shading' (a gray ball) and then 'Material buttons' (red ball) 在Button窗口(底部)选择'Shading'(灰色球)然后选择'Material buttons'(红色球)
  3. In 'Link and pipeline', press 'Add new'. 在“链接和管道”中,按“添加新”。
  4. Edit material color ('Col'). 编辑材质颜色('Col')。

See it http://s3.amazonaws.com/twitpic/photos/large/222981727.png?AWSAccessKeyId=0ZRYP5X5F6FSMBCCSE82&Expires=1294658484&Signature=jDJpFXu7QI/7vGbW9BwBgL0trBU%3D 请参阅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. 正如@ 9000所提到的,您可能没有链接的材料。

If you open a TextEditor window, you should be able to paste this script: 如果您打开TextEditor窗口,您应该能够粘贴此脚本:

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. 请注意,您需要在Windows安装用于控制台的Python ,并且需要从OSX / Linux上的终端启动Blender以查看控制台。 Also, the snippet works for Blender 2.49 , not 2.5x . 此外,该代码段适用于Blender 2.49而非 2.5x You didn't mention which version of Blender you use. 您没有提到您使用的Blender版本。

HTH HTH

Use vertex paint in the options at the bottom: 在底部的选项中使用顶点绘画

点击图片

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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