PDA

View Full Version : question: Mel: tokenize


snarkle
03-09-2004, 05:48 PM
I am trying to pick out something in the scene with a certain name in it. Here is an example of what I am trying to do:

I have a scene that has objects in it named:
base_spine
base_spine1
ball
cone
base_leg.

Now i would like to write a script that lets me select anything that has the word "spine" in it.

I have been told to use tokenize but I have no idea on how to do this.

Marcel
03-09-2004, 06:42 PM
I think it is not tokenize you could use but the 'match' command, which searches for a certain string in another string. But maybe your problem can be solver even simpler, by using a wildcard in your selection:

select "*spine*";

selects all objects with the word spine in them.

mark_wilkins
03-09-2004, 08:45 PM
Yes, wildcards are the way to do this.

Note that if you're using namespaces at all you'll only get objects in the current namespace with the above. The more general namespace-aware case is:

select "*:*spine*";

-- Mark

snarkle
03-10-2004, 12:41 PM
I would like to thank both mark_wilkins and Marcel for the help. The information worked. Once again, thanks alot.

CGTalk Moderation
01-17-2006, 04:00 PM
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.