style change, harmless changes while looking into bug [#28196]
This commit is contained in:
@@ -23,7 +23,15 @@ import mathutils
|
||||
|
||||
|
||||
class prettyface(object):
|
||||
__slots__ = "uv", "width", "height", "children", "xoff", "yoff", "has_parent", "rot"
|
||||
__slots__ = ("uv",
|
||||
"width",
|
||||
"height",
|
||||
"children",
|
||||
"xoff",
|
||||
"yoff",
|
||||
"has_parent",
|
||||
"rot",
|
||||
)
|
||||
|
||||
def __init__(self, data):
|
||||
self.has_parent = False
|
||||
@@ -263,10 +271,9 @@ def lightmap_uvpack(meshes,
|
||||
del trylens
|
||||
|
||||
def trilensdiff(t1, t2):
|
||||
return\
|
||||
abs(t1[1][t1[2][0]] - t2[1][t2[2][0]]) + \
|
||||
abs(t1[1][t1[2][1]] - t2[1][t2[2][1]]) + \
|
||||
abs(t1[1][t1[2][2]] - t2[1][t2[2][2]])
|
||||
return (abs(t1[1][t1[2][0]] - t2[1][t2[2][0]]) +
|
||||
abs(t1[1][t1[2][1]] - t2[1][t2[2][1]]) +
|
||||
abs(t1[1][t1[2][2]] - t2[1][t2[2][2]]))
|
||||
|
||||
while tri_lengths:
|
||||
tri1 = tri_lengths.pop()
|
||||
@@ -543,22 +550,51 @@ class LightMapPack(bpy.types.Operator):
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
PREF_CONTEXT = bpy.props.EnumProperty(
|
||||
name="Selection",
|
||||
description="",
|
||||
items=(("SEL_FACES", "Selected Faces", "Space all UVs evently"),
|
||||
("ALL_FACES", "All Faces", "Average space UVs edge length of each loop"),
|
||||
("ALL_OBJECTS", "Selected Mesh Object", "Average space UVs edge length of each loop")
|
||||
),
|
||||
name="Selection",
|
||||
description="")
|
||||
)
|
||||
|
||||
# Image & UVs...
|
||||
PREF_PACK_IN_ONE = BoolProperty(name="Share Tex Space", default=True, description="Objects Share texture space, map all objects into 1 uvmap")
|
||||
PREF_NEW_UVLAYER = BoolProperty(name="New UV Layer", default=False, description="Create a new UV layer for every mesh packed")
|
||||
PREF_APPLY_IMAGE = BoolProperty(name="New Image", default=False, description="Assign new images for every mesh (only one if shared tex space enabled)")
|
||||
PREF_IMG_PX_SIZE = IntProperty(name="Image Size", min=64, max=5000, default=512, description="Width and Height for the new image")
|
||||
|
||||
PREF_PACK_IN_ONE = BoolProperty(
|
||||
name="Share Tex Space",
|
||||
description=("Objects Share texture space, map all objects "
|
||||
"into 1 uvmap"),
|
||||
default=True,
|
||||
)
|
||||
PREF_NEW_UVLAYER = BoolProperty(
|
||||
name="New UV Layer",
|
||||
description="Create a new UV layer for every mesh packed",
|
||||
default=False,
|
||||
)
|
||||
PREF_APPLY_IMAGE = BoolProperty(
|
||||
name="New Image",
|
||||
description=("Assign new images for every mesh (only one if "
|
||||
"shared tex space enabled)"),
|
||||
default=False,
|
||||
)
|
||||
PREF_IMG_PX_SIZE = IntProperty(
|
||||
name="Image Size",
|
||||
description="Width and Height for the new image",
|
||||
min=64, max=5000,
|
||||
default=512,
|
||||
)
|
||||
# UV Packing...
|
||||
PREF_BOX_DIV = IntProperty(name="Pack Quality", min=1, max=48, default=12, description="Pre Packing before the complex boxpack")
|
||||
PREF_MARGIN_DIV = FloatProperty(name="Margin", min=0.001, max=1.0, default=0.1, description="Size of the margin as a division of the UV")
|
||||
PREF_BOX_DIV = IntProperty(
|
||||
name="Pack Quality",
|
||||
description="Pre Packing before the complex boxpack",
|
||||
min=1, max=48,
|
||||
default=12,
|
||||
)
|
||||
PREF_MARGIN_DIV = FloatProperty(
|
||||
name="Margin",
|
||||
description="Size of the margin as a division of the UV",
|
||||
min=0.001, max=1.0,
|
||||
default=0.1,
|
||||
)
|
||||
|
||||
def execute(self, context):
|
||||
kwargs = self.as_keywords()
|
||||
|
Reference in New Issue
Block a user