[Closed] Sanity check please
Could someone run this code and tell me what happens please?
I would expect there to be two boxes and both should be selected.
It appears to not matter which Max version is used (I’ve tried 2009 x64 and 2012 x64).
resetMaxFile()
b1 = box position:[-15, 0, 0]
b2 = box position:[15, 0, 0]
ids = for geom in geometry collect geom.inode.handle
for id in ids do
(
local obj = maxOps.getNodeByHandle id
obj.isSelected = true
)
Cheers,
Drea
This:
obj.isSelected = true
deselects all selected objects and select the obj.
Use this:
selectMore obj
insetead of
obj.isSelected = true
What is better is to collect the nodes in an array and then select the array.
What is better is to collect the nodes in an array and then select the array.
Normally I'd agree, but for my actual use case I need to deselect as well. I also need to leave already selected nodes unchanged.
I don't see anything in the docs to suggest that setting isSelected on a node would deselect another node(s?). isHidden and isFrozen don't work like that.
I’m not sure why I haven’t come across this before, but it seems to be a long standing bug/feature.
i don’t use the setting of .isselected property often. but i was not too much surprised that the setting it to ON for one node deselects all other. Well… it might make sense. For example when you create a new node. But the funnier thing is to set it to OFF for one node deselects all!