Livello istanza
InstanceLayerNode è un tipo di nodo che consente di sincronizzare i parametri di livello tra più livelli e set di texture, pur continuando a generare un risultato dipendente dalla trama. È possibile modificare solo il livello sorgente.
Esempi
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])
Funzioni e classi
substance_painter.layerstack.instantiate(position: InsertPosition, layer: LayerNode) -> InstanceLayerNode substance_painter.layerstack.instantiate
Create un’istanza del livello specificato. Se non hai dimestichezza con il concetto, consulta la documentazione su istanza dei livelli: documentazione su Istanze del livello.
Parametri:
- posizione (InserisciPosizione) - Inserisci posizione.
- layer (LayerNode) - Livello da creare.
Generazioni:
Errore valore - Se l’inserimento non è riuscito a causa di una posizione non valida. Vedere InsertPosition.
Restituisce: Il nodo inserito.
Tipo restituito: InstanceLayerNode
class substance_painter.layerstack.InstanceLayerNode(uid) substance_painter.layerstack.InstanceLayerNode
Nodo che consente la manipolazione di un livello Istanza.
Per recuperare l’elenco di InstanceLayerNode dal livello di origine, vedere LayerNode.instances()
instance_source() -> NodoLivello substance_painter.layerstack.InstanceLayerNode.instance_source
Restituisce il livello di origine di questa istanza.
Restituisce: il livello di origine, se questa istanza.
Tipo restituito: NodoLivello