PDA

View Full Version : deletet scene nodes in arrays


peliosis
12-21-2006, 12:31 AM
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 :)

Light
12-21-2006, 12:34 AM
Hi,

Try using isDeleted objectName.




Light

Bobo
12-21-2006, 05:39 AM
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.

peliosis
12-21-2006, 08:59 AM
LOVELY!

Thank you guys SO much for saving me!

CGTalk Moderation
12-21-2006, 08:59 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.