Skip to content

Commit

Permalink
Dev to master for v3.6.0 #613 from Moo-Ack-Productions/dev
Browse files Browse the repository at this point in the history
Dev to master for v3.6.0
  • Loading branch information
TheDuckCow authored Aug 8, 2024
2 parents 311f020 + cb4f737 commit 9bfa153
Show file tree
Hide file tree
Showing 63 changed files with 4,490 additions and 1,371 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.mtl filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
88 changes: 88 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Run tests

on:
workflow_dispatch:
inputs:
blender_versions:
description: 'Blender version(s)'
required: false
default: '["4.1.1"]'
type: choice
options:
- '["4.1.1", "2.90.1", "3.6.5", "2.90.1", "2.28.3"]'
- '["4.1.1"]'
- '["3.6.5"]'
- '["2.90.1"]'
- '["2.28.3"]'
pull_request:
types: [opened, reopened, synchronize] # drop synchronize not run per commit
branches:
- dev
- master
paths:
- 'MCprep_addon/**'


#run-name: Test on ${{ inputs.blender_versions || true && "4.1.1" }}
run-name: Test on ${{ inputs.blender_versions }}

jobs:
test:
name: Test Blender
runs-on: ubuntu-latest
strategy:
matrix:
blender-version: ${{ github.event.inputs.blender_versions && fromJSON(github.event.inputs.blender_versions) || fromJSON('["4.1.1"]') }}
steps:
- uses: actions/checkout@v4
- run: |
echo "Running with blender: $BVERSION"
echo "event name is:" ${{ github.event_name }}
echo "event type is:" ${{ github.event.action }}
env:
BVERSION: ${{ matrix.blender-version }}
- name: Set up Python v3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Pip installs
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade blender-downloader
python -m pip install --upgrade -r requirements.txt
- name: Cache Blender ${{ matrix.blender-version }}
uses: actions/cache@v4
id: cache-blender
with:
path: |
blender-*
blender_execs.txt
key: ${{ runner.os }}-${{ matrix.blender-version }}
- name: Download Blender ${{ matrix.blender-version }}
if: steps.cache-blender.outputs.cache-hit != 'true'
id: download-blender
run: |
printf "%s" "$(blender-downloader \
${{ matrix.blender-version }} --extract --remove-compressed \
--quiet --print-blender-executable)" > blender_execs.txt
- name: Download assets
if: always()
run: |
# TODO: use git describe --tags or equivalent to automatically get latest stable.
wget -nv "https://github.com/Moo-Ack-Productions/MCprep/releases/download/3.5.3/MCprep_addon_3.5.3.zip"
git lfs pull
mkdir MCprep_stable_release
unzip -qq ./MCprep_addon_*.zip -d MCprep_stable_release
# Copy the checked-in data json to override the wget version
mv ./MCprep_addon/MCprep_resources/mcprep_data_update.json _tmp.json
mv -f ./MCprep_stable_release/MCprep_addon/MCprep_resources/** ./MCprep_addon/MCprep_resources
mv -f _tmp.json ./MCprep_addon/MCprep_resources/mcprep_data_update.json
echo "Prepare for install by creating addons folder"
mkdir -p /home/runner/.config/blender/4.1/scripts/addons
echo $(ls /home/runner/.config/blender/4.1/scripts/addons)
echo $(ls /home/runner/.config/blender/4.1/scripts/addons/MCprep_addon/MCprep_resources)
- name: Run tests
run: |
python run_tests.py
- name: Output results
run: cat test_results.csv
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DS_Store
*.blend
*.mo
__pycache__
.mypy_cache
MCprep_addon/mcprep_addon_tracker.json
MCprep_addon/mcprep_addon_updater/MCprep_addon_updater_status.json
blender_execs.txt
Expand All @@ -13,7 +15,8 @@ mcprep_venv_*
.cache
.python-version
venv/
MCprep_addon/MCprep_resources/
.venv/
*.sublime-*
MCprep_addon/import_bridge/conf
MCprep_addon/import_bridge/nbt
MCprep_addon/MCprep_resources/
23 changes: 19 additions & 4 deletions BlenderChanges.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
This list contains all deprecations and removals in every Blender version starting with Blender 3.0. Since Blender 4.0's breaking changes invoked the want for a list of all deprecations and changes, this list is public for addon developers to use.

Note that not all deprecations are listed, just the ones that may affect MCprep or changes that developers should be aware of in general, so please refer to the wiki entries for each version for more information.
Note that not all deprecations are listed, just the ones that may affect MCprep or changes that developers should be aware of in general, so please refer to the wiki entries for each version for more information. In addition, for simplicity, this page will only document changes in stable releases of Blender, unless a change has been found in a development version of Blender that needs to be addressed.

_For Developers_: The use of any deprecated feature is an automatic bug. Such features should be wrapped around if statements for backwards compatibility if absolutely necesary in older versions.

_For MCprep maintainers_: Any use of a deprecated feature in a pull request should be questioned. If the feature is needed in older versions, then remind developers to use `min_bv`, `bv28` ([Deprecated in MCprep 3.5](https://github.com/TheDuckCow/MCprep/pull/401)), or `bv30`, whichever is more appropriate.

In ascending order:

# [Blender 3.0](https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Python_API)
## Deprecations
None that concern MCprep.
Expand Down Expand Up @@ -93,11 +95,11 @@ None that concern MCprep.
- `data` remains emulated, but with a performance penalty

# [Blender 3.6](https://wiki.blender.org/wiki/Reference/Release_Notes/3.6/Python_API)
Nothing that concerns MCprep
None that concern MCprep.

# [Blender 4.0 (IN DEVELOPMENT)](https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API)
# [Blender 4.0](https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API)
## Deprecated
Nothing that concerned MCprep for now.
None that concern MCprep.

## Breaking Changes
- Glossy BSDF and Anisotrophic BSDF nodes have been merged.
Expand All @@ -113,3 +115,16 @@ Nothing that concerned MCprep for now.
- Coat -> Coat Weight
- Sheen -> Sheen Weight
- Emission -> Emission Color
- Possible breakage of rig backwards compatibility (unconfirmed)

# [Blender 4.1](https://wiki.blender.org/wiki/Reference/Release_Notes/4.1/Python_API)
## Deprecated
None that concern MCprep.

## Breaking Changes/Additions
- Python has been upgraded to Python 3.11
- VFX Reference Platform 2024 support has been added
- Layout panels to reduce boilerplate for submenus
- `displacement_method` is under `bpy.types.Material` now
- Possible breakage of rig backwards compatibility (unconfirmed)

50 changes: 48 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,24 @@ As a quick start:
# Highly recommended, create a local virtual environment (could also define globally)
python3 -m pip install --user virtualenv

python3 -m pip install --upgrade pip # Install/upgrade pip
python3 -m venv ./venv # Add a local virtual env called `venv`
python3 -m pip install --upgrade pip # Install/upgrade pip

# Activate that environment
## On windows:
.\venv\Scripts\activate
## On Mac/linux:
source venv/bin/activate

pip install -r requirements.txt

# Now with the env active, do the pip install (or upgrade)
pip install --upgrade bpy-addon-build

# Finally, you can compile MCprep using:
bpy-addon-build --during-build dev # Use dev to use non-prod related resources and tracking.
bab -b dev # Use dev to use non-prod related resources and tracking.
bab -b dev translate # Dev, with translations
bab -b translate # For production
```

Moving forward, you can now build the addon for all intended supported versions using: `bpy-addon-build -b dev`
Expand Down Expand Up @@ -214,6 +218,48 @@ Add this to a file called .gitmessage, and then execute the following command:

To use for each commit, you can use `git config --local commit.verbose true` to tell Git to perform a verbose commit all the time for just the MCprep repo.


## Signing Off Commits
Signing off of all commits, although not required, is good practice to certify the origin of a change. When you sign off of a commit, you certify that the commit was made in line with the Developer's Certificate of Origin:

> Developer's Certificate of Origin 1.1
> By making a contribution to this project, I certify that:
>
> a. The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or \
> b. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or \
> c. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. \
> d I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
If indeed the change was made in line with the Developer's Certificate of Origin, add the following at the end of the commit:
```
Signed-off-by: Random J Developer <[email protected]>
```

**This much be your real name and a working email address.**

This can also be added with the `--signoff flag`:
```
$ git commit --signoff -m "Commit message"
```

If the change was given to you by someone else, and you have permission to contribute it here, that change must be signed off by the person who gave the change to you, and anyone before that (basically a chain of sign offs). Example:
```
<commit message and summery by John Doe, who recieved the change from Jane Doe>
Signed-off-by: John Doe <[email protected]>
Signed-off-by: Jane Doe <[email protected]>
```

If multiple authors were involved in writing the change, then `Co-developed-by` must be present for both you and any other authors involved in the change. As an example with 2 authors:
```
<commit message and summery>
Co-developed-by: John Doe <[email protected]>
Signed-off-by: John Doe <[email protected]>
Co-developed-by: Jane Doe <[email protected]>
Signed-off-by: Jane Doe <[email protected]>
```

## Dependencies
If you're using an IDE, it's recommened to install `bpy` as a Python module. In our experience, the [fake-bpy package](https://github.com/nutti/fake-bpy-module) seems to be the best.

Expand Down
32 changes: 32 additions & 0 deletions LICENSE-3RD-PARTY.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-----------------------------------------------------------------------------
The BSD 3-Clause License

Applies to:
commonmcobj_parser.py Copyright (c) 2024, Mahid Sheikh

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-----------------------------------------------------------------------------
Loading

0 comments on commit 9bfa153

Please sign in to comment.