Notifications
Clear all

[Closed] deselect node from selection – loop stops

Hey,

I have got some problem, with deselecting different kinds of superclass and of class objects.
Here is a very sipmle script – wich have been overdone already because it simply stops, deselection after the first targetobject class deselected… and the spotlight target remains.
I am pretty much sure that I am using it on wrong way but I didnt find anything about it on the maxscript documentation.
tried with iskindof , deselect obj, etc.

clearListener()
max select all
for obj in selection do
(
if superclassof obj != geometryclass or superclassof obj != shape then
(
deselectnode obj
)
)
– problematic loop
for obj in selection do
(
if classof obj == Targetobject then
(
deselectnode obj
)
)

– Thanks

3 Replies

well, now managed with array, but I would be very happy in somebody would enlight me on this.
Thanks

[QUOTE=losbellos]Hey,

– problematic loop
for obj in selection do
(
if classof obj == Targetobject then
(
deselectnode obj
)
)
There is no problem in this

yes, only troubles when u use the whole thing together.
I just quickly rechecked, now it deselects targetobjects, but also some geometryclass as well.
Which shouldnt. I dont know why this unpreditacble behaviour, but it does happend to me.
I didnt ask anyone else to try it out, maybe I should.

Other thing connects to this, if I use selectfilter(2) it doesnt even think about selecting targetobjects even known they are registered as GeometryClass – Superclass.
I think actually something like this causes some misunderstanding in max with the script.
Or something else, I am still not aware of it.

I recorded the screen to show you what happens

170kb
http://www.yourfilelink.com/get.php?fid=88779

Thanks.