Notifications
Clear all

[Closed] deletet scene nodes in arrays

Arghh

I need to check if an array contains <deleted scene nodes> and I’m unable to.
How to do it? I tried “if classof myArray[i] != aKnownClass” but it produces an error because “i try to access a deleted scene node”.
I really need to make a bulletproof array.
I could actually test it by name: “if o.name == some_name* do…” but I also have problems.
Any combination of wildcards ans $ and + and whatever fails.
I’m sure I did it before but something stops me now, I’m a bit exhausted. be merciful

3 Replies

Hi,

Try using isDeleted objectName.

Light

If the array is called someArray, you could filter it from time to time using

someArray = for o in someArray where isValidNode o collect o

This will rebuild the array removing anything that is considered an invalid node, including deleted ones.

LOVELY!

Thank you guys SO much for saving me!