I'm trying to run functions only on materials or textures that are currently selected in the Slate view. But the node.selected parameter seems to be wrong very often.
In the code below, it doesn't matter what node is set to be selected... the only node that seems to be selected via the node.selected property is the last created checkbox.
Can others confirm this? If so, please submit a bug report:
sme.Open()
testname = "MXS Selection Test"
existing = sme.GetViewByName testname
if existing > 0 then (
sme.DeleteView existing false
)
sme.activeView = (sme.CreateView testname)
v = sme.activeView
view = sme.GetView v
pos = [0,0]
numsubs = 10
MultiMat = MultiMaterial name:"multimaterial" numsubs:numsubs
view.CreateNode MultiMat pos
for m = 1 to numsubs do (
mat = multiMat.materialList[m]
mat.diffuseMap = checker name: ("tex"+m as string)
mat.name = ("Mat "+ (m as string))
multiMat.names[m] = ("Mat "+ (m as string))
)
view.SetSelectedNodes (#((multiMat.materialList[random 1 numsubs])))
numNodes = view.GetNumNodes()
for n = 1 to numNodes do (
nd = view.GetNode n
if nd.selected == true then (
ref = trackViewNodes[#sme][v][n].reference
format "% > % > % \n" n nd ref
)
)
Yes, the format node is always the last, any node is selected:
21 > <MixinInterface:Node> > tex10:Checker
Strange, the nd.selected It is not recognized.... if you append the nd.selected as array for example, the LAST item is true (21) with any node is selected ... mah....
Hello ,
This is a confirmed defect and logged with engineering, under review.
Case #10759538
Thank you for taking the time to report this.
Best Regards
VR