インスタンスレイヤー

InstanceLayerNodeはノードの一種で、複数のレイヤーおよびテクスチャセット間でレイヤーのパラメーターを同期しながら、メッシュに依存する結果を生成できます。 変更できるのはソースレイヤーのみです。

例

import substance_painter as sp

# Get the currently displayed Stack
stack = sp.textureset.get_active_stack()

# Get top position of the Stack
position_stack_top = sp.layerstack.InsertPosition.from_textureset_stack(stack)

# Insert Fill Layer
my_fill_layer = sp.layerstack.insert_fill(position_stack_top)
my_fill_layer.set_name("My Fill Layer")

# Create two instances of the Fill layer
insert_position = sp.layerstack.InsertPosition.below_node(my_fill_layer)
instance1 = sp.layerstack.instantiate(insert_position, my_fill_layer)
instance1.set_name("Instance 1")

instance2 = sp.layerstack.instantiate(insert_position, my_fill_layer)
instance2.set_name("Instance 2")

# Print instances of the parent layer
instances = my_fill_layer.instances()
print("Instances of " + my_fill_layer.get_name() + ":")
for instance in instances:
    print("- " + instance.get_name())

# Print parent of each instance
print("Parent of " + instance1.get_name() + ": " + instance1.instance_source().get_name())
print("Parent of " + instance2.get_name() + ": " + instance2.instance_source().get_name())

# Select the Instances
sp.layerstack.set_selected_nodes([instance1, instance2])

関数とクラス

substance_painter.layerstack.insert(position: InsertPosition, layer: LayerNode) -> InstanceLayerNode substance_painter.layerstack.instantiate

指定したレイヤーをインスタンス化します。 コンセプトに慣れていない場合は、レイヤーのインスタンス化に関するドキュメントを参照してください: レイヤーのインスタンス化ドキュメント。

パラメーター:

Rails:

ValueError – 無効な位置が原因で挿入に失敗した場合。 InsertPositionを参照してください。

挿入されたノードを​返します。

戻り値の型: InstanceLayerNode

substance_painter.layerstack.InstanceLayerNode(uid)クラス substance_painter.layerstack.InstanceLayerNode

インスタンスレイヤを操作できるノード。

ソースレイヤーからInstanceLayerNodeの一覧を取得するには、LayerNode.instances()を参照してください

instance_source() -> LayerNode substance_painter.layerstack.InstanceLayerNode.instance_source

インスタンスのソースレイヤーを返します。

このインスタンスの場合、ソースレイヤーの​を返します。

戻り値の型: LayerNode

recommendation-more-help
substance-3d-dev-help-painter-python-guide