Skip to content

Commit

Permalink
Merge pull request #504 from Moo-Ack-Productions/dev
Browse files Browse the repository at this point in the history
v3.5.1 release
  • Loading branch information
TheDuckCow committed Nov 15, 2023
2 parents 0ff8722 + 16a7296 commit 971c3ab
Show file tree
Hide file tree
Showing 9 changed files with 609 additions and 150 deletions.
13 changes: 11 additions & 2 deletions BlenderChanges.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ None that concern MCprep.
- `MeshUVLoop` is deprecated. **Removed in Blender 4.0**
- `data` remains emulated, but with a performance penalty

# [Blender 3.6 (IN DEVELOPMENT)](https://wiki.blender.org/wiki/Reference/Release_Notes/3.6/Python_API)
Nothing that concerns MCprep for now.
# [Blender 3.6](https://wiki.blender.org/wiki/Reference/Release_Notes/3.6/Python_API)
Nothing that concerns MCprep

# [Blender 4.0 (IN DEVELOPMENT)](https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API)
## Deprecated
Expand All @@ -104,3 +104,12 @@ Nothing that concerned MCprep for now.
- The node's Python name is `ShaderNodeBsdfAnisotropic`
- `MeshUVLoop` removed
- Passing context into operators removed
- Principled BSDF has been completely rewritten, including sockets
- Subsurface -> Subsurface Weight
- Subsurface Color removed, use Base Color instead
- Specular -> Specular IOR Level
- Specular Tint changed from float to color
- Transmission -> Transmission Weight
- Coat -> Coat Weight
- Sheen -> Sheen Weight
- Emission -> Emission Color
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, 5, 0),
"version": (3, 5, 1),
"blender": (2, 80, 0),
"location": "3D window toolshelf > MCprep tab",
"description": "Minecraft workflow addon for rendering and animation",
Expand Down
6 changes: 3 additions & 3 deletions MCprep_addon/materials/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ def matgen_cycles_simple(mat: Material, options: PrepOptions) -> Optional[bool]:
# Set values.
# Specular causes issues with how blocks look, so let's disable it.
nodeSaturateMix.inputs[saturateMixIn[0]].default_value = 1.0
principled.inputs["Specular"].default_value = 0
principled.inputs["Specular IOR Level" if util.min_bv((4, 0, 0)) else "Specular"].default_value = 0

# Connect nodes.
links.new(nodeTexDiff.outputs[0], nodeSaturateMix.inputs[saturateMixIn[1]])
Expand All @@ -1262,7 +1262,7 @@ def matgen_cycles_simple(mat: Material, options: PrepOptions) -> Optional[bool]:
principled.inputs['Emission Strength'].default_value = 1
links.new(
nodeSaturateMix.outputs[saturateMixOut[0]],
principled.inputs["Emission"])
principled.inputs["Emission Color" if util.min_bv((4, 0, 0)) else "Emission"])

# reapply animation data if any to generated nodes
apply_texture_animation_pass_settings(mat, animated_data)
Expand Down Expand Up @@ -1390,7 +1390,7 @@ def matgen_cycles_principled(mat: Material, options: PrepOptions) -> Optional[bo
[nodeMixEmit.inputs[0]],
[principled.inputs["Roughness"]],
[principled.inputs["Metallic"]],
[principled.inputs["Specular"]],
[principled.inputs["Specular IOR Level" if util.min_bv((4, 0, 0)) else "Specular"]],
[principled.inputs["Normal"]]]

if not options.use_emission_nodes:
Expand Down
10 changes: 9 additions & 1 deletion MCprep_addon/spawner/mcmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ def add_model(
)

face.normal_update()

# Give slight offset by normal for overlay geometry
if face_mat == "#overlay":
bmesh.ops.translate(bm, verts=face.verts,
vec=0.02 * face.normal)

for j in range(len(face.loops)):
# uv coords order is determened by the rotation of the uv,
# e.g. if the uv is rotated by 180 degrees, the first index
Expand All @@ -378,7 +384,9 @@ def add_model(
face.material_index = materials.index(face_mat)

# Quick way to clean the model, hopefully it doesn't cause any UV issues
bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=0.01)
# Ignore model has overlay geometry, causing issue
if not textures.get("overlay"):
bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=0.005)

# make the bmesh the object's mesh
bm.to_mesh(mesh)
Expand Down
Loading

0 comments on commit 971c3ab

Please sign in to comment.