diff --git a/GD-AtlasTexture-Creator.csproj b/GD-AtlasTexture-Creator.csproj index 0b7a803..6565db3 100644 --- a/GD-AtlasTexture-Creator.csproj +++ b/GD-AtlasTexture-Creator.csproj @@ -4,4 +4,10 @@ true GDAtlasTextureCreator + + + + + + \ No newline at end of file diff --git a/README.IMG/00.png b/README.IMG/00.png new file mode 100644 index 0000000..19127eb Binary files /dev/null and b/README.IMG/00.png differ diff --git a/README.IMG/00.png.import b/README.IMG/00.png.import new file mode 100644 index 0000000..65ef8f8 --- /dev/null +++ b/README.IMG/00.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2iw03i307vak" +path="res://.godot/imported/00.png-dec9752b521e084fd364f161e253d646.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/00.png" +dest_files=["res://.godot/imported/00.png-dec9752b521e084fd364f161e253d646.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.IMG/01.png b/README.IMG/01.png new file mode 100644 index 0000000..a772d9a Binary files /dev/null and b/README.IMG/01.png differ diff --git a/README.IMG/01.png.import b/README.IMG/01.png.import new file mode 100644 index 0000000..ac4a37b --- /dev/null +++ b/README.IMG/01.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8tqwvexbaug5" +path="res://.godot/imported/01.png-3e25bb1529a32ee41f37f0dd455069c5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/01.png" +dest_files=["res://.godot/imported/01.png-3e25bb1529a32ee41f37f0dd455069c5.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.IMG/02.png b/README.IMG/02.png new file mode 100644 index 0000000..5b23510 Binary files /dev/null and b/README.IMG/02.png differ diff --git a/README.IMG/02.png.import b/README.IMG/02.png.import new file mode 100644 index 0000000..ed547bf --- /dev/null +++ b/README.IMG/02.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dhgavh5n6weoq" +path="res://.godot/imported/02.png-47151a502b9651ac153e5bb0ac7ce3e6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/02.png" +dest_files=["res://.godot/imported/02.png-47151a502b9651ac153e5bb0ac7ce3e6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.IMG/03.png b/README.IMG/03.png new file mode 100644 index 0000000..4fafb96 Binary files /dev/null and b/README.IMG/03.png differ diff --git a/README.IMG/03.png.import b/README.IMG/03.png.import new file mode 100644 index 0000000..2b7604e --- /dev/null +++ b/README.IMG/03.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c7sbevehpm5yf" +path="res://.godot/imported/03.png-bdc2fea9c8dea62b567e3a96e39cd654.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/03.png" +dest_files=["res://.godot/imported/03.png-bdc2fea9c8dea62b567e3a96e39cd654.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.IMG/04.png b/README.IMG/04.png new file mode 100644 index 0000000..72b78e1 Binary files /dev/null and b/README.IMG/04.png differ diff --git a/README.IMG/04.png.import b/README.IMG/04.png.import new file mode 100644 index 0000000..f6219a0 --- /dev/null +++ b/README.IMG/04.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ctcgbccpxpi2n" +path="res://.godot/imported/04.png-2a2e9f09a11809377ce913e7b2b524d0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/04.png" +dest_files=["res://.godot/imported/04.png-2a2e9f09a11809377ce913e7b2b524d0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.IMG/05.png b/README.IMG/05.png new file mode 100644 index 0000000..675d35f Binary files /dev/null and b/README.IMG/05.png differ diff --git a/README.IMG/05.png.import b/README.IMG/05.png.import new file mode 100644 index 0000000..1dafea1 --- /dev/null +++ b/README.IMG/05.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://sbytk06gt5wk" +path="res://.godot/imported/05.png-47848ca1f86e5c4fb88b4cf20bd7106c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/05.png" +dest_files=["res://.godot/imported/05.png-47848ca1f86e5c4fb88b4cf20bd7106c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.IMG/06a.png b/README.IMG/06a.png new file mode 100644 index 0000000..e34aa18 Binary files /dev/null and b/README.IMG/06a.png differ diff --git a/README.IMG/06a.png.import b/README.IMG/06a.png.import new file mode 100644 index 0000000..f572d57 --- /dev/null +++ b/README.IMG/06a.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c67olxdgleg0m" +path="res://.godot/imported/06a.png-52d1c24014b1d37e4f4c3fcb887bbf5c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/06a.png" +dest_files=["res://.godot/imported/06a.png-52d1c24014b1d37e4f4c3fcb887bbf5c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.IMG/06b.png b/README.IMG/06b.png new file mode 100644 index 0000000..cc95880 Binary files /dev/null and b/README.IMG/06b.png differ diff --git a/README.IMG/06b.png.import b/README.IMG/06b.png.import new file mode 100644 index 0000000..694f154 --- /dev/null +++ b/README.IMG/06b.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b4nqyjvnufgs2" +path="res://.godot/imported/06b.png-23fd67e4927164dcb89aecdcffcb7d63.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/06b.png" +dest_files=["res://.godot/imported/06b.png-23fd67e4927164dcb89aecdcffcb7d63.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.IMG/06c.png b/README.IMG/06c.png new file mode 100644 index 0000000..2a8f5a7 Binary files /dev/null and b/README.IMG/06c.png differ diff --git a/README.IMG/06c.png.import b/README.IMG/06c.png.import new file mode 100644 index 0000000..92e9cde --- /dev/null +++ b/README.IMG/06c.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b2g8k6y1tr8d3" +path="res://.godot/imported/06c.png-0b1a9aadac2bb6870938c8b4fa73ed22.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://README.IMG/06c.png" +dest_files=["res://.godot/imported/06c.png-0b1a9aadac2bb6870938c8b4fa73ed22.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/README.md b/README.md index b84eed2..278e787 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,193 @@ # GD-AtlasTexture-Creator -Based on DotNet, GD AtlasTexture Creator provides a handy editor tool that resembles the SpriteEditor from UnityEditor for ease of AtlasTexture creation. + +## English + +Supports `Godot 4.1 With .Net` +Based on .Net, `GD AtlasTexture Creator` provides a handy editor window that resembles the `SpriteEditor` from UnityEditor for ease of `AtlasTexture` creation. + +### Installation + +1. Download the zip file from [Release](https://github.com/Delsin-Yu/GD-AtlasTexture-Creator/releases/download/0.1.0/GD-AtlasTexture-Creator.0.1.0.zip). + +2. Decompress the file, and place the `addons` folder direct into the root of your project. + +3. Navigate to `Project/Project Settings/Plugins` in Godot Editor, locate the `GD AtlasTexture Creator` from the `Installed Plugins` list, then check `Enable` under the `Status` colum. + +4. The dedicated inspector for `GD AtlasTexture Creator` will now launches located at the `Bottom Right Dock slot` + +### Usage + +#### Inspecting a Texture + +When double-clicking a resource with type `Texture2D` inside the `FileSystem Window`, the `GD AtlasTexture Creator` will show the preview of inspecting image. + +![image](./README.IMG/00.png) + +#### Top Bar Section + +![image](./README.IMG/01.png) + +Control|Description|Selections +:-|:-|:- +`Snap Mode`|Controls the `snapping precision` when editing rect parameters, similar to the options inside the `AtlasTexture Region Editor Window`.|`Pixel Snap`: All Editing Metrics are clamped to integer persicion.
`None`: All Editing Metrics are clamped to two digit. +`AtlasTexture Slicer`|Toggle the visibility of the `AtlasTexture Slicer`, a tool for automating AtlasTexture creation.|`On`: Displays the `AtlasTexture Slicer`
`Off`: Hides the `AtlasTexture Slicer` +`Scan AtlasTexture Button`|Scan the eligible `AtlasTextures` which uses the current inspecting `Texture2D` and displays the result inside the viewport.|`Scan AtlasTexture In Folder`: Scan the eligible AtlasTextures in the directory where the current inspecting `Texture2D` is located.
`Scan AtlasTexture In Project`: Scan the eligible AtlasTextures everywhere inside the project. + +#### Slicer Subview Section + +A powerful tool for creating AtlasTexture slices, there are three slicing types provided as follows. +Slice Type|Description|Preview +:-|:-|:- +Automatic|Create AtlasTexture slices based on pixel chunks inside the texture, this is identical to the behavior found in the `AtlasTexture Region Editor Window`.|![image](./README.IMG/06a.png) +Grid By Cell Size|Create AtlasTexture slices based on the specified cell pixel size.|![image](./README.IMG/06b.png) +Grid By Cell Count|Create AtlasTexture slices based on the specified cell count.|![image](./README.IMG/06c.png) + +When creating AtlasTexture slices using this tool, there are two `Methods` of creating slices available. +Method Name|Description +:-|:- +Ignore Existing (Additive)|Create the slices directly, and ignore the current existing slices. +Avoid Existing (Smart)|New AtlasTexture slices that have their region occupied by existing AtlasTextures, will be ignored during the creation. + +#### Primary View Section + +This is the primary section for editing `AtlasTexture Slices`. +Similar to the `AtlasTexture Region Editor Window`, you can drag the viewport by holding the middle mouse button, and scale the viewport by scrolling the middle mouse button or through the buttons on the top left corner. + +![image](./README.IMG/02.png) + +Mouse Action|Description +:-|:- +`Left Click` and `Drag` in the empty section of the area|Create a new AtlasTexture from the texture & identify the sizing. +`Left Click` and `Drag` on the handle (Red Circle)|Modify the `Size` of an existing AtlasTexture +`Left Click` and `Drag` inside an existing AtlasTexture Slice|Modify the `Position` of an existing AtlasTexture + +The `AtlasTextures` created are `Color Coded` as following + +![image](./README.IMG/03.png) + +Color|Definition +:-|:- +`Green`|Current selected `AtlasTexture`. +`White`|The `AtlasTexture` from the project. +`Cyan`|The temporarily created `AtlasTexture`, you can `edit their name` or `delete these slices` since they are not written into the filesystem. + +#### AtlasTexture Mini Inspector + +Displays the `Edible Parameters` for the current selected `AtlasTexture` + +![image](./README.IMG/04.png) + +Control|Description +:-|:- +`X`|`Remove` the selected `AtlasTexture`, only available for `temporarily` created AtlasTextures. +`Name`|Edit the `Name` of the selected `AtlasTexture`, only available for `temporarily` created AtlasTextures. +`Region`|Edit the `Region` of the selected `AtlasTexture`. +`Margin`|Edit the `Margin` of the selected `AtlasTexture`. +`Filter Clip`|Edit the `Filter Clip` property of the selected `AtlasTexture`. + +#### Save & Discard Section + +All changes made to the inspecting texture are `not` written into the filesystem immediately, this section is used to `apply` or `discard` the pending modification. + +![image](./README.IMG/05.png) + +Button|Definition +:-|:- +`Discard`|Discard the pending modification and restore the `Primary View Section` to its initial state. +`Create / Update`|Creates all `temporarily created AtlasTextures`, and apply all changes to `existing AtlasTextures` into the project filesystem. + +## 中文 + +此插件支持 `包含.Net模块的Godot 4.1` +基于 .Net,`GD AtlasTexture Creator` 提供一个类似于Unity编辑器中`Sprite编辑器`的实用的编辑器,用于简化`AtlasTexture`的创建过程。 + +### 安装 + +1. 从[Release](https://github.com/Delsin-Yu/GD-AtlasTexture-Creator/releases/download/0.1.0/GD-AtlasTexture-Creator.0.1.0.zip)处下载压缩包。 + +2. 解压下载完成的压缩包,并且将其中的`addons`文件夹放置在项目工程文件夹的根目录。 + +3. 前往Godot编辑器的`项目/项目设置.../插件`,从`已安装插件`列表中找到`GD AtlasTexture Creator`项目,然后将`状态`一列中的`启用`栏目勾上 + +4. `GD AtlasTexture Creator`专用的检查器将会启动于编辑器的`右下停靠栏` + +### 使用 + +#### 检视一个材质 + +在`文件系统窗口`中双击一个`Texture2D`类型的资源时,`GD AtlasTexture Creator`会展示当前正在检视的图像资源 + +![image](./README.IMG/00.png) + +#### 顶栏 + +![image](./README.IMG/01.png) + +控件|介绍|选项信息 +:-|:-|:- +`吸附模式`|控制编辑矩形时的`对齐精度`,类似于`AtlastTexture 区域编辑器`中的同名控件。|`像素吸附`:所有编辑时的参数都对齐到最近整数。
`无`:所有编辑时的参数都对齐到最近两位小数。 +`AtlasTexture Slicer`|切换`AtlasTexture Slicer`可见性,一种用于自动化创建AtlasTexture的工具。|`On`: 显示`AtlasTexture Slicer`
`Off`: 隐藏`AtlasTexture Slicer` +`Scan AtlasTexture Button`|扫描引用了当前`Texture2D`的`AtlasTextures`并且在视图中展示。|`Scan AtlasTexture In Folder`: 在当前`Texture2D`所在的文件夹中扫描符合条件的AtlasTextures。
`Scan AtlasTexture In Project`: 在整个项目文件夹中扫描符合条件的AtlasTextures。 + +#### 切片器 + +用于创建AtlasTexture切片的工具,提供了三种切片类型,如下所示。 +切片模式|介绍|预览 +:-|:-|:- +Automatic|基于纹理内部的像素块创建AtlasTexture切片,这与`AtlasTexture区域编辑器窗口`中的行为相同。|![image](./README.IMG/06a.png) +Grid By Cell Size|根据指定的单元格像素大小创建AtlasTexture切片。|![image](./README.IMG/06b.png) +Grid By Cell Count|基于指定的单元计数创建AtlasTexture切片。|![image](./README.IMG/06c.png) + +使用此工具创建AtlasTexture切片时,有两种创建切片的`方法`可用。 +方法名称|介绍 +:-|:- +Ignore Existing (Additive)|直接创建切片,并忽略当前的现有切片。 +Avoid Existing (Smart)|区域被现有AtlasTextures占据的新AtlasTexture切片将在创建过程中被忽略。 + +#### 主视图界面 + +这是编辑`AtlasTexture切片`的主要部分。 +与`AtlasTexture区域编辑器窗口`类似,可以通过按住鼠标中键拖动视口,并通过滚动鼠标滚轮或通过左上角的按钮缩放视口。 + +![image](./README.IMG/02.png) + +鼠标动作|介绍 +:-|:- +在区域的空白区域中`单击`并`拖拽`|从纹理创建一个新的AtlasTexture并确定大小。 +在`缩放手柄`上`拖拽`(红色圆圈)|修改现有AtlasTexture的`大小` +在现有AtlasTexture切片内`拖拽`|修改现有AtlasTexture的`位置` + +创建的`AtlasTextures`是`按照颜色区分`的,如下所示 + +![image](./README.IMG/03.png) + +颜色|定义 +:-|:- +`绿`|当前选定的`AtlasTexture`。 +`白`|项目资源中的`AtlasTexture`。 +`青`|临时创建的`AtlasTexture`,你可以`编辑它们的名称`或`删除这些切片`,因为它们没有写入文件系统。 + +#### AtlasTexture迷你检查器 + +显示当前选定`AtlasTexture`的`可编辑参数` + +![image](./README.IMG/04.png) + +控件|介绍 +:-|:- +`X`|`删除`选定的`AtlasTexture`,仅适用于`临时`创建的AtlasTextures。 +`Name`|编辑所选`AtlasTexture`的`名称`。 +`Region`|编辑所选`AtlasTexture`的`Region`属性。 +`Margin`|编辑所选`AtlasTexture`的`Margin`属性。 +`Filter Clip`|编辑所选`AtlasTexture`的`Filter Clip`属性。 + +#### 保存&丢弃按钮分区 + +对检查纹理所做的所有更改都不会立即`写入`文件系统,此部分用于`应用`或`放弃`挂起的修改。 + +![image](./README.IMG/05.png) + +按钮|介绍 +:-|:- +`Discard`|放弃挂起的修改并将`主视图界面`恢复到其初始状态。 +`Create / Update`|创建所有`临时创建的AtlasTextures`,并将对`现有的AtlasTextures`的所有更改应用到项目文件系统中。 diff --git a/slice_sample.png b/slice_sample.png new file mode 100644 index 0000000..fe433fd Binary files /dev/null and b/slice_sample.png differ diff --git a/slice_sample.png.import b/slice_sample.png.import new file mode 100644 index 0000000..7210573 --- /dev/null +++ b/slice_sample.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dvrmq442ka548" +path="res://.godot/imported/slice_sample.png-a31f208a53e506cfdf4adc7dbf74f86f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://slice_sample.png" +dest_files=["res://.godot/imported/slice_sample.png-a31f208a53e506cfdf4adc7dbf74f86f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1