Search Unity

Unity Project Cleaner

Discussion in 'Works In Progress - Archive' started by DexRobinson, Aug 8, 2014.

  1. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    UPC Big.jpg

    What does it do?
    -------------------------------------
    Unity Project Cleaner(UPC) will remove any unused assets from your project. UPC will give you a list of assets that you are not referencing in your scenes or resource folder. Once you get this list, you have the option to add/remove assets from the list. Then you move all your unnecessary assets into a temp folder so you can safely remove them.






    File Structure
    ----------------------------------------
    File Structure is a feature inside of UPC that will automatically sort your entire project for you. This is a very generic sort, but it will group things together for you. So all your model will go into a models folder, and your scripts will get broken up into C#, JS, Boo and shaders. File Structure will just make cleaning up your project easier and be easier to navigate your project.



    Future Features
    ----------------------------------------
    I am still thinking of new ideas and improving upon the current ones of UPC. As a person who hates having huge project folders and a ton of files in my project's I am trying to do everything I can to remove the cluter and make sure everything is nice and neat so when you have to go back to an old project it's not a complete nightmare.
    -In editor file sorter program to visual see where each type of file is going(you can see an idea of that below)
    -Tagging system to better sort your project
    -Texture adjuster for mobile(be able to change your texture size and compression for iPhone and iPad or tablet and phone).
    -Anything other people can think of that they would like to see​



    Known Issues
    -------------------------------​
    -UPC has trouble finding base classes for scripts. If your base class isn't being used in any scene or isn't in the resources folder, UPC will not detect it is needed. Sorry :(

    -UPC uses Resources.FindObjectsOfTypeAll<GameObject>() to find all gameobject(active or disabled) in each scene you pick. But using this methods also returns all prefabs/models in your project(idk why, but it's a Unity thing) so if you have a prefab that has a bunch of components on it, those components are considered "Used". The best thing to do is to manually go through each prefab and determine if it is needed or not, then delete them if you know you don't need it.

    -If you are using the Unity made Image Effects, you might get an error if you move scripts out of there. If you get any sort of issue, just move the scripts back into the Standard Assets/Image Effects folder to fix the problem.



    Asset Store
    -----------------------------------
    Unity Project Cleaner

     
    Last edited: Aug 19, 2014
    OutSpoken_Gaming likes this.
  2. softwizz

    softwizz

    Joined:
    Mar 12, 2011
    Posts:
    793
    Very useful, many times I have needed to remove unused assets from asset store projects that provide demo scenes that dont get used.
     
  3. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    Thanks Softwizz!

    Originally I had UPC just exclude items in the Resources,Editor and Plugins folders but after some testing I found that UPC was trying to remove items that were needed by things inside of these folders. Mainly the resources folder. Now what I am doing is running through the Resources folder and getting a list of all the GameObjects then checking their dependencies and then making sure anything that they are publicly referencing gets included in being used.
     
  4. mathias234

    mathias234

    Joined:
    Sep 9, 2012
    Posts:
    239
    Very nice when will this be available?
     
  5. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Looks nice! Interested!
     
  6. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    I am trying to get it out sooner rather than later. I am doing some more testing to make sure it works with a bunch of different scenarios. I want to try and get it submitted to Unity by the end of the week but things always come up.
     
  7. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    UPC will also offer I quick and easy way to organize your project.

     
  8. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    Looks pretty cool. I was planning on writing one of these, Yours seems to do the job though.

    I read that unity already removes all unused assets from the project on build but I never truly trusted it.
     
  9. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    Unity remove unnecessary assets from the final build. This will help you remove those assets in your project so you don't have to look at them anymore lol.
     
  10. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    Exactly what I want ha. Artists always create the messiest project folders. It's incredibly annoying! I'll convince my boss to buy it!

    When are you releasing it on the asset store?
     
  11. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    I want to keep testing it to make sure there isn't anything that breaks but I hope to get it out soon. My goal was to get it submitted to the asset store by Friday.
     
  12. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    This could give me my sanity back ….
     
  13. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    Well it has been submitted to the Asset Store, I am going to give each person who wrote on here a free copy of the asset. Please if you like it, buy it. It is only going to be $5. Also I would really love any feedback about the asset to make it better.
     
    Taloose, softwizz and hopeful like this.
  14. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    FileStructure_Beta.jpg

    Here is something I am working on to maybe add into UPC. It would be a way for you to customize how you want your project sorted. You would be able to tell UPC to put a specific file extension into a specific folder path for when you sort it. I am also looking into a tagging system so you can identify things better and sort by reference. This way you could mark items as "Player Scripts" and then file all your scripts under "Scripts/Player" with that tag. Still working on the details though.
     
    smitchell likes this.
  15. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
  16. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    So without me even know UPC has been released on the Asset Store already. The last time it took about 2-3 weeks to get approved. Anyways here is the link: Unity Project Cleaner
     
  17. softwizz

    softwizz

    Joined:
    Mar 12, 2011
    Posts:
    793
    Excellent, now I can use asset store purchases and not have to spend a year deleting all the demo scene code graphics etc.. without deleting a part of the asset thats needed, a massive time (and space) saver.

    Just to clarify, if I have a load of assets in my project but no scene then this would remove all assets, is that correct.
     
    Last edited: Aug 18, 2014
  18. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    Yes it will remove anything that isn't needed. I import a lot of demo content then when I am making the final version I have sooooo many useless assets. The only thing to remember is that If they have demo prefabs, they need to be deleted since Resources.FindObjectsOfTypeAll<GameObject>() returns all prefabs and models. And if the demo prefabs are using scripts and materials(which they most likley are) those materials/scripts will be considered used. Just delete any demo prefabs and everything should run smoothly.
     
  19. mathias234

    mathias234

    Joined:
    Sep 9, 2012
    Posts:
    239
    Ok before i try to use it i wonder it will not delete like interfaces and such right? i got alot of WIP stuff which isnt assigned anywere but might be in the future you might want to make so it wont Touch if the files in a WIP folder
     
  20. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    All it will do is, move those assets into the "Temp" folder then you can go in and move stuff back into the project once you are using it. Another option is too move all your WIP stuff into the resources folder and UPC will not move those files.

    UPC will never delete anything.
     
  21. softwizz

    softwizz

    Joined:
    Mar 12, 2011
    Posts:
    793
    Awesome, where is it.
     
  22. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    Sorry softwizz, I thought I messages you.
     
  23. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    imgg.jpg
    So with some feedback I have added the following things in version 1.1 for Unity Project Cleaner.

    • Fixed the cancel bars not canceling progress
    • Added in a way to sort your scanned objects by Scripts, Animations, Models, Prefabs, etc
    • Ability to Check/Uncheck all scenes
    • Ability to exclude certain folders from being checked by UPC(if you have a testing folder that you don't want UPC to check against you can exclude it and it will not be processed)
    • Stability improvements
    It's submitted to the Asset Store and should be live in a day or two.
     
    Last edited: Aug 19, 2014
  24. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Is that the node-like system you posted earlier?
     
  25. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    No sorry, that's still a big wip. Having trouble saving the nodes information. If you look at the screen shot it's the sort by drop down. You can sort your assets by Scripts, models, audio, etc.
     
  26. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    UPC is now only $5(USD).
     
  27. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Temporarily?
     
  28. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    It will be 5 bucks for a little while.
     
  29. JohnHacker

    JohnHacker

    Joined:
    Oct 27, 2012
    Posts:
    55
    Hello, I've just bought the asset and I get a memory allocation problem. Is this a known issue? My project is rather large and I'd like to clean it.
     
  30. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    How big is your project? I will look into this, I haven't had any issue with size yet, but my project is only about 200MB. Also what part is causing your issue, is it the folder restructuring or finding unused assets?
     
    Last edited: Sep 19, 2014
  31. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    @DexRobinson I just bought your asset, and right out of the bat, I had to make a small modification to the source code. There was no scroll view block around the "All scenes" area (where you iterate allScenesNames), due to that I had do resize the window to see scene entries at the bottom, and the "Sort by" and "Scan" buttons weren't visible. I'm not sure how the scroll view is missing, without it, not sure how would one reach the scan button. Do I need a taller screen? or, I shouldn't have many scenes? or...?



    Even after adding the SV block, I'm still not sure if everything's working as it should, I did a scan over some scenes, and I'm not seeing any assets, still seeing "All scenes"



    Not the best first impression on the interface...
     
    Last edited: Nov 2, 2014
  32. ironbelly

    ironbelly

    Joined:
    Dec 26, 2011
    Posts:
    597
    Is this compatible with Unity 5?
     
  33. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    664
    I would like to know if this is compatible with Unity 5 also. Last update was Nov 2014.