Hello community the title say it all .The problem is how I can get a copy ofreroute_decl_node
as usage.Only I get was invalid name I tried many things like using set_editor_property even knowing that there are no property in there.There is no information about this.
import unreal
material_path = target_material.get_path_name()
texture_sample_node = unreal.MaterialEditingLibrary.create_material_expression(
target_material, unreal.MaterialExpressionTextureSample, 0, 0)
texture_sample_node.texture = target_texture
texture_sample_node.sampler_type = sampler_type
# リルート宣言ノードを作成
reroute_decl_node = unreal.MaterialEditingLibrary.create_material_expression(
target_material, unreal.MaterialExpressionNamedRerouteDeclaration, 200, 0)
reroute_decl_node.set_editor_property('Name', target_name)
internal_name = reroute_decl_node.get_name()
print(internal_name)
# テクスチャサンプルノードをリルート宣言ノードに接続
unreal.MaterialEditingLibrary.connect_material_expressions(
texture_sample_node, 'RGB', reroute_decl_node, 'Input')
reroute_usage_node = reroute_decl_node
reroute_usage_node = unreal.MaterialEditingLibrary.create_material_expression(
target_material,
unreal.MaterialExpressionNamedRerouteUsage,
400, 0
)
reroute_usage_node.set_editor_property('Name',internal_name)
reroute_usage_node = unreal.MaterialEditingLibrary.create_material_expression(
target_material, unreal.MaterialExpressionNamedRerouteUsage, 400, 0)