您可以設置wirecolor處理:
# there are 32 wire color numbered 0 to 31
cmds.setAttr(your_object + ".displayOverride", 1)
cmds.setAttr(your_object + ".overrideColor", color)
要設置表面顏色,您必須有一種方法來爲每種材質分配單獨的顏色。最簡單的答案是給每個對象自身的材料,並通過設置材料的。顏色屬性,如@ Ale_32的例子控制顏色。您可以按照建議的那樣使用selectionChanged scriptJob來更改顏色。
如果你不希望有太多的材料躺在你身邊也可以創建一個着色器使用tripleShadingSwitch節點來驅動它的顏色。該tripleShadingSwitch將輸入的每個對象,你可以直接設置使用交換機的對象的索引顏色:
def set_indexed_color(switchNode, index, color):
cmds.setAttr(switchNode+ ".input[%i]" % index, *color)
# note: that asterisk is important, since color is a 3-piece
# value like [1,0,1]
如果你不能用手設置此功能,你可以找出什麼進入對象使用
def get_input_shapes(switchNode):
input_count = cmds.getAttr(switchNode + ".input", size=True)
results = {}
for item in range(input_count):
inshape = cmds.listConnections(switchNode + ".input[%i].inShape" % item)[0]
results[inshape] = item
return results
,這將給你一個字典映射形狀的索引號
你想改變什麼顏色的?線框顏色或整個材質顏色? –
嗨,謝謝你的回答。 – ErezProductions
我想改變整個顏色。確切的顏色並不重要,但讓我們說紅色例如.. – ErezProductions