diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ad1e44..234c3af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,26 +13,26 @@ jobs: setup: runs-on: ubuntu-latest outputs: - version: ${{ steps.check-tag.outputs.version }} + tag: ${{ steps.check-tag.outputs.tag }} steps: - name: Check tag id: check-tag run: | if [[ ${{ github.ref }} == refs/tags/v* ]]; then - VERSION=_$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") + TAG=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") else - VERSION="" + TAG=$(echo ${{ github.sha }} | cut -c1-7) fi - echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "tag=$TAG" >> "$GITHUB_OUTPUT" shell: bash - name: Create Release Draft id: create-release uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.ref }} - name: ${{ github.ref }} + tag_name: ${{ steps.check-tag.outputs.tag }} + name: ${{ steps.check-tag.outputs.tag }} body: | Changelog - First Change @@ -81,10 +81,10 @@ jobs: with: directory: 'release' type: 'zip' - filename: '${{ env.ZIP_NAME }}${{ needs.setup.outputs.version }}_${{ runner.os }}.zip' + filename: '${{ env.ZIP_NAME }}_${{ needs.setup.outputs.tag }}_${{ runner.os }}.zip' exclusions: '*.git* .gitignore' - name: Upload Release Asset env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload ${{ github.ref }} release/${{ env.ZIP_NAME }}${{ needs.setup.outputs.version }}_${{ runner.os }}.zip + run: gh release upload ${{ needs.setup.outputs.tag }} release/${{ env.ZIP_NAME }}_${{ needs.setup.outputs.tag }}_${{ runner.os }}.zip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24fd210..1afc832 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,11 +20,7 @@ jobs: run: pip install flake8 pylint - name: Run flake8 - uses: suo/flake8-github-action@releases/v1 - with: - checkName: 'flake8' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: flake8 - name: Run pylint run: python for_dev/lint.py --path=addons/blender_dds_addon diff --git a/.gitignore b/.gitignore index 1f4bf30..c97db0f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,7 @@ htmlcov # textures *.dds -!tests/test.dds -!tests/cube.dds -!tests/array.dds +!tests/*.dds *.tga *.png *.jpg diff --git a/addons/blender_dds_addon/__init__.py b/addons/blender_dds_addon/__init__.py index 409d25a..fbc3991 100644 --- a/addons/blender_dds_addon/__init__.py +++ b/addons/blender_dds_addon/__init__.py @@ -8,7 +8,7 @@ bl_info = { 'name': 'DDS textures', 'author': 'Matyalatte', - 'version': (0, 3, 0), + 'version': (0, 3, 1), 'blender': (2, 83, 20), 'location': 'Image Editor > Sidebar > DDS Tab', 'description': 'Import and export .dds files', diff --git a/addons/blender_dds_addon/directx/dds.py b/addons/blender_dds_addon/directx/dds.py index b6c8c5d..eb85b0d 100644 --- a/addons/blender_dds_addon/directx/dds.py +++ b/addons/blender_dds_addon/directx/dds.py @@ -421,7 +421,7 @@ def assemble(self, is_array, size): def get_texture_type(self): if self.is_3d(): - return "valume" + return "volume" if self.is_cube(): t = "cube" else: diff --git a/changelog.txt b/changelog.txt index 3d84918..9928af4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +ver 0.3.1 +- Fixed an error when loading volume textures. + ver 0.3.0 - Support texture arrays and volume textures. diff --git a/docs/README.md b/docs/README.md index e221350..3830b56 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# Blender-DDS-Addon v0.3.0 +# Blender-DDS-Addon v0.3.1 [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ![build](https://github.com/matyalatte/Blender-DDS-Addon/actions/workflows/build.yml/badge.svg) diff --git a/tests/test.dds b/tests/2d.dds similarity index 100% rename from tests/test.dds rename to tests/2d.dds diff --git a/tests/array.dds b/tests/2d_array.dds similarity index 100% rename from tests/array.dds rename to tests/2d_array.dds diff --git a/tests/cube_array.dds b/tests/cube_array.dds new file mode 100644 index 0000000..2675cdc Binary files /dev/null and b/tests/cube_array.dds differ diff --git a/tests/test_dds.py b/tests/test_dds.py index ba6c400..820e464 100644 --- a/tests/test_dds.py +++ b/tests/test_dds.py @@ -15,7 +15,7 @@ def get_test_dds(): - test_file = os.path.join("tests", "test.dds") + test_file = os.path.join("tests", "2d.dds") return test_file @@ -58,12 +58,14 @@ def test_io_cubemap(): os.remove("saved.dds") -def test_io_array(): - """Test with cubemap.""" - tex = import_dds.load_dds(os.path.join("tests", "array.dds")) +@pytest.mark.parametrize("texture_type", ["2d_array", "volume", "cube_array"]) +def test_io_array(texture_type): + """Test with texture arrays.""" + tex = import_dds.load_dds(os.path.join("tests", texture_type + ".dds")) + assert tex.dds_props.texture_type == texture_type extra_texture_list = tex.dds_props.texture_list extra_texture_list = [t.texture for t in extra_texture_list] - tex = export_dds.save_dds(tex, "saved.dds", "BC1_UNORM", texture_type="2d_array", + tex = export_dds.save_dds(tex, "saved.dds", "BC1_UNORM", texture_type=texture_type, extra_texture_list=extra_texture_list) os.remove("saved.dds") diff --git a/tests/volume.dds b/tests/volume.dds new file mode 100644 index 0000000..aa9b1c5 Binary files /dev/null and b/tests/volume.dds differ