Skip to content

Commit

Permalink
Merge branch 'v1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
DemianWright committed Mar 26, 2017
2 parents cef92f7 + 3096016 commit d3aa998
Show file tree
Hide file tree
Showing 7 changed files with 1,452 additions and 399 deletions.
119 changes: 78 additions & 41 deletions README.md

Large diffs are not rendered by default.

51 changes: 45 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@

# TODO: Importing BLB files.
# TODO: Render brick preview.
# TODO: Panels in the UI?
# TODO: Brick quad limit?
# TODO: Check that all docstrings and comments are still up to date.


class ExportBLB(bpy.types.Operator, ExportHelper):
Expand Down Expand Up @@ -265,7 +268,7 @@ class ExportBLB(bpy.types.Operator, ExportHelper):
auto_sort_quads = BoolProperty(
name="Automatic Quad Sorting",
description="Automatically sorts the quads of the meshes into the 7 sections. Coverage must be enabled for this to be of any use.",
default=False,
default=True,
)

# -------------
Expand All @@ -274,7 +277,7 @@ class ExportBLB(bpy.types.Operator, ExportHelper):
use_materials = BoolProperty(
name="Use Material Colors",
description="Read quad colors from materials (recommended method, overrides object colors)",
default=True,
default=False,
)

# -----------------
Expand All @@ -283,7 +286,7 @@ class ExportBLB(bpy.types.Operator, ExportHelper):
use_vertex_colors = BoolProperty(
name="Use Vertex Colors",
description="Read quad colors from the first vertex color layer (overrides material colors)",
default=True,
default=False,
)

# -----------------
Expand All @@ -295,6 +298,24 @@ class ExportBLB(bpy.types.Operator, ExportHelper):
default=False,
)

# -------------
# Calculate UVs
# -------------
calculate_uvs = BoolProperty(
name="Calculate UVs",
description="Calculate correct UV coordinates based on the brick texture name specified in the material name",
default=True,
)

# ---------
# Store UVs
# ---------
store_uvs = BoolProperty(
name="Store UVs",
description="Write calculated UVs into Blender objects (data in existing generated UV layers will be overwritten)",
default=True,
)

# -------------
# Round Normals
# -------------
Expand Down Expand Up @@ -545,11 +566,16 @@ def execute(self, context):

# Show an error popup in the UI.
self.report({"ERROR"}, message)
# Else: No error message, everything is OK.

logger.clear_log()
logger.clear_log()

return {"CANCELLED"}
else:
# No error message, everything is OK.

logger.clear_log()

return {"FINISHED"}
return {"FINISHED"}

# ==============
# User Interface
Expand Down Expand Up @@ -713,6 +739,19 @@ def draw_coverage_property(label_text):
# Property: Use Object Colors
layout.prop(self, "use_object_colors")

# Property: UVs
row = layout.row()
split = row.split(percentage=0.53)
col = split.column()
col.prop(self, "calculate_uvs")

# Property: Store UVs
if self.calculate_uvs:
split = split.split()
split.active = self.calculate_uvs
col = split.column()
col.prop(self, "store_uvs")

# Property: Round Normals
layout.prop(self, "round_normals")

Expand Down
Loading

0 comments on commit d3aa998

Please sign in to comment.