[Closed] Slate Material editor: instance UV tiling controller
hey everyone !
I m trying to do a script which would create a bezierFloat node contrloller in the active slate view.
Then connect this control to all the selected textureMap on the active slate view on the U and V tiling properties.
So I can change the tiling of multiple texturmap at once.
here is what I’ve done so far…
SelView = sme.GetView sme.ActiveView --get active view
SelNode = SelView.getSelectedNodes() --get selectednode
SelNodeName = #()
trackref = #()
trackName = #()
SelTrack = #()
for n = 1 to selNode.count do --get the name of selected nodes in the slate
(
append SelNodeName selNode[n].name
)
for t=1 to trackViewNodes[#sme][SelView.name].numsubs do
(
if superclassof trackViewNodes[#sme][sme.ActiveView][t].reference == textureMap do (append trackName trackViewNodes[#sme][sme.ActiveView][t].reference.name) --get name of all reference nodes
for n = 1 to selNode.count do
(
if trackName[t] == SelNodeName[n] do (append SelTrack trackViewNodes[#sme][SelView.name][t]) --test if name are the same to get the selected nodes
)
)
NodePos = [0,0]
UVctrl = Bezier_Float() --create a float controller
UVctrlNode = SelView.CreateNode UVctrl NodePos --create the node in the active view
UVctrlNode.name = "Uv_TileController" --change the name of the bezier node
UVctrlNode.selected = false
for s=1 to SelTrack.count do
(
setproperty SelTrack[s].reference.coords "U_Tiling" UVctrl
setproperty SelTrack[s].reference.coords "V_Tiling" UVctrl
)
I have no idea how to work with the SME, but to assign a controller is pretty simple.
bmap.coords.u_Tiling.controller = UVctrl
it works but not as I expected. The value is well transfered from the controller to the map property but there’s not link visible in the slate…So the user doesn’t know which texturmap is contolled by the Bezier float node and can’t esealy deconnect it.
I thought the line which link 2 nodes in the slate was just a visual information from the controller but apparently it’s not…