Skip to content

Commit

Permalink
Merge pull request #115 from Nusiq/blender-4.2-update
Browse files Browse the repository at this point in the history
Update to support Blender 4.2
  • Loading branch information
Nusiq authored Jul 27, 2024
2 parents 849ea5b + a45c8fc commit 724b2d4
Show file tree
Hide file tree
Showing 595 changed files with 639,784 additions and 526,831 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ jobs:
- name: Pull lfs data, if not cached
run: git lfs pull

# Python 3.10 for mypy testing
- name: Set up Python 3.10
# Python 3.11 for mypy testing
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'


- name: Install dependencies
run: |
sudo snap install blender --channel=3.3lts/stable --classic
sudo snap install blender --channel=4.2lts/stable --classic
cd $GITHUB_WORKSPACE
pip install pyright pytest numpy ./fake_bpy_modules
- name: Build and install the addon
Expand Down
24 changes: 24 additions & 0 deletions Mcblend.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"folders": [
{
"path": "."
},
{
"path": "mcblend"
},
{
"path": "fake_bpy_modules"
}
],
"extensions": {
"recommendations": [
"JacquesLucke.blender-development",
"ms-python.python",
"ms-python.vscode-pylance"
]
},
"settings": {
// PyLance Configuration
"python.analysis.typeCheckingMode": "basic"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Mcblend
[![Tests](https://github.com/Nusiq/mcblend/actions/workflows/tests.yml/badge.svg)](https://github.com/Nusiq/mcblend/actions/workflows/tests.yml)

Mcblend is a Blender 3.3 plugin that allows creators to design and animate Minecraft Bedrock Edition models using Blender's powerful 3D modeling and animation tools.
Mcblend is a Blender 4.2 plugin that allows creators to design and animate Minecraft Bedrock Edition models using Blender's powerful 3D modeling and animation tools.

## 🔧 Features
- Exporting and importing models for Minecraft Bedrock Edition.
Expand Down
4 changes: 2 additions & 2 deletions fake_bpy_modules/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This module is based on: `fake_bpy_modules_3.6-20231118.zip` from the Fake Bpy Module project. The original project can be found at:
https://github.com/nutti/fake-bpy-module/releases/tag/20231118
This module is based on: `fake_bpy_modules_4.1-20240604.zip` from the Fake Bpy Module project. The original project can be found at:
https://github.com/nutti/fake-bpy-module/releases/tag/20240604


This module is used to provide type checking for Blender's bpy and mathutils module in the Mcblend project. The default fake-bpy-module was insufficient for Mcblend because of its inacuracies and lack of types that are specific to Mcblend.
Expand Down
76 changes: 0 additions & 76 deletions fake_bpy_modules/addon_utils/__init__.py

This file was deleted.

70 changes: 70 additions & 0 deletions fake_bpy_modules/addon_utils/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import typing
import collections.abc

GenericType1 = typing.TypeVar("GenericType1")
GenericType2 = typing.TypeVar("GenericType2")

class _ext_global:
idmap_pair: typing.Any
module_handle: typing.Any

def check(module_name: str):
"""Returns the loaded state of the addon.
:param module_name: The name of the addon and module.
:type module_name: str
:return: (loaded_default, loaded_state)
"""

...

def check_extension(module_name):
"""Return true if the module is an extension."""

...

def disable(
module_name: str, default_set: bool = False, handle_error: typing.Any = None
):
"""Disables an addon by name.
:param module_name: The name of the addon and module.
:type module_name: str
:param default_set: Set the user-preference.
:type default_set: bool
:param handle_error: Called in the case of an error, taking an exception argument.
:type handle_error: typing.Any
"""

...

def disable_all(): ...
def enable(
module_name: str,
default_set: bool = False,
persistent: bool = False,
handle_error: typing.Any = None,
):
"""Enables an addon by name.
:param module_name: the name of the addon and module.
:type module_name: str
:param default_set: Set the user-preference.
:type default_set: bool
:param persistent: Ensure the addon is enabled for the entire session (after loading new files).
:type persistent: bool
:param handle_error: Called in the case of an error, taking an exception argument.
:type handle_error: typing.Any
:return: the loaded module or None on failure.
"""

...

def module_bl_info(mod, info_basis=None): ...
def modules(module_cache={"add_camera_rigs": None}, refresh=True): ...
def modules_refresh(module_cache={"add_camera_rigs": None}): ...
def paths(): ...
def reset_all(reload_scripts=False):
"""Sets the addon state based on the user preferences."""

...
55 changes: 0 additions & 55 deletions fake_bpy_modules/animsys_refactor/__init__.py

This file was deleted.

26 changes: 26 additions & 0 deletions fake_bpy_modules/animsys_refactor/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import typing
import collections.abc

GenericType1 = typing.TypeVar("GenericType1")
GenericType2 = typing.TypeVar("GenericType2")

class DataPathBuilder:
"""Dummy class used to parse fcurve and driver data paths."""

data_path: typing.Any

def resolve(self, real_base, rna_update_from_map, fcurve, log):
"""Return (attribute, value) pairs.
:param real_base:
:param rna_update_from_map:
:param fcurve:
:param log:
"""
...

def anim_data_actions(anim_data): ...
def classes_recursive(base_type, clss=None): ...
def find_path_new(id_data, data_path, rna_update_from_map, fcurve, log): ...
def id_iter(): ...
def update_data_paths(rna_update, log=None): ...
Loading

0 comments on commit 724b2d4

Please sign in to comment.