Skip to content

Commit

Permalink
v0.3.1 update (hotfix for v0.3.0) (#7)
Browse files Browse the repository at this point in the history
* fixed an error when loading volume textures, add tests for texture arrays

* update documents and workflows
  • Loading branch information
matyalatte authored Feb 19, 2023
1 parent 183f984 commit 6511573
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 24 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ htmlcov

# textures
*.dds
!tests/test.dds
!tests/cube.dds
!tests/array.dds
!tests/*.dds
*.tga
*.png
*.jpg
Expand Down
2 changes: 1 addition & 1 deletion addons/blender_dds_addon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion addons/blender_dds_addon/directx/dds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
Binary file added tests/cube_array.dds
Binary file not shown.
12 changes: 7 additions & 5 deletions tests/test_dds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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")

Expand Down
Binary file added tests/volume.dds
Binary file not shown.

0 comments on commit 6511573

Please sign in to comment.