mirror of
https://github.com/gmh5225/awesome-game-security
synced 2026-06-21 13:56:22 +00:00
archive: add 5 repo prompt(s) [skip ci]
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,984 @@
|
||||
Project Path: arc_RomanceTheHeart_Automation_Examples_1pxwzapz
|
||||
|
||||
Source Tree:
|
||||
|
||||
```txt
|
||||
arc_RomanceTheHeart_Automation_Examples_1pxwzapz
|
||||
├── Automation_Examples.uproject
|
||||
├── Config
|
||||
│ ├── DefaultEditor.ini
|
||||
│ ├── DefaultEngine.ini
|
||||
│ └── DefaultGame.ini
|
||||
├── Content
|
||||
│ ├── BluePrints
|
||||
│ │ ├── BP_ActionUtilityFunctions.uasset
|
||||
│ │ └── BP_BugFix.uasset
|
||||
│ ├── Images
|
||||
│ │ └── Example_picture.uasset
|
||||
│ └── StarterContent
|
||||
│ ├── Architecture
|
||||
│ │ ├── DryWall_400x200.uasset
|
||||
│ │ ├── DryWall_400x300.uasset
|
||||
│ │ ├── DryWall_400x400.uasset
|
||||
│ │ ├── DryWall_500x500.uasset
|
||||
│ │ ├── DryWall_Door_400x300.uasset
|
||||
│ │ ├── DryWall_Door_400x400.uasset
|
||||
│ │ ├── DryWall_Window_400x300.uasset
|
||||
│ │ ├── DryWall_Window_400x400.uasset
|
||||
│ │ ├── Floor_400x400.uasset
|
||||
│ │ ├── Pillar_50x500.uasset
|
||||
│ │ ├── SM_AssetPlatform.uasset
|
||||
│ │ ├── Wall_400x200.uasset
|
||||
│ │ ├── Wall_Door_400x300.uasset
|
||||
│ │ └── Wall_Window_400x300.uasset
|
||||
│ ├── Audio
|
||||
│ │ ├── Collapse01.uasset
|
||||
│ │ ├── Collapse02.uasset
|
||||
│ │ ├── Collapse_Cue.uasset
|
||||
│ │ ├── Explosion01.uasset
|
||||
│ │ ├── Explosion02.uasset
|
||||
│ │ ├── Explosion_Cue.uasset
|
||||
│ │ ├── Fire01.uasset
|
||||
│ │ ├── Fire01_Cue.uasset
|
||||
│ │ ├── Fire_Sparks01.uasset
|
||||
│ │ ├── Fire_Sparks01_Cue.uasset
|
||||
│ │ ├── Light01.uasset
|
||||
│ │ ├── Light01_Cue.uasset
|
||||
│ │ ├── Light02.uasset
|
||||
│ │ ├── Light02_Cue.uasset
|
||||
│ │ ├── Smoke01.uasset
|
||||
│ │ ├── Smoke01_Cue.uasset
|
||||
│ │ ├── Starter_Background_Cue.uasset
|
||||
│ │ ├── Starter_Birds01.uasset
|
||||
│ │ ├── Starter_Music01.uasset
|
||||
│ │ ├── Starter_Music_Cue.uasset
|
||||
│ │ ├── Starter_Wind05.uasset
|
||||
│ │ ├── Starter_Wind06.uasset
|
||||
│ │ ├── Steam01.uasset
|
||||
│ │ └── Steam01_Cue.uasset
|
||||
│ ├── Blueprints
|
||||
│ │ ├── Assets
|
||||
│ │ │ ├── FogBrightnessLUT.uasset
|
||||
│ │ │ ├── M_LightStage_Arrows.uasset
|
||||
│ │ │ ├── M_LightStage_Skybox_Black.uasset
|
||||
│ │ │ ├── M_LightStage_Skybox_HDRI.uasset
|
||||
│ │ │ ├── M_LightStage_Skybox_Master.uasset
|
||||
│ │ │ ├── SM_Arrows.uasset
|
||||
│ │ │ ├── Skybox.uasset
|
||||
│ │ │ └── SunlightColorLUT.uasset
|
||||
│ │ ├── BP_LightStudio.uasset
|
||||
│ │ ├── Blueprint_CeilingLight.uasset
|
||||
│ │ ├── Blueprint_Effect_Explosion.uasset
|
||||
│ │ ├── Blueprint_Effect_Fire.uasset
|
||||
│ │ ├── Blueprint_Effect_Smoke.uasset
|
||||
│ │ ├── Blueprint_Effect_Sparks.uasset
|
||||
│ │ ├── Blueprint_Effect_Steam.uasset
|
||||
│ │ └── Blueprint_WallSconce.uasset
|
||||
│ ├── HDRI
|
||||
│ │ └── HDRI_Epic_Courtyard_Daylight.uasset
|
||||
│ ├── Maps
|
||||
│ │ ├── Advanced_Lighting.umap
|
||||
│ │ ├── Advanced_Lighting_BuiltData.uasset
|
||||
│ │ ├── Minimal_Default.umap
|
||||
│ │ ├── Minimal_Default_BuiltData.uasset
|
||||
│ │ ├── StarterMap.umap
|
||||
│ │ └── StarterMap_BuiltData.uasset
|
||||
│ ├── Materials
|
||||
│ │ ├── M_AssetPlatform.uasset
|
||||
│ │ ├── M_Basic_Floor.uasset
|
||||
│ │ ├── M_Basic_Wall.uasset
|
||||
│ │ ├── M_Brick_Clay_Beveled.uasset
|
||||
│ │ ├── M_Brick_Clay_New.uasset
|
||||
│ │ ├── M_Brick_Clay_Old.uasset
|
||||
│ │ ├── M_Brick_Cut_Stone.uasset
|
||||
│ │ ├── M_Brick_Hewn_Stone.uasset
|
||||
│ │ ├── M_Ceramic_Tile_Checker.uasset
|
||||
│ │ ├── M_CobbleStone_Pebble.uasset
|
||||
│ │ ├── M_CobbleStone_Rough.uasset
|
||||
│ │ ├── M_CobbleStone_Smooth.uasset
|
||||
│ │ ├── M_ColorGrid_LowSpec.uasset
|
||||
│ │ ├── M_Concrete_Grime.uasset
|
||||
│ │ ├── M_Concrete_Panels.uasset
|
||||
│ │ ├── M_Concrete_Poured.uasset
|
||||
│ │ ├── M_Concrete_Tiles.uasset
|
||||
│ │ ├── M_Glass.uasset
|
||||
│ │ ├── M_Ground_Grass.uasset
|
||||
│ │ ├── M_Ground_Gravel.uasset
|
||||
│ │ ├── M_Ground_Moss.uasset
|
||||
│ │ ├── M_Metal_Brushed_Nickel.uasset
|
||||
│ │ ├── M_Metal_Burnished_Steel.uasset
|
||||
│ │ ├── M_Metal_Chrome.uasset
|
||||
│ │ ├── M_Metal_Copper.uasset
|
||||
│ │ ├── M_Metal_Gold.uasset
|
||||
│ │ ├── M_Metal_Rust.uasset
|
||||
│ │ ├── M_Metal_Steel.uasset
|
||||
│ │ ├── M_Rock_Basalt.uasset
|
||||
│ │ ├── M_Rock_Marble_Polished.uasset
|
||||
│ │ ├── M_Rock_Sandstone.uasset
|
||||
│ │ ├── M_Rock_Slate.uasset
|
||||
│ │ ├── M_Tech_Checker_Dot.uasset
|
||||
│ │ ├── M_Tech_Hex_Tile.uasset
|
||||
│ │ ├── M_Tech_Hex_Tile_Pulse.uasset
|
||||
│ │ ├── M_Tech_Panel.uasset
|
||||
│ │ ├── M_Water_Lake.uasset
|
||||
│ │ ├── M_Water_Ocean.uasset
|
||||
│ │ ├── M_Wood_Floor_Walnut_Polished.uasset
|
||||
│ │ ├── M_Wood_Floor_Walnut_Worn.uasset
|
||||
│ │ ├── M_Wood_Oak.uasset
|
||||
│ │ ├── M_Wood_Pine.uasset
|
||||
│ │ └── M_Wood_Walnut.uasset
|
||||
│ ├── Particles
|
||||
│ │ ├── Materials
|
||||
│ │ │ ├── M_Burst.uasset
|
||||
│ │ │ ├── M_Dust_Particle.uasset
|
||||
│ │ │ ├── M_Fire_SubUV.uasset
|
||||
│ │ │ ├── M_Heat_Distortion.uasset
|
||||
│ │ │ ├── M_Radial_Gradient.uasset
|
||||
│ │ │ ├── M_Spark.uasset
|
||||
│ │ │ ├── M_explosion_subUV.uasset
|
||||
│ │ │ ├── M_radial_ramp.uasset
|
||||
│ │ │ ├── M_smoke_subUV.uasset
|
||||
│ │ │ └── m_flare_01.uasset
|
||||
│ │ ├── P_Ambient_Dust.uasset
|
||||
│ │ ├── P_Explosion.uasset
|
||||
│ │ ├── P_Fire.uasset
|
||||
│ │ ├── P_Smoke.uasset
|
||||
│ │ ├── P_Sparks.uasset
|
||||
│ │ └── P_Steam_Lit.uasset
|
||||
│ ├── Props
|
||||
│ │ ├── MaterialSphere.uasset
|
||||
│ │ ├── Materials
|
||||
│ │ │ ├── M_Bush.uasset
|
||||
│ │ │ ├── M_Chair.uasset
|
||||
│ │ │ ├── M_Door.uasset
|
||||
│ │ │ ├── M_Frame.uasset
|
||||
│ │ │ ├── M_Lamp.uasset
|
||||
│ │ │ ├── M_MaterialSphere.uasset
|
||||
│ │ │ ├── M_MaterialSphere_Plain.uasset
|
||||
│ │ │ ├── M_Rock.uasset
|
||||
│ │ │ ├── M_Shelf.uasset
|
||||
│ │ │ ├── M_Statue.uasset
|
||||
│ │ │ ├── M_StatueGlass.uasset
|
||||
│ │ │ └── M_TableRound.uasset
|
||||
│ │ ├── SM_Bush.uasset
|
||||
│ │ ├── SM_Chair.uasset
|
||||
│ │ ├── SM_CornerFrame.uasset
|
||||
│ │ ├── SM_Couch.uasset
|
||||
│ │ ├── SM_Door.uasset
|
||||
│ │ ├── SM_DoorFrame.uasset
|
||||
│ │ ├── SM_GlassWindow.uasset
|
||||
│ │ ├── SM_Lamp_Ceiling.uasset
|
||||
│ │ ├── SM_Lamp_Wall.uasset
|
||||
│ │ ├── SM_MatPreviewMesh_02.uasset
|
||||
│ │ ├── SM_PillarFrame.uasset
|
||||
│ │ ├── SM_PillarFrame300.uasset
|
||||
│ │ ├── SM_Rock.uasset
|
||||
│ │ ├── SM_Shelf.uasset
|
||||
│ │ ├── SM_Stairs.uasset
|
||||
│ │ ├── SM_Statue.uasset
|
||||
│ │ ├── SM_TableRound.uasset
|
||||
│ │ └── SM_WindowFrame.uasset
|
||||
│ ├── Shapes
|
||||
│ │ ├── Shape_Cone.uasset
|
||||
│ │ ├── Shape_Cube.uasset
|
||||
│ │ ├── Shape_Cylinder.uasset
|
||||
│ │ ├── Shape_NarrowCapsule.uasset
|
||||
│ │ ├── Shape_Pipe.uasset
|
||||
│ │ ├── Shape_Pipe_180.uasset
|
||||
│ │ ├── Shape_Pipe_90.uasset
|
||||
│ │ ├── Shape_Plane.uasset
|
||||
│ │ ├── Shape_QuadPyramid.uasset
|
||||
│ │ ├── Shape_Sphere.uasset
|
||||
│ │ ├── Shape_Torus.uasset
|
||||
│ │ ├── Shape_TriPyramid.uasset
|
||||
│ │ ├── Shape_Trim.uasset
|
||||
│ │ ├── Shape_Trim_90_In.uasset
|
||||
│ │ ├── Shape_Trim_90_Out.uasset
|
||||
│ │ ├── Shape_Tube.uasset
|
||||
│ │ ├── Shape_Wedge_A.uasset
|
||||
│ │ ├── Shape_Wedge_B.uasset
|
||||
│ │ └── Shape_WideCapsule.uasset
|
||||
│ └── Textures
|
||||
│ ├── T_Brick_Clay_Beveled_D.uasset
|
||||
│ ├── T_Brick_Clay_Beveled_M.uasset
|
||||
│ ├── T_Brick_Clay_Beveled_N.uasset
|
||||
│ ├── T_Brick_Clay_New_D.uasset
|
||||
│ ├── T_Brick_Clay_New_M.uasset
|
||||
│ ├── T_Brick_Clay_New_N.uasset
|
||||
│ ├── T_Brick_Clay_Old_D.uasset
|
||||
│ ├── T_Brick_Clay_Old_N.uasset
|
||||
│ ├── T_Brick_Cut_Stone_D.uasset
|
||||
│ ├── T_Brick_Cut_Stone_N.uasset
|
||||
│ ├── T_Brick_Hewn_Stone_D.uasset
|
||||
│ ├── T_Brick_Hewn_Stone_M.uasset
|
||||
│ ├── T_Brick_Hewn_Stone_N.uasset
|
||||
│ ├── T_Burst_M.uasset
|
||||
│ ├── T_Bush_D.uasset
|
||||
│ ├── T_Bush_N.uasset
|
||||
│ ├── T_Ceramic_Tile_M.uasset
|
||||
│ ├── T_Ceramic_Tile_N.uasset
|
||||
│ ├── T_Chair_M.uasset
|
||||
│ ├── T_Chair_N.uasset
|
||||
│ ├── T_Checker_Noise_M.uasset
|
||||
│ ├── T_CobbleStone_Pebble_D.uasset
|
||||
│ ├── T_CobbleStone_Pebble_M.uasset
|
||||
│ ├── T_CobbleStone_Pebble_N.uasset
|
||||
│ ├── T_CobbleStone_Rough_D.uasset
|
||||
│ ├── T_CobbleStone_Rough_N.uasset
|
||||
│ ├── T_CobbleStone_Smooth_D.uasset
|
||||
│ ├── T_CobbleStone_Smooth_M.uasset
|
||||
│ ├── T_CobbleStone_Smooth_N.uasset
|
||||
│ ├── T_Concrete_Grime_D.uasset
|
||||
│ ├── T_Concrete_Panels_D.uasset
|
||||
│ ├── T_Concrete_Panels_N.uasset
|
||||
│ ├── T_Concrete_Poured_D.uasset
|
||||
│ ├── T_Concrete_Poured_N.uasset
|
||||
│ ├── T_Concrete_Tiles_D.uasset
|
||||
│ ├── T_Concrete_Tiles_M.uasset
|
||||
│ ├── T_Concrete_Tiles_N.uasset
|
||||
│ ├── T_Concrete_Tiles_Variation_M.uasset
|
||||
│ ├── T_Detail_Rocky_N.uasset
|
||||
│ ├── T_Door_M.uasset
|
||||
│ ├── T_Door_N.uasset
|
||||
│ ├── T_Dust_Particle_D.uasset
|
||||
│ ├── T_Explosion_SubUV.uasset
|
||||
│ ├── T_Fire_SubUV.uasset
|
||||
│ ├── T_Fire_Tiled_D.uasset
|
||||
│ ├── T_Frame_M.uasset
|
||||
│ ├── T_Frame_N.uasset
|
||||
│ ├── T_Gradinet_01.uasset
|
||||
│ ├── T_Ground_Grass_D.uasset
|
||||
│ ├── T_Ground_Grass_N.uasset
|
||||
│ ├── T_Ground_Gravel_D.uasset
|
||||
│ ├── T_Ground_Gravel_N.uasset
|
||||
│ ├── T_Ground_Moss_N.uasset
|
||||
│ ├── T_Lamp_M.uasset
|
||||
│ ├── T_Lamp_N.uasset
|
||||
│ ├── T_MacroVariation.uasset
|
||||
│ ├── T_Metal_Aluminum_D.uasset
|
||||
│ ├── T_Metal_Copper_D.uasset
|
||||
│ ├── T_Metal_Gold_D.uasset
|
||||
│ ├── T_Metal_Gold_N.uasset
|
||||
│ ├── T_Metal_Rust_D.uasset
|
||||
│ ├── T_Metal_Rust_N.uasset
|
||||
│ ├── T_Metal_Steel_D.uasset
|
||||
│ ├── T_Metal_Steel_N.uasset
|
||||
│ ├── T_Perlin_Noise_M.uasset
|
||||
│ ├── T_RockMesh_M.uasset
|
||||
│ ├── T_RockMesh_N.uasset
|
||||
│ ├── T_Rock_Basalt_D.uasset
|
||||
│ ├── T_Rock_Basalt_N.uasset
|
||||
│ ├── T_Rock_Marble_Polished_D.uasset
|
||||
│ ├── T_Rock_Sandstone_D.uasset
|
||||
│ ├── T_Rock_Sandstone_N.uasset
|
||||
│ ├── T_Rock_Slate_D.uasset
|
||||
│ ├── T_Rock_Slate_N.uasset
|
||||
│ ├── T_Rock_Smooth_Granite_D.uasset
|
||||
│ ├── T_Shelf_M.uasset
|
||||
│ ├── T_Shelf_N.uasset
|
||||
│ ├── T_Single_Tile_N.uasset
|
||||
│ ├── T_Smoke_SubUV.uasset
|
||||
│ ├── T_Smoke_Tiled_D.uasset
|
||||
│ ├── T_Spark_Core.uasset
|
||||
│ ├── T_Statue_M.uasset
|
||||
│ ├── T_Statue_N.uasset
|
||||
│ ├── T_TableRound_M.uasset
|
||||
│ ├── T_TableRound_N.uasset
|
||||
│ ├── T_Tech_Dot_M.uasset
|
||||
│ ├── T_Tech_Dot_N.uasset
|
||||
│ ├── T_Tech_Hex_Tile_M.uasset
|
||||
│ ├── T_Tech_Hex_Tile_N.uasset
|
||||
│ ├── T_Tech_Panel_M.uasset
|
||||
│ ├── T_Tech_Panel_N.uasset
|
||||
│ ├── T_Water_M.uasset
|
||||
│ ├── T_Water_N.uasset
|
||||
│ ├── T_Wood_Floor_Walnut_D.uasset
|
||||
│ ├── T_Wood_Floor_Walnut_M.uasset
|
||||
│ ├── T_Wood_Floor_Walnut_N.uasset
|
||||
│ ├── T_Wood_Oak_D.uasset
|
||||
│ ├── T_Wood_Oak_N.uasset
|
||||
│ ├── T_Wood_Pine_D.uasset
|
||||
│ ├── T_Wood_Pine_N.uasset
|
||||
│ ├── T_Wood_Walnut_D.uasset
|
||||
│ ├── T_Wood_Walnut_N.uasset
|
||||
│ └── T_ground_Moss_D.uasset
|
||||
├── README.md
|
||||
└── Source
|
||||
├── Automation_Examples
|
||||
│ ├── ActionUntilities
|
||||
│ │ ├── ActionUtilityFunctions.cpp
|
||||
│ │ └── ActionUtilityFunctions.h
|
||||
│ ├── AutomationDashBoard.cpp
|
||||
│ ├── AutomationDashBoard.h
|
||||
│ ├── Automation_Examples.Build.cs
|
||||
│ ├── Automation_Examples.cpp
|
||||
│ ├── Automation_Examples.h
|
||||
│ ├── Automation_ExamplesGameModeBase.cpp
|
||||
│ └── Automation_ExamplesGameModeBase.h
|
||||
├── Automation_Examples.Target.cs
|
||||
└── Automation_ExamplesEditor.Target.cs
|
||||
|
||||
```
|
||||
|
||||
`Automation_Examples.uproject`:
|
||||
|
||||
```uproject
|
||||
{
|
||||
"FileVersion": 3,
|
||||
"EngineAssociation": "4.25",
|
||||
"Category": "",
|
||||
"Description": "",
|
||||
"Modules": [
|
||||
{
|
||||
"Name": "Automation_Examples",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "Default",
|
||||
"AdditionalDependencies": [
|
||||
"Blutility"
|
||||
]
|
||||
}
|
||||
],
|
||||
"Plugins": [
|
||||
{
|
||||
"Name": "PythonScriptPlugin",
|
||||
"Enabled": true
|
||||
},
|
||||
{
|
||||
"Name": "PythonAutomationTest",
|
||||
"Enabled": true
|
||||
},
|
||||
{
|
||||
"Name": "SequencerScripting",
|
||||
"Enabled": true
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
`Config/DefaultEngine.ini`:
|
||||
|
||||
```ini
|
||||
|
||||
|
||||
[/Script/HardwareTargeting.HardwareTargetingSettings]
|
||||
TargetedHardwareClass=Desktop
|
||||
AppliedTargetedHardwareClass=Desktop
|
||||
DefaultGraphicsPerformance=Maximum
|
||||
AppliedDefaultGraphicsPerformance=Maximum
|
||||
|
||||
[/Script/EngineSettings.GameMapsSettings]
|
||||
EditorStartupMap=/Game/StarterContent/Maps/Minimal_Default
|
||||
GameDefaultMap=/Game/StarterContent/Maps/Minimal_Default
|
||||
|
||||
[/Script/Engine.Engine]
|
||||
+ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/Automation_Examples")
|
||||
+ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/Automation_Examples")
|
||||
+ActiveClassRedirects=(OldClassName="TP_BlankGameModeBase",NewClassName="Automation_ExamplesGameModeBase")
|
||||
|
||||
[/Script/PythonScriptPlugin.PythonScriptPluginSettings]
|
||||
bDeveloperMode=True
|
||||
|
||||
|
||||
```
|
||||
|
||||
`Config/DefaultGame.ini`:
|
||||
|
||||
```ini
|
||||
|
||||
[/Script/EngineSettings.GeneralProjectSettings]
|
||||
ProjectID=493DAAE241B3C6053468C7BA263A6977
|
||||
|
||||
[StartupActions]
|
||||
bAddPacks=True
|
||||
InsertPack=(PackSource="StarterContent.upack",PackName="StarterContent")
|
||||
|
||||
```
|
||||
|
||||
`README.md`:
|
||||
|
||||
```md
|
||||
# Automation_Examples
|
||||
|
||||
Developed with Unreal Engine 4
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples.Target.cs`:
|
||||
|
||||
```cs
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
using UnrealBuildTool;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class Automation_ExamplesTarget : TargetRules
|
||||
{
|
||||
public Automation_ExamplesTarget( TargetInfo Target) : base(Target)
|
||||
{
|
||||
Type = TargetType.Game;
|
||||
DefaultBuildSettings = BuildSettingsVersion.V2;
|
||||
ExtraModuleNames.AddRange( new string[] { "Automation_Examples" } );
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/ActionUntilities/ActionUtilityFunctions.cpp`:
|
||||
|
||||
```cpp
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "ActionUtilityFunctions.h"
|
||||
#include "Kismet\BlueprintFunctionLibrary.h"
|
||||
#include "EditorUtilityLibrary.h"
|
||||
#include "EditorAssetLibrary.h"
|
||||
#include "EditorScriptingUtilities\Public\EditorAssetLibrary.h"
|
||||
#include "Engine/Texture.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
**Not that to Use the Editor Utilities Library.
|
||||
You must add the Blutility module to the build file
|
||||
plus a public reference to this file or else this will not compile.
|
||||
Further more there is a glitch in Unreal. You have to create a Blueprint
|
||||
Editor utility, then you have to create a blueprint based on this class
|
||||
in order for this to work properly.**
|
||||
|
||||
*/
|
||||
|
||||
#pragma region AddPrefixes
|
||||
void UActionUtilityFunctions::AddPrefixes()
|
||||
{
|
||||
TArray<UObject*> SelectedObjects = UEditorUtilityLibrary::GetSelectedAssets();
|
||||
uint32 Counter{ 0 };
|
||||
for (UObject* selectedobjects : SelectedObjects)
|
||||
{
|
||||
if (ensure(selectedobjects))
|
||||
{
|
||||
const FString* Prefix = PrefixMap.Find(selectedobjects->GetClass());
|
||||
if (ensure(Prefix) && !Prefix->Equals(""))
|
||||
{
|
||||
FString OldName = selectedobjects->GetName();
|
||||
if (!OldName.StartsWith(*Prefix))
|
||||
{
|
||||
FString NewName = *Prefix + OldName;
|
||||
UEditorUtilityLibrary::RenameAsset(selectedobjects, NewName);
|
||||
Counter++;
|
||||
|
||||
}
|
||||
}
|
||||
else { Display(("Couldn't find prefix for: ") + (selectedobjects->GetName()), FColor::Red); }
|
||||
}
|
||||
} GiveFeedback(TEXT(" Prefixed: "), Counter);
|
||||
|
||||
}
|
||||
#pragma endregion AddPrefixes
|
||||
|
||||
|
||||
|
||||
#pragma region RenameAssets
|
||||
|
||||
void UActionUtilityFunctions::RenameSelectedAssets(FString searchphrase, FString replacementphrase, ESearchCase::Type searchcase)
|
||||
{
|
||||
if (searchphrase.IsEmpty() || searchphrase.Equals(replacementphrase, searchcase)) { return; }
|
||||
TArray<UObject*> SelectedObjects = UEditorUtilityLibrary::GetSelectedAssets();
|
||||
uint32 Counter{ 0 };
|
||||
for (UObject* selectedobject : SelectedObjects)
|
||||
{
|
||||
if (!selectedobject) { return; }
|
||||
|
||||
FString AssetName = selectedobject->GetName();
|
||||
if (AssetName.Contains(searchphrase, searchcase))
|
||||
{
|
||||
FString NewName = AssetName.Replace(*searchphrase, *replacementphrase, searchcase);
|
||||
UEditorUtilityLibrary::RenameAsset(selectedobject, NewName);
|
||||
Counter++;
|
||||
GiveFeedback(TEXT(" Renamed: "), Counter);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#pragma endregion RenameAssets
|
||||
|
||||
|
||||
#pragma region CheckPowerofTwo
|
||||
|
||||
void UActionUtilityFunctions::CheckPowerofTwo()
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 3.0, FColor::Black, (TEXT(" Checking...")));
|
||||
TArray<UObject*> SelectedObjects = UEditorUtilityLibrary::GetSelectedAssets();
|
||||
uint32 Counter{ 0 };
|
||||
|
||||
for (UObject* selectedobject : SelectedObjects)
|
||||
{
|
||||
if (!selectedobject) { return; }
|
||||
|
||||
UTexture* Texture = dynamic_cast<UTexture*>(selectedobject);
|
||||
if (!Texture) { return; }
|
||||
if (Texture) {
|
||||
int32 Width = static_cast<int32>(Texture->GetSurfaceWidth());
|
||||
int32 Height = static_cast<int32>(Texture->GetSurfaceHeight());
|
||||
if (!IsPowerOfTwo(Width) || !IsPowerOfTwo(Height))
|
||||
{
|
||||
|
||||
GEngine->AddOnScreenDebugMessage(-1, 3.0, FColor::Green, (TEXT("%s "), selectedobject->GetName() + " is a Power of two."));
|
||||
}
|
||||
else
|
||||
{
|
||||
++Counter;
|
||||
GEngine->AddOnScreenDebugMessage(-1, 3.0, FColor::Red, (TEXT("%s "), selectedobject->GetName() + " not is a Power of two."));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 3.0, FColor::Black, (TEXT("%s "), selectedobject->GetName() + " is not a selected texture"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool UActionUtilityFunctions::IsPowerOfTwo(int32 numbertocheck)
|
||||
{
|
||||
while (numbertocheck % 2 == 0)
|
||||
{
|
||||
numbertocheck = numbertocheck / 2;
|
||||
if (numbertocheck % 2 != 0 && numbertocheck != 1) { return true; }
|
||||
|
||||
}
|
||||
return false;
|
||||
// This is just a test.
|
||||
}
|
||||
#pragma endregion CheckPowerofTwo
|
||||
|
||||
|
||||
|
||||
#pragma region PrivateFunctions
|
||||
|
||||
|
||||
void UActionUtilityFunctions::Display(FString string, FColor color)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 3.0f, color, string);
|
||||
}
|
||||
|
||||
void UActionUtilityFunctions::GiveFeedback(FString string, uint32 counter)
|
||||
{
|
||||
|
||||
FString message = FString(" No matching files found. ");
|
||||
FColor color = (counter > 0 ? FColor::Green : FColor::Red);
|
||||
if (counter > 0)
|
||||
{
|
||||
message = string.AppendChar(' ');
|
||||
message.AppendInt(counter);
|
||||
message.Append(counter == 1 ? TEXT(" file ") : TEXT(" files "));
|
||||
|
||||
Display(message, color);
|
||||
}
|
||||
|
||||
}
|
||||
#pragma endregion PrivateFunctions
|
||||
|
||||
|
||||
#pragma region FileCleanUp
|
||||
|
||||
void UActionUtilityFunctions::CleanUp(FString parentfolder)
|
||||
{
|
||||
// check if the parent folder starts with:/Game
|
||||
if (!parentfolder.StartsWith(TEXT("/Game")))
|
||||
{
|
||||
//if not, put this in front of it.
|
||||
parentfolder = FPaths::Combine(TEXT("/Game"), parentfolder);
|
||||
|
||||
}
|
||||
//everything is pretty much the same after//
|
||||
TArray<UObject*> SelectedObjects = UEditorUtilityLibrary::GetSelectedAssets();
|
||||
uint32 Counter{ 0 };
|
||||
for (UObject* selectedobject : SelectedObjects)
|
||||
{
|
||||
if (ensure(selectedobject))
|
||||
{
|
||||
// create a new to the parent folder combined with the class and the object selected and the object name.
|
||||
FString NewPath = FPaths::Combine(parentfolder, selectedobject->GetClass()->GetName(), selectedobject->GetName());
|
||||
|
||||
//in order to execute this next line: #include "EditorAssetLibrary", Plus include:
|
||||
//"EditorScriptingUtilities" into the build file.
|
||||
if (UEditorAssetLibrary::RenameLoadedAsset(selectedobject, NewPath))
|
||||
{
|
||||
Counter++;
|
||||
}
|
||||
|
||||
else {
|
||||
Display("Couldn't Move" + selectedobject->GetName(), FColor::Red);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GiveFeedback("Moved: ", Counter);
|
||||
|
||||
}
|
||||
|
||||
#pragma endregion FileCleanUp
|
||||
|
||||
|
||||
#pragma region AssetDuplicator
|
||||
|
||||
void UActionUtilityFunctions::AssetDuplicator(uint32 numberofduplicates, bool bSave)
|
||||
{
|
||||
//Note How this is not a pointer.??
|
||||
TArray<FAssetData> AssetDataArray = UEditorUtilityLibrary::GetSelectedAssetData();
|
||||
|
||||
uint32 Counter{ 0 };
|
||||
//Gets all the selected assets
|
||||
for (FAssetData currentasset : AssetDataArray)
|
||||
{
|
||||
// for loops iterates from '0' to the number of assets we'd like to create.
|
||||
for (uint32 iter = { 0 }; iter < numberofduplicates; ++iter)
|
||||
{
|
||||
//Assign the old file name and append the number of the current copy.
|
||||
FString NewFileName = currentasset.AssetName.ToString().Append(FString("_")).Append(FString::FromInt(iter));
|
||||
|
||||
// Path is the same as the previous asset has, it differs by the file name.
|
||||
FString NewPath = FPaths::Combine(currentasset.PackagePath.ToString(), NewFileName);
|
||||
|
||||
if (ensure(UEditorAssetLibrary::DuplicateAsset(currentasset.ObjectPath.ToString(), NewPath)))
|
||||
{
|
||||
++Counter;
|
||||
if (bSave)
|
||||
{
|
||||
UEditorAssetLibrary::SaveAsset(NewPath, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma endregion AssetDuplicator
|
||||
|
||||
|
||||
#pragma region RemoveUnusedObjects
|
||||
void UActionUtilityFunctions::RemoveUnusedObjects(bool Bdeleteimmedietely)
|
||||
{
|
||||
//As usual create an array to iterate through our selected objects
|
||||
TArray<UObject*>SelectedObjects = UEditorUtilityLibrary::GetSelectedAssets();
|
||||
//Now create an empty array to store selected objects.
|
||||
TArray<UObject*> UnusedObjects = TArray<UObject*>();
|
||||
//looping thought selected......
|
||||
for (UObject* currentobject : SelectedObjects)
|
||||
{
|
||||
if (ensure(currentobject))
|
||||
{
|
||||
if (UEditorAssetLibrary::FindPackageReferencersForAsset(currentobject->GetPathName(), true).Num() <= 0)
|
||||
{ //Adding the objects selected to the empty array.
|
||||
UnusedObjects.Add(currentobject);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
uint32 Counter{0};
|
||||
|
||||
//Now we can iterate over the unused objects.
|
||||
for (UObject* currentunused : UnusedObjects)
|
||||
{
|
||||
if (Bdeleteimmedietely)
|
||||
{
|
||||
if (UEditorAssetLibrary::DeleteLoadedAsset(currentunused))
|
||||
{
|
||||
++Counter;
|
||||
}
|
||||
else
|
||||
{
|
||||
Display("Error deleting objects " + currentunused->GetPathName(), FColor::Red);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FString NewPath = FPaths::Combine(TEXT("/Game"), TEXT("Trash"), currentunused->GetName());
|
||||
if (UEditorAssetLibrary::RenameLoadedAsset(currentunused, NewPath))
|
||||
{
|
||||
++Counter;
|
||||
}
|
||||
else
|
||||
{
|
||||
Display("Error Moving these objects:"+currentunused->GetPathName(), FColor::Red); }
|
||||
}
|
||||
}
|
||||
GiveFeedback(Bdeleteimmedietely ? " %d Deleted" : " %d Moved to trash: ", Counter);
|
||||
}
|
||||
#pragma endregion RemoveUnusedObjects
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/ActionUntilities/ActionUtilityFunctions.h`:
|
||||
|
||||
```h
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "AssetActionUtility.h"
|
||||
#include "Materials/Material.h"
|
||||
#include "Materials/MaterialInstance.h"
|
||||
#include "Particles/ParticleSystem.h"
|
||||
#include "Sound/SoundCue.h"
|
||||
#include "Sound/SoundWave.h"
|
||||
#include "Engine/Texture.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "Animation/MorphTarget.h"
|
||||
#include "Components/SkeletalMeshComponent.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#include "ActionUtilityFunctions.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
|
||||
class AUTOMATION_EXAMPLES_API UActionUtilityFunctions : public UAssetActionUtility
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(CallInEditor)
|
||||
void RemoveUnusedObjects( bool Bdeleteimmedietely);
|
||||
|
||||
UFUNCTION(CallInEditor)
|
||||
void AssetDuplicator(uint32 numberofduplicates = 1, bool bSave = true);
|
||||
|
||||
UFUNCTION(CallInEditor)
|
||||
void CleanUp(FString parentfolder=FString("/Game"));
|
||||
|
||||
UFUNCTION(CallInEditor)
|
||||
void AddPrefixes();
|
||||
|
||||
UFUNCTION(CallInEditor)
|
||||
void RenameSelectedAssets(FString searchphrase, FString replacementphrase, ESearchCase::Type searchcase);
|
||||
|
||||
UFUNCTION(CallInEditor)
|
||||
void CheckPowerofTwo();
|
||||
|
||||
private:
|
||||
|
||||
// like a dictionary in Python. TMaps hold key, values.
|
||||
const TMap<UClass*, FString> PrefixMap=
|
||||
{
|
||||
{UBlueprint::StaticClass(),TEXT("BP_")},
|
||||
{UStaticMesh::StaticClass(),TEXT("SM_")},
|
||||
{UMaterial::StaticClass(),TEXT("M_")},
|
||||
{UMaterialInstance::StaticClass(),TEXT("MI_")},
|
||||
{UMaterialFunction::StaticClass(),TEXT("MF_")},
|
||||
{UParticleSystem::StaticClass(),TEXT("PS_")},
|
||||
{USoundCue::StaticClass(),TEXT("SC_")},
|
||||
{USoundWave::StaticClass(),TEXT("SW_")},
|
||||
{UTexture::StaticClass(),TEXT("T_")},
|
||||
{UTexture2D::StaticClass(),TEXT("T_")},
|
||||
{UUserWidget::StaticClass(),TEXT("UW_")}, // <--This requires a special module added to the build file.<<<<
|
||||
{UMorphTarget::StaticClass(),TEXT("MT_")},
|
||||
{USkeletalMeshComponent::StaticClass(),TEXT("SK_")}
|
||||
};
|
||||
|
||||
bool IsPowerOfTwo(int32 numbertocheck);
|
||||
// this function is a shortcut to display on screen debug message.
|
||||
void Display(FString string, FColor color);
|
||||
// this function takes a string and appends two values to it.
|
||||
void GiveFeedback(FString string, uint32 counter);
|
||||
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/AutomationDashBoard.cpp`:
|
||||
|
||||
```cpp
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "AutomationDashBoard.h"
|
||||
#include "EditorLevelLibrary.h"
|
||||
|
||||
void UAutomationDashBoard::OrganizeWorldOutliner()
|
||||
{
|
||||
TArray<AActor*> AllActors = UEditorLevelLibrary::GetAllLevelActors();
|
||||
for (AActor* actors : AllActors)
|
||||
{
|
||||
if (ensure(actors))
|
||||
{
|
||||
const FName* FolderName = FolderMap.Find(actors->GetClass());
|
||||
if (ensure(FolderName))
|
||||
{
|
||||
actors->SetFolderPath(*FolderName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/AutomationDashBoard.h`:
|
||||
|
||||
```h
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "EditorUtilityWidget.h"
|
||||
#include "Engine/StaticMeshActor.h"
|
||||
#include "Engine/ReflectionCapture.h"
|
||||
#include "Engine/Skylight.h"
|
||||
|
||||
|
||||
#include "AutomationDashBoard.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class AUTOMATION_EXAMPLES_API UAutomationDashBoard : public UEditorUtilityWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
UPROPERTY(EditAnywhere,BlueprintReadWrite, Category = "OrganizeWorldOutliner")
|
||||
TMap<UClass*, FName> FolderMap =
|
||||
{
|
||||
{AStaticMeshActor::StaticClass(), "Static Meshes"},
|
||||
{AReflectionCapture::StaticClass(), "ReflectionCaptures"},
|
||||
{ASkyLight::StaticClass(), "Lights"}
|
||||
|
||||
|
||||
};
|
||||
|
||||
UFUNCTION(CallInEditor,BlueprintCallable)
|
||||
void OrganizeWorldOutliner();
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/Automation_Examples.Build.cs`:
|
||||
|
||||
```cs
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class Automation_Examples : ModuleRules
|
||||
{
|
||||
public Automation_Examples(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" ,"Blutility","UMG", "EditorScriptingUtilities"});
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||
PublicIncludePaths.AddRange(new string[] { System.IO.Path.GetFullPath(Target.RelativeEnginePath) + "Source/Editor/Blutility/Private" });
|
||||
|
||||
// Uncomment if you are using Slate UI
|
||||
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
||||
|
||||
// Uncomment if you are using online features
|
||||
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
|
||||
|
||||
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/Automation_Examples.cpp`:
|
||||
|
||||
```cpp
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "Automation_Examples.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, Automation_Examples, "Automation_Examples" );
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/Automation_Examples.h`:
|
||||
|
||||
```h
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/Automation_ExamplesGameModeBase.cpp`:
|
||||
|
||||
```cpp
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
|
||||
#include "Automation_ExamplesGameModeBase.h"
|
||||
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_Examples/Automation_ExamplesGameModeBase.h`:
|
||||
|
||||
```h
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "Automation_ExamplesGameModeBase.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class AUTOMATION_EXAMPLES_API AAutomation_ExamplesGameModeBase : public AGameModeBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
`Source/Automation_ExamplesEditor.Target.cs`:
|
||||
|
||||
```cs
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
using UnrealBuildTool;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class Automation_ExamplesEditorTarget : TargetRules
|
||||
{
|
||||
public Automation_ExamplesEditorTarget( TargetInfo Target) : base(Target)
|
||||
{
|
||||
Type = TargetType.Editor;
|
||||
DefaultBuildSettings = BuildSettingsVersion.V2;
|
||||
ExtraModuleNames.AddRange( new string[] { "Automation_Examples" } );
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
+239219
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+354402
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user