Giter VIP home page Giter VIP logo

project-curator's Introduction

Project Curator

A convenient tool to cleanup and maintain your Unity projects !
Project Curator is an Unity Editor window that, based on the currently selected Asset, displays the following information :

  • Each asset it depends on (called dependencies)

  • Each asset that depends on it (called referencers)
    Very useful to know if an Asset is can be safely deleted or not

  • Whether the asset is included in the build or not, depending on the nature of the Asset and its referencers (checked recursively)
    Check statuses section for more information

Screenshot

How to use ?

  • Install package
    • Using Git : In Unity, click Window > Package Manager > + > Add package from git URL... and add https://github.com/ogxd/project-curator.git
    • Manually : Download the .zip, unzip and in Unity click Window > Package Manager > + > Add package from disk... and select the downloaded package.json
    • With Unitypackage : Download the .unitypackage in the release tab. Not available anymore since version 1.2
  • When installed in Unity, click Window > Project Curator (and dock the window somewhere maybe)
  • Select an asset to visualize dependencies and referencers.

You will need to Rebuild the database on the first run. There should be a button for it in the window (or do a right click on the window tab). The database should update automatically afterwards, even when assets are created, moved or deleted. Feel free to rebuild the database again if there is an issue.

Statuses

Statuses can be :

  • Unknown
  • Not Included in Build
    • Not Includable
      This asset can't be in the build.
      Example : Editor scripts
    • Not Included
      This asset is not included in the build.
      Example : None of its referencers are included in the build
  • Included in Build
    • Scene In Build
      The asset is a scene and is set to build
    • Runtime Script
      The asset is a runtime script
    • Resource Asset
      The asset is in a Resources folder and will end in the final build
      It does not mean that the asset is actually useful. Check referencers manually and Resources.Load calls to find out
    • Referenced
      The asset is referenced by at least one other asset that is included in the build
      Example : A prefab that is in a built Scene

The overlay icon in the project folder can be disabled. To do so, right click on the Project Curator window tab, and click "Project Overlay"

project-curator's People

Contributors

curiouspers avatar joaoborks avatar ogxd avatar rhys-vdw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

project-curator's Issues

ArgumentException: GUID required

I got a few of these:

ArgumentException: GUID required
Parameter name: guid
Ogxd.ProjectCurator.ProjectCurator.AssertGuidValid (System.String guid) (at ./Library/PackageCache/com.ogxd.project-curator@adc4b63683/Editor/ProjectCurator.cs:181)
Ogxd.ProjectCurator.ProjectCurator.RemoveAssetFromDatabase (System.String guid) (at ./Library/PackageCache/com.ogxd.project-curator@adc4b63683/Editor/ProjectCurator.cs:67)
Ogxd.ProjectCurator.AssetProcessor+<>c__DisplayClass3_0.<OnWillSaveAssets>b__0 () (at ./Library/PackageCache/com.ogxd.project-curator@adc4b63683/Editor/AssetProcessor.cs:39)
Ogxd.ProjectCurator.AssetProcessor.OnUpdate () (at ./Library/PackageCache/com.ogxd.project-curator@adc4b63683/Editor/AssetProcessor.cs:25)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <88872b21b1e746a7ad699974a2be8304>:0)

var guid = AssetDatabase.AssetPathToGUID(path);

My guess is the path exists on save, but no longer exists when the action is dequeued in OnUpdate. Not sure how that could be, but the case should be handled.

If I keep seeing it I'll include more debug info here like logging out the problematic path so I can pinpoint the case.

Warning logged when deleting folder

Perhaps only on empty folder

ProjectCurator: Asset 'Assets/_Game/Config/Graphs/Statuses' is not present in the database
UnityEngine.Debug:LogWarning (object)
Ogxd.ProjectCurator.ProjectCurator:Warn (string) (at ./Library/PackageCache/com.ogxd.project-curator@6a70b7c196/Editor/ProjectCurator.cs:165)
Ogxd.ProjectCurator.ProjectCurator:RemoveAssetFromDatabase (string) (at ./Library/PackageCache/com.ogxd.project-curator@6a70b7c196/Editor/ProjectCurator.cs:96)
Ogxd.ProjectCurator.AssetProcessor:OnWillDeleteAsset (string,UnityEditor.RemoveAssetOptions) (at ./Library/PackageCache/com.ogxd.project-curator@6a70b7c196/Editor/AssetProcessor.cs:64)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

LICENSE.meta file for LICENSE file

Hello! Thank you for cool plugin. Can you please add LICENSE.meta for LICENSE file to prevent Unity Editor errors?

Asset Packages/com.ogxd.project-curator/LICENSE has no meta file, but it's in an immutable folder. The asset will be ignored.

Dependencies should be not collected recursively

As of today (and maybe since an update?), AssetDatabase.GetDependencies(string assetPath) collects depencies recursively.
This is an issue because:

  • Refreshing referencers does not work properly on asset update
  • It takes more time to build the database for no reason
  • It uses more memory

Todo

Make use of AssetDatabase.GetDependencies(assetPath, recursive: false)

Move `ProjectCuratorSettings.json` out of `ProjectSettings/`

Currently the database is stored in ProjectSettings which conventionally is checked in to version control. Doing so would lead to many merge conflicts.

I suggest moving it into either UserSettings or Library. I think in this case it might make the most sense to move it to Library since it does not contain "settings" (the only setting is the overlay toggle, which is stored in EditorPrefs).

License Missing

Thanks for sharing your open source project. It looks like you haven't specified a license.

Some Background

When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can use, copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation. Once the work has other contributors (each a copyright holder), “nobody” starts including you.

choosealicense.com is a great resource to learn about open source software licensing and the MIT License seems to be what most Unity related projects on here are using.

Thanks again,
John

Improve overall performances

Context

Database persists in memory as an array of reference types (AssetInfos), with 2 array for each AssetInfo to keep track of references of dependencies. This is rather simple and straightforward however it has a few drawbacks:

  • It relies on Unity serialization/deserialization, which is kind of slow.
  • Database is saved as a json file, which is not the most "optimal" format for keeping track of thousands or even hundreds of thousands of assets.
  • It produces quite a lot of memory fragmentation due to the number of reference types it represents (1 for AssetInfo, 1 for string guid, 1 for dependency array and 1 for references array. All of this multiplied by the number of assets to keep track of)

Solution

Make AssetInfo an immutable struct and use a GUID type internally. Reference references and dependencies with indexes and ranges. This way AssetInfo is of constant size (blittable) and we can serialize everything in a few blobs. In memory, that would also mean keeping one big chunk instead of thousands of references.

Editor freezes when deleting a lot of "not included" assets

The project freezes the editor when deleting a lot of "not included" assets.
It might have something to do with rebuilding the database upon removal of an asset, for each asset individually?

Versions:
Unity 2019.3.32f1
Project Curator 1.2.0

Large number of warnings being raised by `RemoveAssetFromDatabase`

We're frequently getting these warnings from this project.

Asset 'Assets/_Game/Content/Chronospheres/ChronosphereUtilities/BiomeEquipmentTables/ClockworkTables/ClockworkItemTables/ClockworkItemTable.asset' that depends on 'Assets/_Game/Content/Clockwork/ClockworkItems/PowerCycle/PowerCycle.asset' doesn't have it as a dependency
UnityEngine.Debug:LogWarning (object)
Ogxd.ProjectCurator.ProjectCurator:RemoveAssetFromDatabase (string) (at ./Library/PackageCache/com.ogxd.project-curator@5a5eb9a295/Editor/ProjectCurator.cs:66)
Ogxd.ProjectCurator.AssetProcessor/<>c__DisplayClass3_0:<OnWillSaveAssets>b__0 () (at ./Library/PackageCache/com.ogxd.project-curator@5a5eb9a295/Editor/AssetProcessor.cs:38)
Ogxd.ProjectCurator.AssetProcessor:OnUpdate () (at ./Library/PackageCache/com.ogxd.project-curator@5a5eb9a295/Editor/AssetProcessor.cs:25)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

Is there some actionable fix that should be made here? Otherwise I'd suggest only enabling this warning with a compiler symbol like PROJECT_CURATOR_DEBUG, as I'm not sure what we should do about it at our end.

Happy to contribute this change.

Database not updated when an asset is renamed

Firstly, thank you for this amazing project, it has become an important part of our workflow.

Our team has reported that references are not updated when an asset is renamed.

To reproduce:

  1. Open curator window
  2. Select asset A that references asset B
  3. Rename asset B to "C"
  4. Observe that neither B nor C appear in A' references
  5. Select asset C and observe that A no longer appears in its "referencers"

Rebuilding the project fixes this problem.

Support OpenUPM

Hi, could you please tag your releases for OpenUPM support? It seems somebody has already added this repo to OpenUPM but it has not been pulled in due to tags being malformed. For compatibility they will need to use the full semver string (i.e. 1.4.0 instead of 1.4).

https://openupm.com/packages/com.ogxd.project-curator/

I'd open a PR but I don't think I can include tags in a PR?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.