SME Maxscript access

SME Maxscript access

lightcube
Advisor Advisor
1,841 Views
2 Replies
Message 1 of 3

SME Maxscript access

lightcube
Advisor
Advisor

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
 )
)



Shawn Olson

Developer of Wall Worm

3ds Max 4/Gmax - 3ds Max 2027
Mudbox 2009-2022

Windows 11 x64
i9 11900K
128GB RAM
Geforce 3090
0 Likes
1,842 Views
2 Replies
Replies (2)
Message 2 of 3

MedalHellWay
Collaborator
Collaborator

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....

0 Likes
Message 3 of 3

VishnuR
Alumni
Alumni

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



Vishnu Ramdass
0 Likes