Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,17 @@ jobs:
fail-fast: false
matrix:
include:
- blender_version: "5.0.1"
blender_series: "5.0"
python_version: "3.11"
blender_sha256: "8019580ee1b7262e505f4196a00237ccf743c88d205b38d34201510676e60b09"
- blender_version: "5.1.2"
blender_series: "5.1"
python_version: "3.13"
blender_sha256: "aaccb355f50183979b698bcce7467103a76261b5fa59f4972295842662a285fb"
- blender_version: "5.2.0"
blender_series: "5.2"
python_version: "3.13"
blender_sha256: "96f6c181a30f4950607839dc84d42a354b250d8a0231b098b59b7bc69c351c48"

defaults:
Expand All @@ -139,10 +148,10 @@ jobs:
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: true
python-version: "3.13"
python-version: ${{ matrix.python_version }}

- name: Install dependencies
run: uv sync --locked --dev
run: uv sync --locked --only-dev

- name: Install Blender ${{ matrix.blender_version }}
id: blender_setup
Expand All @@ -167,8 +176,8 @@ jobs:
id: blender_integration
continue-on-error: true
env:
COVERAGE_FILE: .coverage.blender
PYTHONPATH: ${{ github.workspace }}/.venv/lib/python3.13/site-packages
COVERAGE_FILE: .coverage.blender-${{ matrix.blender_version }}
PYTHONPATH: ${{ github.workspace }}/.venv/lib/python${{ matrix.python_version }}/site-packages
run: >-
"${BLENDER_EXECUTABLE}"
--background
Expand All @@ -182,7 +191,7 @@ jobs:
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: blender-coverage-${{ matrix.blender_version }}
path: .coverage.blender
path: .coverage.blender-${{ matrix.blender_version }}
include-hidden-files: true
if-no-files-found: ignore
retention-days: 1
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to Up3date are documented here.

## [Unreleased]

## [0.1.0]

### Changed

- Expand support to Blender 5.0 and newer by making Up3date compatible with
its Python 3.11 runtime and testing Blender 5.0.1, 5.1.2, and 5.2.0 with
matching Python environments in the headless integration pipeline.
- Publish the installable release asset using its `up3date-<version>.zip`
filename without an additional display label.

## [0.0.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for the MSc thesis [An integrative workflow for 3D city model versioning](http:/

## Requirements

- Blender 5.2 or newer
- Blender 5.0 or newer

The add-on follows the CityJSON schemas and document structure described in
the linked specification.
Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
bl_info = {
"name": "Up3date",
"author": "Konstantinos Mastorakis",
"version": (0, 0, 0),
"blender": (5, 2, 0),
"version": (0, 1, 0),
"blender": (5, 0, 0),
"location": "File > Import > CityJSON (.json) || File > Export > CityJSON (.json)",
"description": "Visualize, edit and export 3D City Models encoded in CityJSON format",
"warning": "",
Expand Down
4 changes: 2 additions & 2 deletions blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
schema_version = "1.0.0"

id = "up3date"
version = "0.0.0"
version = "0.1.0"
name = "Up3date"
tagline = "Visualize, edit and export 3D City Models encoded in CityJSON format"
maintainer = "Konstantinos Mastorakis"
type = "add-on"

blender_version_min = "5.2.0"
blender_version_min = "5.0.0"

license = [
"SPDX:GPL-3.0-or-later",
Expand Down
4 changes: 2 additions & 2 deletions core/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time
from collections.abc import Iterable, Sequence
from datetime import UTC, datetime
from typing import Any, Protocol, cast
from typing import Any, Protocol, TypeAlias, cast

import bpy
import idprop
Expand Down Expand Up @@ -68,7 +68,7 @@ def to_dict(self) -> dict[str, Any]: ...
BasicMaterialFactory | ReuseMaterialFactory | CityObjectTypeMaterialFactory
)

type GeometryModel = GeometryPrimitive | GeometryInstance
GeometryModel: TypeAlias = GeometryPrimitive | GeometryInstance


class CityJSONParser:
Expand Down
7 changes: 5 additions & 2 deletions core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from collections.abc import Sequence
from typing import Any, Protocol, cast
from typing import Any, Protocol, TypeVar, cast

import bpy

Expand All @@ -25,6 +25,9 @@ class GeometryOwner(Protocol):
geometry: list[Any]


PropertyOwner = TypeVar("PropertyOwner", bound=CustomPropertyOwner)


CITYJSON_ID_PROPERTY = "cityjson_id"
CITYJSON_GEOMETRY_PROPERTY = "cityjson_geometry"
CITYJSON_DOCUMENT_EXTRAS_PROPERTY = "cityjson_document_extras"
Expand Down Expand Up @@ -71,7 +74,7 @@ def clean_list(values: list[Any]) -> list[Any]:
return values


def assign_properties[PropertyOwner: CustomPropertyOwner](
def assign_properties(
obj: PropertyOwner, props: dict[str, Any], prefix: list[str] | None = None
) -> PropertyOwner:
"""Assigns the custom properties to obj based on the props"""
Expand Down
6 changes: 4 additions & 2 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Development

Up3date uses Python 3.13 and Blender 5.2's Python API. Install the project
dependencies with `uv`:
Up3date supports Python 3.11 and newer and Blender 5.0+'s Python API. Blender
bundles its own Python runtime, which can vary between Blender releases. Check
your Blender version and its bundled Python version before setting up the
development environment. Install the project dependencies with `uv`:

```text
uv sync --dev
Expand Down
20 changes: 10 additions & 10 deletions models/city_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import dataclasses
from dataclasses import dataclass, field
from typing import Any, Literal
from typing import Any, Literal, TypeAlias

from .geomprimitives import (
CompositeSolid,
Expand All @@ -25,12 +25,12 @@
from .geomtemplates import GeometryInstance

# ---------------------------------------------------------------------------
# PEP 695 Type Aliases (Python 3.12+)
# Type aliases
# ---------------------------------------------------------------------------

type GeomSurfaceOrSolid = MultiSurface | CompositeSurface | Solid | CompositeSolid
GeomSurfaceOrSolid: TypeAlias = MultiSurface | CompositeSurface | Solid | CompositeSolid

type GeomAnyPrimitiveOrInstance = (
GeomAnyPrimitiveOrInstance: TypeAlias = (
MultiPoint
| MultiLineString
| MultiSurface
Expand All @@ -41,19 +41,19 @@
| GeometryInstance
)

type GeomTransportation = MultiLineString | MultiSurface | CompositeSurface
GeomTransportation: TypeAlias = MultiLineString | MultiSurface | CompositeSurface

type GeomWaterBody = (
GeomWaterBody: TypeAlias = (
MultiLineString | MultiSurface | CompositeSurface | Solid | CompositeSolid
)

type GeomPlantCover = (
GeomPlantCover: TypeAlias = (
MultiSurface | CompositeSurface | Solid | CompositeSolid | MultiSolid
)

type GeomLandUse = MultiSurface | CompositeSurface
GeomLandUse: TypeAlias = MultiSurface | CompositeSurface

type GeomCityObjectGroup = (
GeomCityObjectGroup: TypeAlias = (
MultiPoint
| MultiLineString
| MultiSurface
Expand All @@ -63,7 +63,7 @@
| MultiSolid
)

type GeomGeneric = (
GeomGeneric: TypeAlias = (
MultiPoint
| MultiLineString
| MultiSurface
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "up3date"
version = "0.0.0"
version = "0.1.0"
description = "Blender add-on for importing, editing, and exporting CityJSON encoded 3D city models"
readme = "README.md"
requires-python = ">=3.13"
requires-python = ">=3.11"
dependencies = [
"bpy>=5.2.0",
"bpy>=5.0.0",
]

[dependency-groups]
Expand Down Expand Up @@ -39,7 +39,7 @@ ignore = ["ANN401"]
"tests/**" = ["ANN"]

[tool.mypy]
python_version = "3.13"
python_version = "3.11"
files = ["__init__.py", "addon.py", "core", "models"]
check_untyped_defs = true
disallow_untyped_defs = true
Expand Down
Loading
Loading