Connecting two nodes in Slate Material Editor

Connecting two nodes in Slate Material Editor

paradisebuster44
Observer Observer
134 Views
2 Replies
Message 1 of 3

Connecting two nodes in Slate Material Editor

paradisebuster44
Observer
Observer

Hi

 

I am having a tough time figuring this one out. I have a script that creates a standard MultiTile Node and a CoronaPhysicalMtl node. I simply want to connect the output of the MultiTile node to the input Base Color of the CoronaPhysicalMtl.

 

Since the script is in python, I would prefer to find a solution within it.

 

Any suggestions would be appreciated.

 

Thanks!

 

from pymxs import runtime as rt

# Get the Slate Material Editor interface
sme = rt.sme

# Check if a Slate view is active
if sme.activeView == 0:
    print("Please open the Slate Material Editor to run this script.")
else:
    # Get the active Slate Material Editor view
    active_view = sme.GetView(sme.activeView)

    # --- Create a MultiTile texture map ---
    multi_tile_map = rt.MultiTile()
    multi_tile_map.name = "My_MultiTile_Map"

    # Create a node for the map in the active view at position (100, 100)
    map_node = active_view.CreateNode(multi_tile_map, rt.Point2(100, 100))

    # --- Create a Corona Physical Material ---
    corona_mat = rt.CoronaPhysicalMtl()
    corona_mat.name = "My_Corona_Material"

    # Create a node for the material, positioned to the right of the map
    material_node = active_view.CreateNode(corona_mat, rt.Point2(350, 100))

    print("Successfully created MultiTile and CoronaPhysicalMtl nodes in the Slate Material Editor.")
0 Likes
Accepted solutions (1)
135 Views
2 Replies
Replies (2)
Message 2 of 3

denisT.MaxDoctor
Advisor
Advisor
Accepted solution
mat = rt.PhysicalMaterial()
map = rt.MultiTile()
mat.BaseColorMap = map
0 Likes
Message 3 of 3

paradisebuster44
Observer
Observer

Thank you! 

0 Likes