Skip to content

Commit

Permalink
Merge pull request #389 from TheDuckCow/dev
Browse files Browse the repository at this point in the history
v3.4.2 merge to master
  • Loading branch information
TheDuckCow committed Mar 13, 2023
2 parents 5cfd956 + 1a49b94 commit ea56ef1
Show file tree
Hide file tree
Showing 26 changed files with 1,326 additions and 522 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ build
test_results.tsv
debug_save_state.blend1
MCprep_addon/MCprep_resources/resourcepacks/mcprep_default/materials.blend1
mcprep_venv_*
89 changes: 89 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ This is largely possible for a few reasons:
1. Abstracting API changes vs directly implementing changes. Instead of swapping "group" for "collection" in the change to blender 2.8, we create if/else statements and wrapper functions that fetch the attribute that exists based on the version of blender. Want more info about this? See [the article here](https://theduckcow.com/2019/update-addons-both-blender-28-and-27-support/).
1. No python annotations. This syntax wasn't supported in old versions of python that came with blender (namely, in Blender 2.7) and so we don't use annotations in this repository. Some workarounds are in place to avoid excessive printouts as a result.

## Internal Rewrites
MCprep has a separate branch for internal rewrites based on the dev branch. Sometimes, internal tools are deprecated, and requires features to be changed to reflect those deprecations.

Developers should not worry about this. If a features uses depracated features, it will be fixed in the next internal rewrite.

It may be tempting to try and use the `internal-rewrites` branch to write new features. Don't, as pull requests for `internal-rewrites` will only be accepted if they deal with rewriting parts of MCprep itself. Pull requests for new features that only use `internal-rewrites` for the sake of avoiding the use of deprecated features will not be accepted.

Also, when something is deprecated, it will still remain in MCprep for one full version and be removed by the next release. For instance, if during the development of MCprep X a feature is deprecated, then that feature will only be removed officially starting with the development of MCprep Y. Thus, any new features in MCprep X that use a deprecated feature will be fixed in the `internal-rewrites` branch for the development cycle of MCprep Y.

There will also be a pull request for `internal-rewrites` for each devlopment cycle of MCprep. This pull request will contain all newly deprecated and removed features, as well as their replacements. This exists as a heads up to developers so that they know what to expect.

New features go into the `dev` branch, rewriting of old features to account for deprecations go into the `internal-rewrites` branch. When in doubt, simply ask.

## Compiling and running tests

As above, a critical component of maintaining support and ensuring the wide number of MCprep features are stable, is running automated tests.
Expand Down Expand Up @@ -157,3 +170,79 @@ One other detail: MCprep uses git lfs or Large File Storage, to avoid saving bin
- Alternatively, try using Git for Windows and its console.

Run into other gotchas? Please open a [new issue](https://github.com/TheDuckCow/MCprep/issues)!


## Commit Messages
Git commits should explain why a change was made, because the diff will show the changes made. For example, instead of writing:
```
Added ability to "import" MTL files
```

Instead do:
```
Added the ability to "import" MTL files
MCprep's file explorer shows both OBJs and MTLs, and sometimes users end up clicking
MTL files. This brings a quality of life improvement to change the extension
if the file selected is an MTL, since MTLs share the same name as their corresponding
OBJ files
```

The first line is a summary of the changes, and should be less then 50 characters. The rest should justify the changes. Convince us why these changes are important and why they've been made this way.

Git won't automatically wrap messages either, so each line should have a limit of 72 characters.

Here's a template some MCprep developers found that can help (modified for simplicity) by using # to define which is the limit Git can display for each line:
```
# Title: Summary, imperative, start upper case, don't end with a period
# No more than 50 chars. #### 50 chars is here: #
# Body: Explain *what* and *why* (not *how*). Include task ID (Jira issue).
# Wrap at 72 chars. ################################## which is here: #
```
Add this to a file called .gitmessage, and then execute the following command:
`git config --local commit.template /path/to/.gitmessage`

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.

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

It's also recommened to use a virtual environment (especially if you're on Linux) as to avoid issues with system wide packages and different versions of `bpy`. [See this for more details](https://realpython.com/python-virtual-environments-a-primer/)

### Creating a Virtual Environment and Setting up `bpy`
First, we need to come up with a name. For MCprep development, it's recommended to use the following convention:
`mcprep_venv_<version>`

This allows you to have multiple versions of `bpy` side by side in their own environments.

For example, if I was making a virtul environment for 3.3, I would do `mcprep_venv_3.3`.

To create a virtual environment, do the following:

`python3 -m venv mcprep_venv_<version>`

Then to enable it, then:

Windows: `mcprep_venv_<version>\Scripts\activate`

MacOS and Linux: `source mcprep_venv_<version>/bin/activate`

This will make your terminal use the virtual environment until you close it or use `deactivate`. Each time you open your terminal after this, remember to enable the virtual environment

Next we need to install `fake-bpy`:

`python3 -m pip install fake-bpy-module-<version>`

If you use PyCharm, you should check the GitHub for [additional instructions](https://github.com/nutti/fake-bpy-module#install-via-pip-package)

### Pylint
MCprep mostly tries to follow the PEP8 guidelines, so it's also a good idea to install pylsp and flake8 for IDEs.

First, install the 2:
`python3 -m pip install python-lsp-server flake8`

Then set up your IDE to use pylsp as your Python LSP. This depends on the IDE, so look at the documentation to see how to set your Python LSP for your specific editor.

Now you're ready to do MCprep development
73 changes: 52 additions & 21 deletions MCprep_addon/MCprep_resources/mcprep_data_update.json
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@
"block_mapping_mc": {
"Campfire": "campfire_log",
"absorption": "mob_effect/absorption",
"acacia": "entity/chest_boat/acacia",
"acacia": "gui/hanging_signs/acacia",
"acacia_door_bottom": "acacia_door_bottom",
"acacia_door_top": "acacia_door_top",
"acacia_leaves": "acacia_leaves",
Expand All @@ -870,10 +870,10 @@
"accessibility": "gui/accessibility",
"activator_rail": "activator_rail",
"activator_rail_on": "activator_rail_on",
"adventure": null,
"adventure": "gui/advancements/backgrounds/adventure",
"aggressive_panda": "entity/panda/aggressive_panda",
"alban": "painting/alban",
"alex": "entity/alex",
"alex": "entity/player/wide/alex",
"all_black": "entity/cat/all_black",
"allay": "entity/allay/allay",
"allium": "allium",
Expand All @@ -885,6 +885,7 @@
"angry": "particle/angry",
"anvil": "anvil",
"anvil_top": "anvil_top",
"ari": "entity/player/wide/ari",
"armorer": "entity/zombie_villager/profession/armorer",
"arrow": "entity/projectiles/arrow",
"ascii": "font/ascii",
Expand All @@ -906,11 +907,23 @@
"azure_bluet": "azure_bluet",
"back": "painting/back",
"bad_omen": "mob_effect/bad_omen",
"bamboo": "gui/hanging_signs/bamboo",
"bamboo_block": "bamboo_block",
"bamboo_block_top": "bamboo_block_top",
"bamboo_door_bottom": "bamboo_door_bottom",
"bamboo_door_top": "bamboo_door_top",
"bamboo_fence": "bamboo_fence",
"bamboo_fence_gate": "bamboo_fence_gate",
"bamboo_fence_gate_particle": "bamboo_fence_gate_particle",
"bamboo_fence_particle": "bamboo_fence_particle",
"bamboo_large_leaves": "bamboo_large_leaves",
"bamboo_mosaic": "bamboo_mosaic",
"bamboo_planks": "bamboo_planks",
"bamboo_singleleaf": "bamboo_singleleaf",
"bamboo_small_leaves": "bamboo_small_leaves",
"bamboo_stage0": "bamboo_stage0",
"bamboo_stalk": "bamboo_stalk",
"bamboo_trapdoor": "bamboo_trapdoor",
"banner_base": "entity/banner_base",
"barrel_bottom": "barrel_bottom",
"barrel_side": "barrel_side",
Expand Down Expand Up @@ -963,7 +976,7 @@
"big_smoke_7": "particle/big_smoke_7",
"big_smoke_8": "particle/big_smoke_8",
"big_smoke_9": "particle/big_smoke_9",
"birch": "entity/chest_boat/birch",
"birch": "gui/hanging_signs/birch",
"birch_door_bottom": "birch_door_bottom",
"birch_door_top": "birch_door_top",
"birch_leaves": "birch_leaves",
Expand All @@ -972,7 +985,7 @@
"birch_planks": "birch_planks",
"birch_sapling": "birch_sapling",
"birch_trapdoor": "birch_trapdoor",
"black": "entity/cat/black",
"black": "entity/rabbit/black",
"black_candle": "black_candle",
"black_candle_lit": "black_candle_lit",
"black_concrete": "black_concrete",
Expand Down Expand Up @@ -1019,7 +1032,7 @@
"brewing_stand_base": "brewing_stand_base",
"bricks": "bricks",
"british_shorthair": "entity/cat/british_shorthair",
"brown": "entity/bed/brown",
"brown": "entity/rabbit/brown",
"brown_candle": "brown_candle",
"brown_candle_lit": "brown_candle_lit",
"brown_concrete": "brown_concrete",
Expand Down Expand Up @@ -1059,6 +1072,7 @@
"cake_top": "cake_top",
"calcite": "calcite",
"calico": "entity/cat/calico",
"camel": "entity/camel/camel",
"campfire_fire": "campfire_fire",
"campfire_log": "campfire_log",
"campfire_log_lit": "campfire_log_lit",
Expand Down Expand Up @@ -1094,9 +1108,13 @@
"chainmail_layer_2": "models/armor/chainmail_layer_2",
"chat_tags": "gui/chat_tags",
"checkbox": "gui/checkbox",
"checkmark": null,
"checkmark": "gui/checkmark",
"chicken": "entity/chicken",
"chipped_anvil_top": "chipped_anvil_top",
"chiseled_bookshelf_empty": "chiseled_bookshelf_empty",
"chiseled_bookshelf_occupied": "chiseled_bookshelf_occupied",
"chiseled_bookshelf_side": "chiseled_bookshelf_side",
"chiseled_bookshelf_top": "chiseled_bookshelf_top",
"chiseled_deepslate": "chiseled_deepslate",
"chiseled_nether_bricks": "chiseled_nether_bricks",
"chiseled_polished_blackstone": "chiseled_polished_blackstone",
Expand Down Expand Up @@ -1159,7 +1177,7 @@
"creebet": "painting/creebet",
"creeper": "entity/banner/creeper",
"creeper_armor": "entity/creeper/creeper_armor",
"crimson": "entity/signs/crimson",
"crimson": "gui/hanging_signs/crimson",
"crimson_door_bottom": "crimson_door_bottom",
"crimson_door_top": "crimson_door_top",
"crimson_fungus": "crimson_fungus",
Expand Down Expand Up @@ -1194,7 +1212,7 @@
"damage": "particle/damage",
"damaged_anvil_top": "damaged_anvil_top",
"dandelion": "dandelion",
"dark_oak": "entity/chest_boat/dark_oak",
"dark_oak": "gui/hanging_signs/dark_oak",
"dark_oak_door_bottom": "dark_oak_door_bottom",
"dark_oak_door_top": "dark_oak_door_top",
"dark_oak_leaves": "dark_oak_leaves",
Expand Down Expand Up @@ -1292,6 +1310,7 @@
"drowned_outer_layer": "entity/zombie/drowned_outer_layer",
"earth": "painting/earth",
"edition": "gui/title/edition",
"efe": "entity/player/wide/efe",
"effect_0": "particle/effect_0",
"effect_1": "particle/effect_1",
"effect_2": "particle/effect_2",
Expand Down Expand Up @@ -1545,7 +1564,7 @@
"jukebox_side": "jukebox_side",
"jukebox_top": "jukebox_top",
"jump_boost": "mob_effect/jump_boost",
"jungle": "entity/chest_boat/jungle",
"jungle": "gui/hanging_signs/jungle",
"jungle_door_bottom": "jungle_door_bottom",
"jungle_door_top": "jungle_door_top",
"jungle_leaves": "jungle_leaves",
Expand All @@ -1554,6 +1573,7 @@
"jungle_planks": "jungle_planks",
"jungle_sapling": "jungle_sapling",
"jungle_trapdoor": "jungle_trapdoor",
"kai": "entity/player/wide/kai",
"kebab": "painting/kebab",
"kelp": "kelp",
"kelp_plant": "kelp_plant",
Expand Down Expand Up @@ -1642,7 +1662,8 @@
"magenta_wool": "magenta_wool",
"magma": "magma",
"magmacube": "entity/slime/magmacube",
"mangrove": "entity/chest_boat/mangrove",
"makena": "entity/player/wide/makena",
"mangrove": "gui/hanging_signs/mangrove",
"mangrove_door_bottom": "mangrove_door_bottom",
"mangrove_door_top": "mangrove_door_top",
"mangrove_leaves": "mangrove_leaves",
Expand Down Expand Up @@ -1703,12 +1724,13 @@
"night_vision": "mob_effect/night_vision",
"nitwit": "entity/zombie_villager/profession/nitwit",
"nonlatin_european": "font/nonlatin_european",
"noor": "entity/player/wide/noor",
"normal": "entity/chest/normal",
"normal_left": "entity/chest/normal_left",
"normal_right": "entity/chest/normal_right",
"note": "particle/note",
"note_block": "note_block",
"oak": "entity/chest_boat/oak",
"oak": "gui/hanging_signs/oak",
"oak_door_bottom": "oak_door_bottom",
"oak_door_top": "oak_door_top",
"oak_leaves": "oak_leaves",
Expand Down Expand Up @@ -1771,7 +1793,7 @@
"phantom_eyes": "entity/phantom_eyes",
"pig": "entity/pig/pig",
"pig_saddle": "entity/pig/pig_saddle",
"piglin": "entity/piglin/piglin",
"piglin": "entity/banner/piglin",
"piglin_brute": "entity/piglin/piglin_brute",
"pigscene": "painting/pigscene",
"pillager": "entity/illager/pillager",
Expand Down Expand Up @@ -2040,7 +2062,7 @@
"shulker_yellow": "entity/shulker/shulker_yellow",
"siamese": "entity/cat/siamese",
"silverfish": "entity/silverfish",
"skeleton": "entity/skeleton/skeleton",
"skeleton": "painting/skeleton",
"skull": "entity/banner/skull",
"skull_and_roses": "painting/skull_and_roses",
"slime": "entity/slime/slime",
Expand Down Expand Up @@ -2140,7 +2162,7 @@
"sponge": "sponge",
"spore_blossom": "spore_blossom",
"spore_blossom_base": "spore_blossom_base",
"spruce": "entity/chest_boat/spruce",
"spruce": "gui/hanging_signs/spruce",
"spruce_door_bottom": "spruce_door_bottom",
"spruce_door_top": "spruce_door_top",
"spruce_leaves": "spruce_leaves",
Expand All @@ -2157,7 +2179,7 @@
"squid": "entity/squid/squid",
"stage": "painting/stage",
"stats_icons": "gui/container/stats_icons",
"steve": "entity/steve",
"steve": "entity/player/wide/steve",
"stone": "stone",
"stone_bricks": "stone_bricks",
"stonecutter": "gui/container/stonecutter",
Expand All @@ -2183,6 +2205,8 @@
"stripe_top": "entity/banner/stripe_top",
"stripped_acacia_log": "stripped_acacia_log",
"stripped_acacia_log_top": "stripped_acacia_log_top",
"stripped_bamboo_block": "stripped_bamboo_block",
"stripped_bamboo_block_top": "stripped_bamboo_block_top",
"stripped_birch_log": "stripped_birch_log",
"stripped_birch_log_top": "stripped_birch_log_top",
"stripped_crimson_stem": "stripped_crimson_stem",
Expand Down Expand Up @@ -2210,6 +2234,7 @@
"sunflower_bottom": "sunflower_bottom",
"sunflower_front": "sunflower_front",
"sunflower_top": "sunflower_top",
"sunny": "entity/player/wide/sunny",
"sunset": "painting/sunset",
"survival_spawn": null,
"swamp": "entity/zombie_villager/type/swamp",
Expand Down Expand Up @@ -2534,7 +2559,7 @@
"warden_pulsating_spots_1": "entity/warden/warden_pulsating_spots_1",
"warden_pulsating_spots_2": "entity/warden/warden_pulsating_spots_2",
"warm_frog": "entity/frog/warm_frog",
"warped": "entity/signs/warped",
"warped": "gui/hanging_signs/warped",
"warped_door_bottom": "warped_door_bottom",
"warped_door_top": "warped_door_top",
"warped_fungus": "warped_fungus",
Expand Down Expand Up @@ -2569,7 +2594,7 @@
"wheat_stage5": "wheat_stage5",
"wheat_stage6": "wheat_stage6",
"wheat_stage7": "wheat_stage7",
"white": "misc/white",
"white": "entity/rabbit/white",
"white_candle": "white_candle",
"white_candle_lit": "white_candle_lit",
"white_concrete": "white_concrete",
Expand All @@ -2583,11 +2608,11 @@
"white_tulip": "white_tulip",
"white_wool": "white_wool",
"widgets": "gui/widgets",
"wind": "entity/conduit/wind",
"wind": "painting/wind",
"wind_vertical": "entity/conduit/wind_vertical",
"window": "gui/advancements/window",
"witch": "entity/witch",
"wither": "entity/wither/wither",
"wither": "painting/wither",
"wither_armor": "entity/wither/wither_armor",
"wither_invulnerable": "entity/wither/wither_invulnerable",
"wither_rose": "wither_rose",
Expand All @@ -2614,7 +2639,8 @@
"zoglin": "entity/hoglin/zoglin",
"zombie": "entity/zombie/zombie",
"zombie_villager": "entity/zombie_villager/zombie_villager",
"zombified_piglin": "entity/piglin/zombified_piglin"
"zombified_piglin": "entity/piglin/zombified_piglin",
"zuri": "entity/player/wide/zuri"
},
"block_mapping_mineways": {
"1": "",
Expand Down Expand Up @@ -3729,6 +3755,11 @@
0.614651,
0.089036
],
"water": [
0.067324,
0.135132,
2
],
"water_flow": [
0.067324,
0.135132,
Expand Down
2 changes: 1 addition & 1 deletion MCprep_addon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
bl_info = {
"name": "MCprep",
"category": "Object",
"version": (3, 4, 1),
"version": (3, 4, 2),
"blender": (2, 80, 0),
"location": "3D window toolshelf > MCprep tab",
"description": "Minecraft workflow addon for rendering and animation",
Expand Down
Loading

0 comments on commit ea56ef1

Please sign in to comment.