v1.0
指定したオブジェクトのポリゴン ノードの頂点の色の値を変更します。
oReturn = PaintVertexColors( [InputObj], Polynodes, Colors, Mode ); |
なし
| パラメータ | タイプ | 説明 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| InputObj | 文字列 |
ペイントする 3D オブジェクトのオブジェクト名。 デフォルト値: 現在選択されている値 |
||||||||
| Polynodes | Array |
色付けしたいポリゴン ノードのインデックスの配列 注: この配列に指定した数と同じ数値を、Colors 配列に使用してください。 |
||||||||
| Colors | Array |
Polynodes 配列に指定した各ポリゴン ノードの、新しい RGBA 値(つまり、Polynodes 配列に指定した各ノードのインデックスに、ひとつの 16 進数の値をマッピングします)。
各 RGBA の 16 進数値は 1 バイトで、long 型にパッケージングされます。 たとえば、赤の 16 進数値は &hFF000000 で、long 型の -16777216 にパッケージングされます。 Colors 配列の色指定に 16 進表記を使用することはできますが、Softimage では、Script Editor のヒストリ ペインにコマンドを記録する際、パッケージングされた long 型の値のみを表示します(以下の例を参照)。 |
||||||||
| Mode | Integer |
ペイント モード
|
'*********************************************************
' SETUP
'
' Set up a simple grid with only 1 subdivision in both U and V
Set oPalette = CreatePrim ( "Grid", "MeshSurface" )
oPalette.Parameters("subdivu").Value = 1
oPalette.Parameters("subdivv").Value = 1
'*********************************************************
' USING THE COMMAND
'
' Paint red on the first polygon node
PaintVertexColors oPalette, array(0), array(&hFF000000), 3
' Paint green on the second and white on the third polygon node
PaintVertexColors oPalette, array(1,2), array(&h00FF0000,&hFFFFFF00), 3
'*********************************************************
' OUTPUT
'
' The following commands are logged to the history window:
' CreatePrim "Grid", "MeshSurface"
' PaintVertexColors "grid", Array(0), Array(-16777216), 3
' PaintVertexColors "grid", Array(1, 2), Array(16711680, -256), 3 |
// This example demonstrates how to set a single polygon element with JScript.
CreatePrim("Sphere", "MeshSurface", null, null);
CreateVertexColorSupport(null, "Vertex_Color", null, null);
var indices = new Array(1);
indices[0] = 75;
var colors = new Array(1);
colors[0] = 16765695;
PaintVertexColors("sphere", indices, colors, 1, null);
// IMPORTANT: Avoid passing the index and color arrays like this:
// PaintVertexColors("sphere", Array(75), Array(16765695), 1, null);
// JScript will automatically create 2 arrays of 75 and 16765695 elements in
// this case. It could also issue an error if the size of the newly created
// arrays are too large to handle. See JScript documentation for further
// details on the Array object. |