├── .gitattributes ├── .gitignore ├── ChannelMachine.uplugin ├── Content ├── ChannelMachine.uasset ├── Dependencies │ ├── Data │ │ ├── ChannelMachineBlueprints.uasset │ │ ├── ConfigDataSaves │ │ │ ├── DA_DefaultPreset.uasset │ │ │ ├── DA_HighPreset.uasset │ │ │ └── DA_SampleTest.uasset │ │ ├── Enum │ │ │ └── EChannelIdentifier.uasset │ │ ├── PrimaryDataAsset │ │ │ └── PDA_ChannelPresetData.uasset │ │ └── Struct │ │ │ ├── s_ChannelData.uasset │ │ │ ├── s_ConfigurationData.uasset │ │ │ ├── s_PackingOptions.uasset │ │ │ ├── s_PackingTexturesConfig.uasset │ │ │ ├── s_PrefixSuffix.uasset │ │ │ ├── s_UnpackOptions.uasset │ │ │ └── s_UnpackTexturesConfig.uasset │ └── Utilities │ │ ├── Materials │ │ └── MasterMaterials │ │ │ ├── MM_BakeRendererAlphaUnpack.uasset │ │ │ ├── MM_BakeRendererBlueUnpack.uasset │ │ │ ├── MM_BakeRendererGreenUnpack.uasset │ │ │ ├── MM_BakeRendererRGBAPack.uasset │ │ │ └── MM_BakeRendererRedUnpack.uasset │ │ └── Textures │ │ ├── ChannelMachineLogoTitle.uasset │ │ ├── T_GrayscalePreview.uasset │ │ ├── T_RGBAPreview.uasset │ │ └── T_White_Placeholder.uasset └── Python │ ├── OpenWindowsDirectory.py │ └── __pycache__ │ └── OpenWindowsDirectory.cpython-39.pyc ├── LICENSE ├── ReadMe.md ├── Resources ├── ChannelMachineIcon.svg ├── ChannelMachineIcon128.png ├── ChannelMachineLogoTitle.png ├── GreyscalePreview.png ├── Icon128.png ├── MissingMapPreview.png ├── PlaceholderButtonIcon.svg └── RGBAPreview.png └── Source └── ChannelMachine ├── ChannelMachine.Build.cs ├── Private ├── ChannelMachine.cpp ├── ChannelMachineBlueprints.cpp ├── ChannelMachineCommands.cpp └── ChannelMachineStyle.cpp └── Public ├── ChannelMachine.h ├── ChannelMachineBlueprints.h ├── ChannelMachineCommands.h └── ChannelMachineStyle.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Unreal Engine file types. 2 | *.uasset filter=lfs diff=lfs merge=lfs -text 3 | *.umap filter=lfs diff=lfs merge=lfs -text 4 | 5 | # Raw Content file types. 6 | *.fbx filter=lfs diff=lfs merge=lfs -text 7 | *.3ds filter=lfs diff=lfs merge=lfs -text 8 | *.psd filter=lfs diff=lfs merge=lfs -text 9 | *.png filter=lfs diff=lfs merge=lfs -text 10 | *.mp3 filter=lfs diff=lfs merge=lfs -text 11 | *.wav filter=lfs diff=lfs merge=lfs -text 12 | *.xcf filter=lfs diff=lfs merge=lfs -text 13 | *.jpg filter=lfs diff=lfs merge=lfs -text 14 | 15 | # Anything in `/RawContent` dir. 16 | /RawContent/**/* filter=lfs diff=lfs merge=lfs -text -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Visual Studio 2015 user specific files 2 | .vs/ 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | 22 | # Compiled Static libraries 23 | *.lai 24 | *.la 25 | *.a 26 | *.lib 27 | 28 | # Executables 29 | *.exe 30 | *.out 31 | *.app 32 | *.ipa 33 | 34 | # These project files can be generated by the engine 35 | *.xcodeproj 36 | *.xcworkspace 37 | *.sln 38 | *.suo 39 | *.opensdf 40 | *.sdf 41 | *.VC.db 42 | *.VC.opendb 43 | 44 | # Precompiled Assets 45 | SourceArt/**/*.png 46 | SourceArt/**/*.tga 47 | 48 | # Binary Files 49 | Binaries/* 50 | Plugins/*/Binaries/* 51 | 52 | # Builds 53 | Build/* 54 | 55 | # Whitelist PakBlacklist-.txt files 56 | !Build/*/ 57 | Build/*/** 58 | !Build/*/PakBlacklist*.txt 59 | 60 | # Don't ignore icon files in Build 61 | !Build/**/*.ico 62 | 63 | # Built data for maps 64 | *_BuiltData.uasset 65 | 66 | # Configuration files generated by the Editor 67 | Saved/* 68 | 69 | # Compiled source files for the engine to use 70 | Intermediate/* 71 | Plugins/*/Intermediate/* 72 | 73 | # Cache files for the editor to use 74 | DerivedDataCache/* 75 | -------------------------------------------------------------------------------- /ChannelMachine.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0.1", 5 | "FriendlyName": "Channel Machine", 6 | "Description": "An Open Source texture editor tool to pack/unpack texture channels.", 7 | "Category": "Editor", 8 | "CreatedBy": "ashton3ddesigns", 9 | "CreatedByURL": "https://github.com/Kranox21/ChannelMachine", 10 | "DocsURL": "https://github.com/Kranox21/ChannelMachine/blob/main/ReadMe.md", 11 | "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/1203c14fac16490bacab6a7d3577edff", 12 | "SupportURL": "https://github.com/Kranox21/ChannelMachine/issues", 13 | "License": "Copyright 2023 ashton3ddesigns All rights reserved.", 14 | "CanContainContent": true, 15 | "IsBetaVersion": false, 16 | "IsExperimentalVersion": false, 17 | "Installed": false, 18 | "SupportedTargetPlatforms": [ 19 | "Win64" 20 | ], 21 | "SupportedEngineVersions": [ 22 | "5.3" 23 | ], 24 | "Modules": [ 25 | { 26 | "Name": "ChannelMachine", 27 | "Type": "Editor", 28 | "LoadingPhase": "Default", 29 | "PlatformAllowList": [ 30 | "Win64", 31 | "Win32" 32 | ] 33 | } 34 | ], 35 | "Plugins": [ 36 | { 37 | "Name": "PythonScriptPlugin", 38 | "Enabled": true 39 | }, 40 | { 41 | "Name": "EditorScriptingUtilities", 42 | "Enabled": true 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /Content/ChannelMachine.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b92052f5c2024c4b2e5230bb8c573a0642330a31fcdf3ae67c1bf68eb2e5ee8a 3 | size 3608644 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/ChannelMachineBlueprints.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9ec854e249c831e9e88214504ce37ba6ca0eb218dc215160dbcb81b978abfeed 3 | size 66292 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/ConfigDataSaves/DA_DefaultPreset.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c9766c4847d08819884afefc07aabf99eec22f9b559f0c4d8b01e81a892cebe8 3 | size 1865 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/ConfigDataSaves/DA_HighPreset.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:964c432c3959fee5e6b8f3635431b74e8efec06e21eb657899d3a368fdbe4817 3 | size 3466 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/ConfigDataSaves/DA_SampleTest.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:17108dde15947784ee96f7f4f971434dc9ec705bbf5e2b92699d9bdf6a1f71b9 3 | size 3062 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/Enum/EChannelIdentifier.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8926db0713afbe5d4b621de27ea7e107e0a7d705e2cf7a507cbab9144f4eef71 3 | size 7307 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/PrimaryDataAsset/PDA_ChannelPresetData.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:087d6c205c46a403376f5dc6e8f89e405dd398b3125188eecf1fcc04c572311f 3 | size 13019 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/Struct/s_ChannelData.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:19a2597fad16df6240cf0780e534efc0ae7088f8d5170c68cde6399f73b8141a 3 | size 20994 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/Struct/s_ConfigurationData.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:293ab038f80d4cb443e0c5c930f65bde9c2a325800ab3b4791e2881b47709436 3 | size 19739 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/Struct/s_PackingOptions.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2320f2e1a35b85466ea14c7f7944803fd208f22af8cbbfb67e232ae99e0beec2 3 | size 11206 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/Struct/s_PackingTexturesConfig.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d97c1af6289bed2fa359c56118b56517a89317fa1aed7e96e6352fae3f9b2d16 3 | size 7421 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/Struct/s_PrefixSuffix.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e4e56e11538b622f9b57ae74544709ff81d8a7e04ff5a17f966c79e7abd6b891 3 | size 6555 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/Struct/s_UnpackOptions.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c446fbbfed4d580a689ea0af152301a0a6f2856543bcb1e219efad8e28303ef3 3 | size 8459 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Data/Struct/s_UnpackTexturesConfig.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2c0760999873137cc5fc0a4b439774928adf89e6ea52774f33bc08af53755bbf 3 | size 7485 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Materials/MasterMaterials/MM_BakeRendererAlphaUnpack.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c1c4629e773466f3b01516b003a94a003daaa53af69435b6bbc857c19f159f46 3 | size 7962 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Materials/MasterMaterials/MM_BakeRendererBlueUnpack.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c6ea1f8b786899055d68add739167ca78a5f61d735b7a374c5f93dcd1942c0ff 3 | size 10880 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Materials/MasterMaterials/MM_BakeRendererGreenUnpack.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f2cdf75ae991640fccc223d2d10e75649c823d50fc94823343c0c00fa3facbd 3 | size 10946 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Materials/MasterMaterials/MM_BakeRendererRGBAPack.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a113aa4509f695692514d2423033c33ab578494ce4c7e1776e8c51f74f246243 3 | size 16749 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Materials/MasterMaterials/MM_BakeRendererRedUnpack.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0d5ab264bc2dcdad53beac69ad81ca878cb0f0794a6f79a9f870fecc6dce98d2 3 | size 10750 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Textures/ChannelMachineLogoTitle.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2c21165ec7ba89db4ffc850d5a14c7e19c9a19a7fd80b27da5b88513dc27de51 3 | size 92186 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Textures/T_GrayscalePreview.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ce64f5955dcd42cadaf150cd339d1e74ccbc54c13b2a8a7a3fc618c438d13a6a 3 | size 13631 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Textures/T_RGBAPreview.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:374e548bfc8c592a6358dab20b84596785cc226d3998747c96feb4d8d069f8d8 3 | size 20058 4 | -------------------------------------------------------------------------------- /Content/Dependencies/Utilities/Textures/T_White_Placeholder.uasset: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ecab7e69017a84e0930f666039817f85e1282cc88b508ac8b58bccf2a931fa2f 3 | size 6149 4 | -------------------------------------------------------------------------------- /Content/Python/OpenWindowsDirectory.py: -------------------------------------------------------------------------------- 1 | import tkinter 2 | from tkinter import filedialog 3 | import os 4 | import platform 5 | 6 | def main(): 7 | pass 8 | 9 | def SelectFolder(): 10 | root = tkinter.Tk() 11 | root.withdraw() 12 | system = platform.system() 13 | 14 | folder_path = filedialog.askdirectory() + '/' 15 | 16 | return folder_path 17 | 18 | -------------------------------------------------------------------------------- /Content/Python/__pycache__/OpenWindowsDirectory.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kranox21/ChannelMachine/e87c9e5807cd6af939496aaf08f4c8294221f984/Content/Python/__pycache__/OpenWindowsDirectory.cpython-39.pyc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 ashton3ddesigns. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | ![ChannelMachineLogoTitle](https://github.com/Kranox21/ChannelMachine/assets/11131166/ce3af0e2-17fd-48b9-b311-079d85146329) 2 | 3 | # Texture packing and unpacking channel tool for Unreal Engine 4 | 5 | ## Getting Started: 6 | - To open the Channel Machine Editor click the icon at the top of the toolbar to launch the Utility Widget Tool 7 | 8 | - A new window will pop up, you can use the window as is, or what I personally do is Dock the window along Details and World Settings. 9 | 10 | ![Screenshot 2023-08-03 235342](https://github.com/Kranox21/ChannelMachine/assets/11131166/20d5a248-9a6d-4d17-ba36-93ee8163e537) 11 | 12 | ## Attributes Settings: 13 | - Within Attributes Settings will have two channel tabs 14 | - Pack Channels 15 | - Unpack Channels 16 | - Each tab comes with settings along with a preview of input results 17 | 18 | ### Pack Channels: 19 | 20 | ![Screenshot 2023-08-23 204805](https://github.com/Kranox21/ChannelMachine/assets/11131166/ae8abc2f-deb8-44de-95c0-53fe1452b956) 21 | - Enable Batch Settings 22 | - This will determine whether to set Texture input from an array list or indivisual inputs. 23 | - This will also determine if Channel Machine should Batch Generate or not. 24 | 25 | ![Screenshot 2023-08-23 205050](https://github.com/Kranox21/ChannelMachine/assets/11131166/9a05a817-4af8-4a52-9db4-babf6b420c26) 26 | 27 | - RGBA Preview 28 | - This will preview a low-resolution sample output from your inputs from RGB Inputs 29 | 30 | - Pack Settings 31 | - Enable Alpha Channel 32 | - Will show/hide Alpha Settings 33 | - Will determine whether to generate Alphas or not 34 | - ‘Note’ baking alpha channels will cost extra storage space and impact extra performance. 35 | - As of currently if you are trying to export into PNG without Alpha, the baking process will automatically set export write settings to JPG format, To bypass this enable alpha and fill with a blank white texture. 36 | - Channel Input 37 | - There are 4 channel inputs representing RGBA respectively 38 | - Channel Identifier Input 39 | - Enum or list of common inputs 40 | - Ambient Occlusion 41 | - Specular 42 | - Roughness 43 | - Opacity 44 | - Opacity Mask 45 | - Displacement 46 | - Emissive 47 | - Batch Pack Settings 48 | - Channel Batch Textures Input 49 | - Drop a batch of textures you wish to add into a particular channel 50 | - Must make sure the number of textures matches across all channels or the generator will encounter an error 51 | 52 | ### Unpack Channels: 53 | 54 | ![Screenshot 2023-08-23 205153](https://github.com/Kranox21/ChannelMachine/assets/11131166/a6ff31c1-190e-4928-b8fc-03d890d74443) 55 | 56 | - Grayscale Preview 57 | - Across the board will be 4 boxes of previews. 58 | - These boxes will be filled with one Packed Texture or Color map. 59 | - This will divide the color texture into 3 - 4 grayscale maps. 60 | 61 | - Channel Input Identifiers 62 | - Under each preview will be channel maps, you will make your channel selection there. 63 | 64 | - Unpack Settings 65 | - There will be one input which is the Packed Texture 66 | - When you add a texture it will update and preview the results of what 3 - 4 grayscale maps will look like. 67 | 68 | ## Export Settings: 69 | 70 | ![Screenshot 2023-08-23 205250](https://github.com/Kranox21/ChannelMachine/assets/11131166/6a222818-6294-439e-bf6c-52777a500c88) 71 | 72 | - Project Folder Location 73 | - This is where you input your folder path where you wish to place your texture outputs will be. 74 | - You can input the path in the text box, or you can use the Signal Button next to it to Set the selected folder/asset location to the textbox 75 | 76 | - Save Asset Settings 77 | - Asset Name 78 | - Set the name of your asset, don’t worry about prefix or suffix as the baking process will do that for you. 79 | - Compression Settings 80 | - By default is set to masks which are best settings for channels, but you can input any compress settings you wish. 81 | - Mipmap Settings 82 | - Is set to default FromTextureGroup but can put other setting or even no mipmaps if choose to 83 | - Resolution Width 84 | - Sets the resolution of texture from width by pixels 85 | - Resolution Height 86 | - Sets the resolution of the texture from height by pixels 87 | 88 | - Export Settings 89 | - Can set the location of the export path to disk, which can be from within your computer or network location. 90 | - Click the Open Directory button will pop up a window to select a folder. 91 | - Select folder will apply the folder path to textbox and will use that location for exporting images, if empty the export process will be skipped altogether. 92 | 93 | - Export Write Settings 94 | - Format 95 | - This will set the format of the textures when exporting 96 | - 'Note' if selected .PNG but don't enable alpha, will automatically set to .JPG, Assign white blank texture to Alpha in order to properly export for .PNG format. 97 | - Compression Quality 98 | - Whether the texture should be compressed or uncompressed 99 | - Overwrite File 100 | - Whether to overwrite a file that exists in the folder location or not 101 | - Async 102 | - This is a runtime feature mainly for games that can be on or off 103 | 104 | ## Config Settings 105 | 106 | ![Screenshot 2023-08-23 205330](https://github.com/Kranox21/ChannelMachine/assets/11131166/3149b00b-b38e-4e93-bcd3-1e063ccfb24a) 107 | 108 | - Config Data 109 | - Config Data Settings is an Data Asset that stores the variable information, these will be your configuration presets. Open the drop down menu and will have number of options under the same parent blueprint name. 110 | - Preset Name This determines the name of your preset when you click the Save As button, Don't worry about setting prefix as will automatically add DA_ for you 111 | - Save will override the current data preset assigned in the Config Data Setting to the current setting in the Config Setup 112 | - Save As will take the current Config Setup variables and create a brand-new data asset for you with the given name you assigned 113 | 114 | ## Material Assembly: 115 | 116 | ![image](https://github.com/Kranox21/ChannelMachine/assets/11131166/cd9d358f-15b8-4a83-b4aa-acb12bc92aff) 117 | 118 | 119 | - Master Material Input 120 | - Determines the selected master material you wish to use to create a material instance 121 | - This will also take the current material instance you assign and convert it to its Master/Parent Material 122 | - You can fill this in optionally if you leave it blank, will skip this process altogether 123 | 124 | - Assembly Textures 125 | - Base Color Input 126 | - Assign base color texture that will be applied to your material instance 127 | - Normal Map Input 128 | - Assign Normal map texture that will be applied to your material instance 129 | 130 | - Dropdown Parameter Selections 131 | - These dropdowns will check all the parameters available from the Master Material input and would have to assign them to given properties 132 | - This will save time from manually assigning textures to material instances themselves 133 | -------------------------------------------------------------------------------- /Resources/ChannelMachineIcon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Resources/ChannelMachineIcon128.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c0e168c6b904532f809f7a936f170c2e2c956d96c207e8bab11d57d33a9317cc 3 | size 17090 4 | -------------------------------------------------------------------------------- /Resources/ChannelMachineLogoTitle.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e77d64ea143a0f47023dec6e68eaddd754b43ae0a68d4d3336d0d0d90c2e449 3 | size 85317 4 | -------------------------------------------------------------------------------- /Resources/GreyscalePreview.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9bb4e31894e0c888ebcb6c61108cf4f00fbc77c90e697da977a32a0905dece3a 3 | size 7228 4 | -------------------------------------------------------------------------------- /Resources/Icon128.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c0e168c6b904532f809f7a936f170c2e2c956d96c207e8bab11d57d33a9317cc 3 | size 17090 4 | -------------------------------------------------------------------------------- /Resources/MissingMapPreview.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c813de218acd997e451715670422e7a63ecf3b4fcb4166036e5a31e10ac284c3 3 | size 8259 4 | -------------------------------------------------------------------------------- /Resources/PlaceholderButtonIcon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Resources/RGBAPreview.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:362371e3b5761deb1590e56388bb38e581dc9caeef8b786dfacc203a551634dd 3 | size 10988 4 | -------------------------------------------------------------------------------- /Source/ChannelMachine/ChannelMachine.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class ChannelMachine : ModuleRules 6 | { 7 | public ChannelMachine(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicIncludePaths.AddRange( 12 | new string[] { 13 | // ... add public include paths required here ... 14 | } 15 | ); 16 | 17 | 18 | PrivateIncludePaths.AddRange( 19 | new string[] { 20 | // ... add other private include paths required here ... 21 | } 22 | ); 23 | 24 | 25 | PublicDependencyModuleNames.AddRange( 26 | new string[] 27 | { 28 | "Core", 29 | "CoreUObject", 30 | "Engine", 31 | "UMG" 32 | // ... add other public dependencies that you statically link with here ... 33 | } 34 | ); 35 | 36 | 37 | PrivateDependencyModuleNames.AddRange( 38 | new string[] 39 | { 40 | "Projects", 41 | "InputCore", 42 | "EditorFramework", 43 | "UnrealEd", 44 | "ToolMenus", 45 | "CoreUObject", 46 | "Engine", 47 | "Slate", 48 | "SlateCore", 49 | "Blutility", 50 | "UMGEditor", 51 | "EditorScriptingUtilities" 52 | // ... add private dependencies that you statically link with here ... 53 | } 54 | ); 55 | 56 | 57 | DynamicallyLoadedModuleNames.AddRange( 58 | new string[] 59 | { 60 | // ... add any modules that your module loads dynamically here ... 61 | } 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Source/ChannelMachine/Private/ChannelMachine.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | #include "ChannelMachine.h" 4 | #include "ChannelMachineStyle.h" 5 | #include "ChannelMachineCommands.h" 6 | #include "Misc/MessageDialog.h" 7 | #include "ToolMenus.h" 8 | #include "EditorUtilityWidgetBlueprint.h" 9 | #include "EditorUtilitySubsystem.h" 10 | #include "EditorAssetLibrary.h" 11 | 12 | 13 | 14 | 15 | static const FName ChannelMachineTabName("ChannelMachine"); 16 | 17 | #define LOCTEXT_NAMESPACE "FChannelMachineModule" 18 | 19 | void FChannelMachineModule::StartupModule() 20 | { 21 | // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module 22 | 23 | FChannelMachineStyle::Initialize(); 24 | FChannelMachineStyle::ReloadTextures(); 25 | 26 | FChannelMachineCommands::Register(); 27 | 28 | PluginCommands = MakeShareable(new FUICommandList); 29 | 30 | PluginCommands->MapAction( 31 | FChannelMachineCommands::Get().PluginAction, 32 | FExecuteAction::CreateRaw(this, &FChannelMachineModule::PluginButtonClicked), 33 | FCanExecuteAction()); 34 | 35 | UToolMenus::RegisterStartupCallback(FSimpleMulticastDelegate::FDelegate::CreateRaw(this, &FChannelMachineModule::RegisterMenus)); 36 | } 37 | 38 | void FChannelMachineModule::ShutdownModule() 39 | { 40 | // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, 41 | // we call this function before unloading the module. 42 | 43 | UToolMenus::UnRegisterStartupCallback(this); 44 | 45 | UToolMenus::UnregisterOwner(this); 46 | 47 | FChannelMachineStyle::Shutdown(); 48 | 49 | FChannelMachineCommands::Unregister(); 50 | } 51 | 52 | ///ChannelMachine/ChannelMachine.ChannelMachine 53 | 54 | void FChannelMachineModule::PluginButtonClicked() 55 | { 56 | UObject* Blueprint = UEditorAssetLibrary::LoadAsset(FString(TEXT("EditorUtilityWidgetBlueprint'/ChannelMachine/ChannelMachine.ChannelMachine'"))); 57 | if (IsValid(Blueprint)) { 58 | UEditorUtilityWidgetBlueprint* EditorWidget = Cast(Blueprint); 59 | if (IsValid(EditorWidget)) { 60 | UEditorUtilitySubsystem* EditorUtilitySubsystem = GEditor->GetEditorSubsystem(); 61 | EditorUtilitySubsystem->SpawnAndRegisterTab(EditorWidget); 62 | } 63 | } 64 | } 65 | 66 | void FChannelMachineModule::RegisterMenus() 67 | { 68 | // Owner will be used for cleanup in call to UToolMenus::UnregisterOwner 69 | FToolMenuOwnerScoped OwnerScoped(this); 70 | 71 | { 72 | UToolMenu* Menu = UToolMenus::Get()->ExtendMenu("LevelEditor.MainMenu.Tools"); 73 | { 74 | FToolMenuSection& Section = Menu->FindOrAddSection("Tools"); 75 | Section.AddMenuEntryWithCommandList(FChannelMachineCommands::Get().PluginAction, PluginCommands); 76 | } 77 | } 78 | 79 | { 80 | UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar.PlayToolBar"); 81 | { 82 | FToolMenuSection& Section = ToolbarMenu->FindOrAddSection("ChannelMachinePlugin"); 83 | { 84 | FToolMenuEntry& Entry = Section.AddEntry(FToolMenuEntry::InitToolBarButton(FChannelMachineCommands::Get().PluginAction)); 85 | Entry.SetCommandList(PluginCommands); 86 | } 87 | } 88 | } 89 | } 90 | 91 | #undef LOCTEXT_NAMESPACE 92 | 93 | IMPLEMENT_MODULE(FChannelMachineModule, ChannelMachine) -------------------------------------------------------------------------------- /Source/ChannelMachine/Private/ChannelMachineBlueprints.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | 4 | #include "ChannelMachineBlueprints.h" 5 | #include "ContentBrowserModule.h" 6 | #include "IContentBrowserSingleton.h" 7 | #include "Engine/Texture.h" 8 | #include "Engine/Texture2D.h" 9 | 10 | void UChannelMachineBlueprints::SetContentBrowserPath(FString Path) 11 | { 12 | FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked("ContentBrowser"); 13 | IContentBrowserSingleton& ContentBrowserSingleton = ContentBrowserModule.Get(); 14 | ContentBrowserSingleton.SetSelectedPaths({ Path }); 15 | } 16 | 17 | void UChannelMachineBlueprints::SetHasAlphaChannel(UTexture* Texture2D, bool CompressNoAlpha) 18 | { 19 | Texture2D->CompressionNoAlpha = CompressNoAlpha; 20 | Texture2D->UpdateResource(); 21 | } 22 | 23 | bool UChannelMachineBlueprints::GetHasAlphaChannel(UTexture2D* Texture) 24 | { 25 | if (Texture) 26 | { 27 | return Texture->HasAlphaChannel(); 28 | } 29 | return false; 30 | } -------------------------------------------------------------------------------- /Source/ChannelMachine/Private/ChannelMachineCommands.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | #include "ChannelMachineCommands.h" 4 | 5 | #define LOCTEXT_NAMESPACE "FChannelMachineModule" 6 | 7 | void FChannelMachineCommands::RegisterCommands() 8 | { 9 | UI_COMMAND(PluginAction, "Channel Machine", "Launch Channel Machine Editor", EUserInterfaceActionType::Button, FInputChord()); 10 | } 11 | 12 | #undef LOCTEXT_NAMESPACE 13 | -------------------------------------------------------------------------------- /Source/ChannelMachine/Private/ChannelMachineStyle.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | #include "ChannelMachineStyle.h" 4 | #include "ChannelMachine.h" 5 | #include "Framework/Application/SlateApplication.h" 6 | #include "Styling/SlateStyleRegistry.h" 7 | #include "Slate/SlateGameResources.h" 8 | #include "Interfaces/IPluginManager.h" 9 | #include "Styling/SlateStyleMacros.h" 10 | 11 | #define RootToContentDir Style->RootToContentDir 12 | 13 | TSharedPtr FChannelMachineStyle::StyleInstance = nullptr; 14 | 15 | void FChannelMachineStyle::Initialize() 16 | { 17 | if (!StyleInstance.IsValid()) 18 | { 19 | StyleInstance = Create(); 20 | FSlateStyleRegistry::RegisterSlateStyle(*StyleInstance); 21 | } 22 | } 23 | 24 | void FChannelMachineStyle::Shutdown() 25 | { 26 | FSlateStyleRegistry::UnRegisterSlateStyle(*StyleInstance); 27 | ensure(StyleInstance.IsUnique()); 28 | StyleInstance.Reset(); 29 | } 30 | 31 | FName FChannelMachineStyle::GetStyleSetName() 32 | { 33 | static FName StyleSetName(TEXT("ChannelMachineStyle")); 34 | return StyleSetName; 35 | } 36 | 37 | 38 | const FVector2D Icon16x16(16.0f, 16.0f); 39 | const FVector2D Icon20x20(20.0f, 20.0f); 40 | 41 | TSharedRef< FSlateStyleSet > FChannelMachineStyle::Create() 42 | { 43 | TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet("ChannelMachineStyle")); 44 | Style->SetContentRoot(IPluginManager::Get().FindPlugin("ChannelMachine")->GetBaseDir() / TEXT("Resources")); 45 | 46 | Style->Set("ChannelMachine.PluginAction", new IMAGE_BRUSH_SVG(TEXT("ChannelMachineIcon"), Icon20x20)); 47 | return Style; 48 | } 49 | 50 | void FChannelMachineStyle::ReloadTextures() 51 | { 52 | if (FSlateApplication::IsInitialized()) 53 | { 54 | FSlateApplication::Get().GetRenderer()->ReloadTextureResources(); 55 | } 56 | } 57 | 58 | const ISlateStyle& FChannelMachineStyle::Get() 59 | { 60 | return *StyleInstance; 61 | } 62 | -------------------------------------------------------------------------------- /Source/ChannelMachine/Public/ChannelMachine.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Modules/ModuleManager.h" 7 | 8 | class FToolBarBuilder; 9 | class FMenuBuilder; 10 | 11 | class FChannelMachineModule : public IModuleInterface 12 | { 13 | public: 14 | 15 | /** IModuleInterface implementation */ 16 | virtual void StartupModule() override; 17 | virtual void ShutdownModule() override; 18 | 19 | /** This function will be bound to Command. */ 20 | void PluginButtonClicked(); 21 | 22 | private: 23 | 24 | void RegisterMenus(); 25 | 26 | 27 | private: 28 | TSharedPtr PluginCommands; 29 | }; 30 | -------------------------------------------------------------------------------- /Source/ChannelMachine/Public/ChannelMachineBlueprints.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Engine/Texture2D.h" 7 | #include "Kismet/BlueprintFunctionLibrary.h" 8 | #include "ChannelMachineBlueprints.generated.h" 9 | 10 | 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class CHANNELMACHINE_API UChannelMachineBlueprints : public UBlueprintFunctionLibrary 16 | { 17 | GENERATED_BODY() 18 | UFUNCTION(BlueprintCallable, Category = "Channel Machine Blueprints") 19 | static void SetContentBrowserPath(FString Path); 20 | 21 | UFUNCTION(BlueprintCallable, Category = "Channel Machine Blueprints") 22 | static void SetHasAlphaChannel(UTexture* Texture2D, bool CompressNoAlpha); 23 | 24 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Channel Machine Blueprints") 25 | static bool GetHasAlphaChannel(UTexture2D* Texture); 26 | }; 27 | -------------------------------------------------------------------------------- /Source/ChannelMachine/Public/ChannelMachineCommands.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Framework/Commands/Commands.h" 7 | #include "ChannelMachineStyle.h" 8 | 9 | class FChannelMachineCommands : public TCommands 10 | { 11 | public: 12 | 13 | FChannelMachineCommands() 14 | : TCommands(TEXT("ChannelMachine"), NSLOCTEXT("Contexts", "ChannelMachine", "ChannelMachine Plugin"), NAME_None, FChannelMachineStyle::GetStyleSetName()) 15 | { 16 | } 17 | 18 | // TCommands<> interface 19 | virtual void RegisterCommands() override; 20 | 21 | public: 22 | TSharedPtr< FUICommandInfo > PluginAction; 23 | }; 24 | -------------------------------------------------------------------------------- /Source/ChannelMachine/Public/ChannelMachineStyle.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 ashton3ddesigns All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Styling/SlateStyle.h" 7 | 8 | class FChannelMachineStyle 9 | { 10 | public: 11 | 12 | static void Initialize(); 13 | 14 | static void Shutdown(); 15 | 16 | /** reloads textures used by slate renderer */ 17 | static void ReloadTextures(); 18 | 19 | /** @return The Slate style set for the Shooter game */ 20 | static const ISlateStyle& Get(); 21 | 22 | static FName GetStyleSetName(); 23 | 24 | private: 25 | 26 | static TSharedRef< class FSlateStyleSet > Create(); 27 | 28 | private: 29 | 30 | static TSharedPtr< class FSlateStyleSet > StyleInstance; 31 | }; --------------------------------------------------------------------------------