-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev to master for v3.6.0 #613 from Moo-Ack-Productions/dev
Dev to master for v3.6.0
- Loading branch information
Showing
63 changed files
with
4,490 additions
and
1,371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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` | ||
|
@@ -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. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
----------------------------------------------------------------------------- |
Oops, something went wrong.