Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Eric-Chadwick · Feb 25, 2012 at 03:06 AM · stringbooleanhierarchysearch

Hierarchy search "NOT" modifier?

I'd like to search for all gameobjects in the scene Hierarchy that do not contain a specific string. Is this possible?

For example something like "NOT door" would filter the Hierarchy to display every item that does not have "door" in their names. AFAIK "NOT" doesn't work as an argument, neither does "-" (the dash character).

Thanks!!

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image syclamoth · Feb 25, 2012 at 03:07 AM -1
Share

One word- why? There has to be a better way.

avatar image swanijam syclamoth · Nov 08, 2018 at 02:16 PM 0
Share

that's ten words

avatar image Eric-Chadwick · Feb 28, 2012 at 05:31 PM 1
Share

I have meshes for lightmapping only, not in-game rendering, which are named with the same prefix as their renderable counterparts (walls, floors, etc.) plus the postfix "_SelfIllum". For example: mesh "Wall01A_SelfIllum" casts light onto mesh "Wall01A".

I would like to exclude all these "_SelfIllum" meshes from the list, so I could easily select all the renderable meshes.

Take a list consisting of: Wall01A, Wall01A, Wall01A, Wall01A_SelfIllum, Wall01A_SelfIllum, Wall01A_SelfIllum, Wall01B, Wall01B. How do I quickly select the three Wall01A meshes and the two Wall01B meshes, without selecting the three _SelfIllum meshes?

If I have a giant list with hundreds of each of these names, then manually selecting the desired ranges becomes a labor-intensive task. Limiting the display with booleans (or better yet, regular expressions!) would make this a simple task.

Is there a better way?

avatar image Eric-Chadwick · Mar 14, 2012 at 08:55 PM 1
Share

O$$anonymous$$, thanks for the reply. It's needed at design-time only. Hopefully a feature for the future. Will see if I can script something short-term.

avatar image Shinugami · Jul 09, 2017 at 10:00 AM 2
Share

Totally agree! I am looking for such a feature right now as I have na$$anonymous$$g conventions which makes it easy to sort stuff but when I have lots of na$$anonymous$$g conventions it would be nice to filter out some stuff. Example:

 SearchBar[ b_ t: $$anonymous$$eshFilter]

This gives me the results I want but it includes all the meshFilter objects that begin with "b_". Now I would like to exclude the ones that have "_Edges".

Perhaps Unity can add a feature like this:

 SearchBar[ b_ !(_Edges) t: $$anonymous$$eshFilter]


Would be great to have more control in large projects.

avatar image nicolai94 · Nov 08, 2018 at 01:36 PM 1
Share

I agree Eric!

Any self-respecting software with a search function ought to accept expressions. Doubly so when the target audience is programmers (or at least up there on the nerd spectrum).

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by toddisarockstar · Nov 09, 2018 at 01:33 AM

this is not recommended because it is not proficient. there are many ways to organize your object so you dont have to do this. but this is your answer: this find all objects without "door" in the name.

     GameObject[] Everything = UnityEngine.Object.FindObjectsOfType<GameObject>() ;
 
         int n = Everything.Length;
         while (n>0) {n--;
             if(Everything[n].activeInHierarchy){
             if(!Everything[n].name.Contains("NOT")){
                 print ("I found: "+Everything[n].name);
             }
             }
         }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

string searching question 1 Answer

Search function in Hierarchy 1 Answer

what the hell is a int? (or a float, or boolean, or string!) 3 Answers

string deleting 1 Answer

Locate asset in hierarchy 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges