Skip to content

Commit

Permalink
Fix for instructions look #76
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyLobster committed May 21, 2023
1 parent ed7eeb7 commit b756273
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It supports **.mpd**, **.ldr**, **.l3b**, and **.dat** file formats.
It's intended to be accurate, compatible, and fast (in that order of priority).

## Features ##
+ Works with Blender 2.81 up to at least Blender 3.4
+ Works with Blender 2.81 up to at least Blender 3.5
+ **Mac**, **Windows** and **Linux** supported.
+ **Bricksmith** compatible.
+ **MPD** file compatible.
Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"name": "Import LDraw",
"description": "Import LDraw models in .mpd .ldr .l3b and .dat formats",
"author": "Toby Nelson <tobymnelson@gmail.com>",
"version": (1, 1, 15),
"version": (1, 1, 16),
"blender": (2, 81, 0),
"location": "File > Import",
"warning": "",
Expand Down
2 changes: 1 addition & 1 deletion __version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
version = (1, 1, 15)
version = (1, 1, 16)
11 changes: 9 additions & 2 deletions loadldraw/loadldraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -3887,8 +3887,9 @@ def setupInstructionsLook():
if scene.camera is not None:
scene.camera.data.type = 'ORTHO'

# For Blender Render, set transparent background
render.alpha_mode = 'TRANSPARENT'
# For Blender Render, set transparent background. (Not available in Blender 3.5.1 or higher.)
if hasattr(render, "alpha_mode"):
render.alpha_mode = 'TRANSPARENT'

# Turn on cycles transparency
scene.cycles.film_transparent = True
Expand Down Expand Up @@ -3953,6 +3954,12 @@ def setupInstructionsLook():
layerNames.append("TransparentBricks")
transLayer = layerNames.index("TransparentBricks")

# Use Z layer (defaults to off in Blender 3.5.1)
if hasattr(layers[transLayer], "use_pass_z"):
layers[transLayer].use_pass_z = True
if hasattr(layers[solidLayer], "use_pass_z"):
layers[solidLayer].use_pass_z = True

# Disable any render/view layers that are not needed
for i in range(len(layers)):
if i not in [solidLayer, transLayer]:
Expand Down

0 comments on commit b756273

Please sign in to comment.