Code Monkey home page Code Monkey logo

projectcleaner's Introduction

ProjectCleaner

Unreal engine plugin for managing unused assets and empty folders in your project.

No more need for Migration and other hacky methods.

Versions Supported: 4.27+
Platform: Windows and Linux

Installation

The plugin is available on the marketplace Marketplace URL

Installation from github

  1. Create 'Plugins' folder in your project root directory
  2. Download appropriate version of .zip in releases
  3. Extract to Plugins folder
  4. Open your project, and you're done!

Installation from source

  1. Create 'Plugins' folder in your project root directory
  2. Clone the repository to the 'Plugins' folder (make sure you pick the correct branch for your engine version).
  3. Build the solution and you're done!

Features

  • Detection of unused assets
  • Detection of corrupted assets
  • Detection of indirect assets
  • Detection of external files
  • Empty folders detection
  • Subsystem class that exposes most of the plugin functionality, which can be utilized in Blueprints or Python scripts.
  • Command line interface using Commandlets
  • Works fast on Large projects
  • Intiutive and informative user interface
  • Per-folder asset usage information
  • Configurable scanning and exclusion settings

projectcleaner's People

Contributors

ahrbe1 avatar ashe23 avatar dw-ernest avatar irajsb 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  avatar  avatar

projectcleaner's Issues

Scrolling the Unused Assets view doesn't work properly

For some reason, I can only scroll the Unused Assets view with the mouse wheel while the cursor is above the scroll bar. It doesn't do anything while the cursor is above one of the assets. Holding right mouse and dragging (the universal quick scroll gesture in Unreal) doesn't do anything either.

tree view

  • add view option "Show Folders Unused Only", enabling which will show only folders that contain unused assets
  • optimize items creation performance
  • add hide/show column feature
  • add reset default setting option (maybe globally)

Out of memory: Tries to allocate unrealistic amount of memory on analyzis request

I'm looking for ways to set up a pipeline for a big project to show warnings when unused assets are being pushed to repository.
This plugin's Python API is really useful for that, however when running on the actual project that has around 200-300 GB of assets (which is why we're trying to reduce it) both the editor and the commandlet crash with "Out of memory" trying to allocate 80-100 GB array.

I'm not really sure what percent of assets are loaded at the point of the crash, but I expect that even if i had 128 GB of RAM available, I would still probably run out of it on the next array allocation when more assets are loaded.

Is it possible to introduce some sort of dynamic loading of assets while they're being checked and unloading when the check is done? Or maybe some other way to drastically reduce ram usage?

Here is the stack trace from Crash Reporter:

Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\GenericPlatform\GenericPlatformMemory.cpp] [Line: 241] Ran out of memory allocating 89227504816 bytes with alignment 8. Last error msg: The paging file is too small for this operation to complete..

UnrealEditor_Core!<lambda_a20f43b083803437f2d783b89afde082>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\GenericPlatform\GenericPlatformMemory.cpp:242]
UnrealEditor_Core!FGenericPlatformMemory::OnOutOfMemory() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\GenericPlatform\GenericPlatformMemory.cpp:244]
UnrealEditor_Core!FMallocMimalloc::OutOfMemory() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\HAL\MallocMimalloc.h:50]
UnrealEditor_Core!FMallocMimalloc::Realloc() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\MallocMimalloc.cpp:137]
UnrealEditor_Core!FMemory::Realloc() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\HAL\FMemory.inl:56]
UnrealEditor_ProjectCleaner!TArray<FAssetData,TSizedDefaultAllocator<32> >::ResizeTo() [D:\RocketSync\5.1.0-23058290+++UE5+Release-5.1\Working\Engine\Source\Runtime\Core\Public\Containers\Array.h:3045]
UnrealEditor_ProjectCleaner!FProjectCleanerDataManager::FindAllAssets() [D:\build\U5M-Marketplace\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ProjectCleaner\Source\ProjectCleaner\Private\Core\ProjectCleanerDataManager.cpp:450]
UnrealEditor_ProjectCleaner!FProjectCleanerDataManager::AnalyzeProject() [D:\build\U5M-Marketplace\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ProjectCleaner\Source\ProjectCleaner\Private\Core\ProjectCleanerDataManager.cpp:56]
UnrealEditor_ProjectCleaner!FProjectCleanerManager::Update() [D:\build\U5M-Marketplace\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ProjectCleaner\Source\ProjectCleaner\Private\Core\ProjectCleanerManager.cpp:38]
UnrealEditor_ProjectCleaner!SProjectCleanerMainUI::OnRefreshBtnClick() [D:\build\U5M-Marketplace\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ProjectCleaner\Source\ProjectCleaner\Private\UI\ProjectCleanerMainUI.cpp:339]
UnrealEditor_ProjectCleaner!TBaseRawMethodDelegateInstance<1,SProjectCleanerMainUI const ,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() [D:\RocketSync\5.1.0-23058290+++UE5+Release-5.1\Working\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:459]
UnrealEditor_Slate!SButton::ExecuteOnClick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:465]
UnrealEditor_Slate!SButton::OnMouseButtonUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:390]
UnrealEditor_Slate!<lambda_51e270ca99ea7ce852539efd04dd453f>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5046]
UnrealEditor_Slate!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_51e270ca99ea7ce852539efd04dd453f> >() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:412]
UnrealEditor_Slate!FSlateApplication::RoutePointerUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5032]
UnrealEditor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5601]
UnrealEditor_Slate!FSlateApplication::OnMouseUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5566]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessDeferredMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2219]
UnrealEditor_ApplicationCore!FWindowsApplication::DeferMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2726]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1895]
UnrealEditor_ApplicationCore!FWindowsApplication::AppWndProc() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:925]
user32
user32
InkObj
atlthunk
user32
user32
UnrealEditor_ApplicationCore!FWindowsPlatformApplicationMisc::PumpMessages() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:142]
UnrealEditor!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5293]
UnrealEditor!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:202]
UnrealEditor!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:107]
UnrealEditor!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:244]
UnrealEditor!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:282]
UnrealEditor!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

"Failed to delete some assets"

Hey there!
I've installed this plugin a few days ago, but since I've installed it I keep getting: "Failed to delete some assets". (it's actually not deleting any assets at all).
I've tried redownloading and reinstalling the plugin but it didn't help. I'm using Unreal Engine 5.
Any help is appreciated, thanks! :)

Linux Support

I've implemented compilation fixes for building under Linux against 5.0.2. It's all pretty much minor stuff. Clang v10 appears to be more strict than the Visual Studio compiler.

Have a look at https://github.com/ahrbe1/ProjectCleaner/commit/c5c5bdbfc793c9037914853760147443782aa4e2

Two functions appear to be deprecated and resulted in warnings, so I updated those using the recommended APIs. Though that part may need to be checked against 4.2.x to ensure it still compiles. Those functions are GetAssetPackageDataCopy() and GetCachedEmptyPackagesCopy(). They aren't strictly necessary for the Linux build, though.

I can open a PR if desired.

Feature, Export unused files to blacklist txt

Hi, UE4 has feature to blacklist files when packaging. Instead of deleting from project, can u export the unused files to PakBlacklist-xxx.txt to use for packaging instead of deleting from source project.

Some assets used in source code not detected correctly.

In ShooterGame example project assets like "DefaultShooterButtonStyle" class deleted but they used in code.

const FButtonStyle* ButtonStyle = &FShooterStyle::Get().GetWidgetStyle<FButtonStyle>("DefaultShooterButtonStyle");

DefaultShooterButtonStyle - path is

SlateWidgetStyleAsset'/Game/UI/Styles/DefaultShooterButtonStyle.DefaultShooterButtonStyle'

Crash too long filename

Got a crash when I try to open Project Cleaner.

Assertion failed: false [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/UObject/UnrealNames.cpp] [Line: 1830] FName's 1023 max length exceeded. Got 3344 characters excluding null-terminator:..xxxxxx...),ImageStretch=ScaleToFit,Padding=(Left=0.000000,Top=0.000000,Right=0.000000,Bottom=0.000

UE4Editor_ProjectCleaner!FProjectCleanerDataManager::FindIndirectAssets() [D:\build\++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ProjectCleaner\Source\ProjectCleaner\Private\Core\ProjectCleanerDataManager.cpp:577]
UE4Editor_ProjectCleaner!FProjectCleanerDataManager::AnalyzeProject() [D:\build\++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ProjectCleaner\Source\ProjectCleaner\Private\Core\ProjectCleanerDataManager.cpp:56]
UE4Editor_ProjectCleaner!FProjectCleanerManager::Update() [D:\build\++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ProjectCleaner\Source\ProjectCleaner\Private\Core\ProjectCleanerManager.cpp:37]
UE4Editor_ProjectCleaner!FProjectCleanerModule::PluginButtonClicked() [D:\build\++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ProjectCleaner\Source\ProjectCleaner\Private\ProjectCleaner.cpp:80]

scan method optimizations

  • add option for filtering data based on path
  • optimize scan methods, performance should be ok, even on large projects
  • all scan logic must be in subsystem class (but not exposed to blueprints, for blueprints we will use separate AsyncNode)
  • must have multiple choice of scanning
    1. Via user interface of plugin
    2. Via Blueprints (Async node will be available)
    3. Via Commandlets
    4. Via Python scripts

Add ChunkSize to UI.

User can pick amount of assets to delete at a time. This is to prevent Engine to Freeze

some assets still deleted from excluded folder

I got project singleton set to blueprint deriving from c++ class, it got deleted despite of being directly in excluded folder (actually also some other blueprints got deleted residing in sub folders, should sub folders be added separately?)

keeps saying that not all Redirectories are fixed

I get a message saying "failed to scan the project because not all Redirectories are fixed but I've fixed up Redirectories on the main content folder already, I tried reinstalling the plugin but the issue wasn't solved, I'm using UE5.2.1 Source

Hide folders with no unused assets from tree view

The tree view is working really well, but I noticed that the folder tree shows every folder in the project, rather than only ones that actually have unused assets in them. Is it possible to filter the folders and hide ones that will display "no assets"?

UE 5.0.3 support

I installed the plugin for newly released 5.0.3, it causes an error and prevents opening the project. The update might've broke something in the plugin.

Tree view for Unused Assets tab

Great plugin! This the first one of these kind of plugins that I found to actually work properly (doesn't mark primary assets, assets used by C++, etc).

Currently you get all the assets sorted by name, which is a great start, but it can be difficult to investigate which groups of assets you want to keep and which not.

When you have a large amount of unused assets in the project, it would be very useful if the Unused Assets tab had a tree view for the directories they're in. Then you could very quickly drill down which folders are useless and which ones are known to still be needed for some thing in the future, or quickly isolate folders that aren't related to your work and you're not sure about.

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.