Skip to content

Commit

Permalink
Merge branch 'lasa01:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hisprofile authored Jun 19, 2024
2 parents 4190683 + 50c4844 commit 51c1414
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 19 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build

on:
push:
paths:
- "*.rs"
- "Cargo.lock"
- "Cargo.toml"
- "setup.py"
tags-ignore:
- "v*.*.*"
pull_request:
paths:
- "*.rs"
- "Cargo.lock"
- "Cargo.toml"
- "setup.py"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build:
strategy:
matrix:
os: [macos-13, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements-dev.txt'
- name: Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Build
run: python setup.py build_rust --inplace

build-manylinux:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64

steps:
- uses: actions/checkout@v3
- name: Select Python version
run: echo "/opt/python/cp310-cp310/bin" >> $GITHUB_PATH
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Build
run: python setup.py build_rust --inplace
20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
Expand All @@ -30,20 +30,19 @@ jobs:
build:
strategy:
matrix:
os: [macos-latest, windows-latest]
os: [macos-13, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}

needs: check-version

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements-dev.txt'
- uses: Swatinem/rust-cache@v1
- name: Dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -52,9 +51,9 @@ jobs:
run: python setup.py bdist_blender_addon
- name: Rename artifact
shell: bash
run: for filename in dist/*.zip; do mv "${filename}" "${filename%.zip}-${{ runner.os }}.zip"; done;
run: for filename in dist/*.zip; do mv "${filename}" "${filename%.zip}-${{ runner.os }}-${{ runner.arch }}.zip"; done;
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
fail_on_unmatched_files: true
Expand All @@ -67,14 +66,13 @@ jobs:
needs: check-version

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Select Python version
run: echo "/opt/python/cp310-cp310/bin" >> $GITHUB_PATH
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -83,7 +81,7 @@ jobs:
run: python setup.py bdist_blender_addon
- name: Rename artifact
shell: bash
run: for filename in dist/*.zip; do mv "${filename}" "${filename%.zip}-${{ runner.os }}.zip"; done;
run: for filename in dist/*.zip; do mv "${filename}" "${filename%.zip}-${{ runner.os }}-${{ runner.arch }}.zip"; done;
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "plumber"
version = "1.0.1"
version = "1.0.2"
authors = ["Lassi Säike"]
edition = "2021"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Supported file types are `.vmf`, `.mdl`, `.vmt` and `.vtf`. For a more complete
- [License](#license)

## Requirements
- OS: Windows recommended. Linux and macOS supported. M1 Macs not supported.
- Blender: 2.90 or newer (tested up to 4.0).
- OS: Windows recommended. Linux and macOS supported.
- Blender: 2.90 or newer (tested up to 4.1).

## Quick start
- Make sure you are using Blender 2.90 or newer.
Expand Down
9 changes: 6 additions & 3 deletions plumber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
bl_info = {
"name": "Plumber",
"author": "Lassi Säike",
"version": (1, 0, 1),
"blender": (2, 82, 0),
"version": (1, 0, 2),
"blender": (2, 90, 0),
"location": "File > Import -> Plumber",
"description": "Imports Source Engine assets.",
"warning": "",
Expand All @@ -22,7 +22,10 @@
version_str += f"-{version_pre}"

# check if imported by setup.py or actually running in Blender
from bpy.app import version as bpy_version
try:
from bpy.app import version as bpy_version
except ImportError:
bpy_version = None

if bpy_version is not None:
is_windows = platform.system() == "Windows"
Expand Down
4 changes: 3 additions & 1 deletion plumber/asset/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def import_mesh(
mesh_data.polygons.foreach_set("use_smooth", [True] * polygons_len)
mesh_data.update(calc_edges=True)

mesh_data.use_auto_smooth = True
if bpy.app.version < (4, 1, 0):
mesh_data.use_auto_smooth = True

mesh_data.normals_split_custom_set_from_vertices(mesh.normals())

uv_layer = mesh_data.uv_layers.new()
Expand Down

0 comments on commit 51c1414

Please sign in to comment.