Skip to content

Commit

Permalink
Added Instructions Look
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Nelson committed Oct 19, 2016
1 parent b606db7 commit 8a4a4be
Show file tree
Hide file tree
Showing 6 changed files with 359 additions and 71 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ It's intended to be accurate, compatible, and fast (in that order of priority).
+ **Mac** and **Windows** supported (and hopefully **Linux**, but this is currently untested).
+ **Bricksmith** compatible.
+ **MPD** file compatible.
+ **LeoCAD** groups supported.
+ **LSynth** bendable parts supported (synthesized models).
+ Both *Cycles* and *Blender Render* engines supported. It renders either engine from a single scene.
+ Import **photorealistic** look, or **Instructions** Look.
+ **Realistic materials** including standard brick material, transparent, rubber, and even the less common materials like chrome, metal, pearlescent, glow-in-the-dark, glitter and speckle.
+ **Accurate colour handling**. Correct colour space management is used so that e.g. black parts look black.
+ **Direct colours** supported.
Expand Down Expand Up @@ -53,6 +55,8 @@ It's intended to be accurate, compatible, and fast (in that order of priority).
+ The first option is the LDraw Parts Library directory. Type the full filepath to the 'ldraw' directory you unzipped to.
+ To save that directory and try it out, choose a file to import.

![Tugboat](./images/tugboat_960.png)

## History ##
This plug-in is by Toby Nelson (toby@tnelson.demon.co.uk) and was initially written in May 2016.

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 <toby@tnelson.demon.co.uk>",
"version": (1, 0, 8),
"version": (1, 0, 9),
"blender": (2, 76, 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, 0, 8)
version = (1, 0, 9)
Binary file added images/tugboat_960.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions importldraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
scale = 0.04
resolution = "Standard"
smoothShading = True
useLook = "normal"
useColourScheme = "lgeo"
gaps = True
gapWidth = 0.04
Expand Down Expand Up @@ -152,6 +153,16 @@ class ImportLDrawOps(bpy.types.Operator, ImportHelper):
description="Smooth faces and add an edge-split modifier",
default=prefs.get("smoothShading", True)
)

look = EnumProperty(
name="Overall Look",
description="Realism or Schematic look",
default=prefs.get("useLook", "normal"),
items=(
("normal", "Realistic Look", "Render to look realistic."),
("instructions", "Lego Instructions Look", "Render to look like the instruction book pictures"),
)
)

colourScheme = EnumProperty(
name="Colour scheme options",
Expand Down Expand Up @@ -243,6 +254,7 @@ def draw(self, context):
box.label("LDraw filepath:", icon='FILESEL')
box.prop(self, "ldrawPath")
box.prop(self, "importScale")
box.prop(self, "look", expand=True)
box.prop(self, "colourScheme", expand=True)
box.prop(self, "resPrims", expand=True)
box.prop(self, "smoothParts")
Expand Down Expand Up @@ -274,6 +286,7 @@ def execute(self, context):
ImportLDrawOps.prefs.set("resolution", self.resPrims)
ImportLDrawOps.prefs.set("smoothShading", self.smoothParts)
ImportLDrawOps.prefs.set("bevelEdges", self.bevelEdges)
ImportLDrawOps.prefs.set("useLook", self.look)
ImportLDrawOps.prefs.set("useColourScheme", self.colourScheme)
ImportLDrawOps.prefs.set("gaps", self.addGaps)
ImportLDrawOps.prefs.set("gapWidth", self.gapsSize)
Expand All @@ -294,6 +307,7 @@ def execute(self, context):
loadldraw.Options.resolution = self.resPrims
loadldraw.Options.defaultColour = "4"
loadldraw.Options.createInstances = self.linkParts
loadldraw.Options.instructionsLook = self.look == "instructions"
loadldraw.Options.useColourScheme = self.colourScheme
loadldraw.Options.numberNodes = self.numberNodes
loadldraw.Options.removeDoubles = True
Expand Down
Loading

0 comments on commit 8a4a4be

Please sign in to comment.