Skip to content

Commit 3b92288

Browse files
committed
- add the unused assets reporting script
- update the copyright syling from gitlab repo - update the README file
1 parent 0b33256 commit 3b92288

4 files changed

Lines changed: 53 additions & 4 deletions

File tree

Animation/CleanNotifiesFromAnimations.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# _
2+
# (_)
3+
# _ __ ___ __ _ _ __ ___ ___ _ __ _ ___ _ __ ___
4+
# | '_ ` _ \ / _` | '_ ` _ \ / _ \| '_ \| |/ _ \ '_ ` _ \
5+
# | | | | | | (_| | | | | | | (_) | | | | | __/ | | | | |
6+
# |_| |_| |_|\__,_|_| |_| |_|\___/|_| |_|_|\___|_| |_| |_|
7+
# www.mamoniem.com
8+
# www.ue4u.xyz
9+
#Copyright 2019 Muhammad A.Moniem (@_mamoniem). All Rights Reserved.
10+
#
11+
112
import unreal
213

314
@unreal.uclass()

Assets/ReportUnusedAssets.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# _
2+
# (_)
3+
# _ __ ___ __ _ _ __ ___ ___ _ __ _ ___ _ __ ___
4+
# | '_ ` _ \ / _` | '_ ` _ \ / _ \| '_ \| |/ _ \ '_ ` _ \
5+
# | | | | | | (_| | | | | | | (_) | | | | | __/ | | | | |
6+
# |_| |_| |_|\__,_|_| |_| |_|\___/|_| |_|_|\___|_| |_| |_|
7+
# www.mamoniem.com
8+
# www.ue4u.xyz
9+
#Copyright 2019 Muhammad A.Moniem (@_mamoniem). All Rights Reserved.
10+
#
11+
12+
import unreal
13+
14+
workingPath = "/Game/"
15+
16+
@unreal.uclass()
17+
class GetEditorAssetLibrary(unreal.EditorAssetLibrary):
18+
pass
19+
20+
editorAssetLib = GetEditorAssetLibrary();
21+
22+
allAssets = editorAssetLib.list_assets(workingPath, True, False)
23+
24+
if (len(allAssets) > 0):
25+
for asset in allAssets:
26+
deps = editorAssetLib.find_package_referencers_for_asset(asset, False)
27+
if (len(deps) == 0):
28+
print ">>>%s" % asset

Materials/CreateInstancesOfSelectedMaterial.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
#By Muhammad A.Moniem (@_mamoniem) www.mamoniem.com
2-
#feel free to edit and/or use for any purpose :)
3-
#It requires the Unreal python scripting plugin to be enabled first!
1+
# _
2+
# (_)
3+
# _ __ ___ __ _ _ __ ___ ___ _ __ _ ___ _ __ ___
4+
# | '_ ` _ \ / _` | '_ ` _ \ / _ \| '_ \| |/ _ \ '_ ` _ \
5+
# | | | | | | (_| | | | | | | (_) | | | | | __/ | | | | |
6+
# |_| |_| |_|\__,_|_| |_| |_|\___/|_| |_|_|\___|_| |_| |_|
7+
# www.mamoniem.com
8+
# www.ue4u.xyz
9+
#Copyright 2019 Muhammad A.Moniem (@_mamoniem). All Rights Reserved.
10+
#
411

512
import unreal
613

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ Don't forget to follow this repo, [YouTube](http://www.youtube.com/channel/UCBBc
99

1010
## Aimation ##
1111

12-
1312
- **[CleanNotifiesFromAnimations.py](https://github.com/mamoniem/UnrealEditorPythonScripts/blob/master/Animation/CleanNotifiesFromAnimations.py)** Run on a selected single or multiple animation file(s) in order to clean up the selected file(s) from any animation notifies.
1413

14+
## Assets ##
15+
16+
- **[ReportUnusedAssets.py](https://github.com/mamoniem/UnrealEditorPythonScripts/blob/master/Assets/ReportUnusedAssets.py)** Running this script will look through all the project folders, and add to the log the assets that were found not in a use, or in another work, the assets that have no dependency with any other project files.
17+
1518
## Materials ##
1619
- **[CreateInstancesOfSelectedMaterial.py](https://github.com/mamoniem/UnrealEditorPythonScripts/blob/master/Materials/CreateInstancesOfSelectedMaterial.py)** Run on a selected single or multiple Material file(s) in order to generate material instances of it/them. The number of the final generated instances count can be set within the script before running, by changing the value of the variable *totalRequiredInstances*

0 commit comments

Comments
 (0)