This commit is contained in:
listik committed 2026-11-17 20:19:55 +03:00
1 parent 0a69e82952
commit 72e08f024f
997 files changed
+345 -1

No files matched your search

+411
View File
@@ -0,0 +1,411 @@
# Map -> Roblox GLBs with all textures embedded (same idea as the ornament machine export).
# Run on the saved copy: blender -b map/roblox/export_source.blend --python map/roblox/export_map_glb.py
#
# * flat-colour materials -> one palette atlas (32 px cells); every face points at its material's cell
# * procedural materials (fence wood, island snow, cliff, asphalt) -> baked into their own textures (Cycles)
# - the 10 zone fences share one bake: zone 1 is baked, the other fences get the same UVs (identical meshes)
# * snow meshes are decimated (they are the bulk of the 1.3M triangles)
# * everything is merged per texture into chunks of <= MAX_TRIS triangles (Roblox limit per MeshPart)
# * export: map_glb/Map_<Group>.glb (Zones / Plaza_Decor / Ground), each < 20 MB, + manifest.json
# * the zone name signs are left out (removed from the game earlier)
import bpy, bmesh, json, math, os
from collections import Counter, defaultdict
from mathutils import Vector, Matrix
SRC_DIR = os.path.dirname(bpy.data.filepath)
OUT = os.path.join(SRC_DIR, "map_glb")
os.makedirs(OUT, exist_ok=True)
MAX_TRIS = 18000
SNOW_RATIO = 0.35 # decimation of snow meshes (plaza, pines)
ZONE_SNOW_RATIO = 0.15 # snow draped on the 10 zone fences
BULB_RATIO = 0.22 # garland bulbs (smooth spheres)
WIRE_RATIO = 0.35 # garland wire
CELL, GRID = 32, 8 # palette atlas: 8x8 cells of 32 px
EXCLUDE = {"Studio"}
GROUND = {"Terrain", "Landscape_Snowdrifts", "Asphalt_Edge_Snowdrifts", "Continuous_Curb_Snow"}
ZONES = {"Fences", "Snow_Draped_Reference", "Snow_Organic_Domes",
"Festive_Nameplate_Details", "Sign_Fence_Style_Supports", "Zone_Player_Nameplates"}
# v2: no per-object bakes any more (their UVs came out wrong in Roblox): procedural materials are baked once,
# averaged to one colour and go into the palette like the flat ones; detail comes from the Roblox material.
BAKE_SIZE = {"Island__Snow": 2048}
DEFAULT_BAKE = 1024
FENCE_MAT = "Fence_Warm_Cedar_Subtle"
def to_srgb(c):
c = max(0.0, min(1.0, c))
return 12.92 * c if c <= 0.0031308 else 1.055 * (c ** (1 / 2.4)) - 0.055
def bsdf(m):
return next((n for n in m.node_tree.nodes if n.type == "BSDF_PRINCIPLED"), None) if m and m.node_tree else None
def is_procedural(m):
if not m or not m.node_tree:
return False
return any(n.type.startswith("TEX_") for n in m.node_tree.nodes)
def glow_of(m):
b = bsdf(m)
name = m.name.lower() if m else ""
return ("bulb" in name or "glass" in name) or (b is not None and b.inputs["Emission Strength"].default_value >= 0.5)
def coll_of(o):
return o.users_collection[0].name if o.users_collection else ""
# ------------------------------------------------------------------ scene objects to export
visible = [o for o in bpy.data.objects if o.type in ("MESH", "CURVE") and o.visible_get() and coll_of(o) not in EXCLUDE]
def group_of(o):
c = coll_of(o)
if c in GROUND:
return "Ground"
if c in ZONES:
# two files (upload limit 20 MB): zones on the +Y half of the island and on the -Y half
cs = [o.matrix_world @ Vector(v) for v in o.bound_box]
return "Zones_North" if sum(v.y for v in cs) >= 0 else "Zones_South"
return "Plaza_Decor"
print("OBJECTS", len(visible), dict(Counter(group_of(o) for o in visible)))
work = bpy.data.collections.new("RobloxExport") # merged export meshes live here (in the same scene)
bpy.context.scene.collection.children.link(work)
dg = bpy.context.evaluated_depsgraph_get()
def world_mesh(o):
me = bpy.data.meshes.new_from_object(o.evaluated_get(dg))
me.transform(o.matrix_world)
if o.matrix_world.determinant() < 0:
me.flip_normals()
return me
# ------------------------------------------------------------------ palette for flat materials
palette, cells = {}, []
proc_color = {} # procedural material name -> averaged linear colour
def cell_uv(m):
key = m.name if m else "__none__"
if key not in palette:
b = bsdf(m)
col = list(b.inputs["Base Color"].default_value[:3]) if b else [0.8, 0.8, 0.8]
if m and m.name in proc_color:
col = proc_color[m.name]
if m and glow_of(m) and b:
ec = b.inputs["Emission Color"].default_value
if max(ec[:3]) > 0.05:
col = list(ec[:3])
palette[key] = len(cells)
cells.append(col)
if len(cells) > GRID * GRID:
raise RuntimeError("palette overflow")
i = palette[key]
return ((i % GRID) + 0.5) / GRID, ((i // GRID) + 0.5) / GRID
# ------------------------------------------------------------------ bake helpers
sc = bpy.context.scene
sc.render.engine = "CYCLES"
sc.cycles.samples = 4
sc.cycles.device = "CPU"
sc.render.bake.use_pass_direct = False
sc.render.bake.use_pass_indirect = False
sc.render.bake.use_pass_color = True
sc.render.bake.margin = 6
def bake_object_texture(name, me, mat, size):
"""me = world-space mesh using only `mat`; adds BakeUV, bakes the diffuse colour, returns the image."""
ob = bpy.data.objects.new("_bake_" + name, me)
sc.collection.objects.link(ob)
uv = me.uv_layers.new(name="BakeUV")
for l in me.uv_layers:
l.active_render = (l.name != "BakeUV") if len(me.uv_layers) > 1 else True
me.uv_layers.active = uv
bpy.ops.object.select_all(action="DESELECT")
ob.select_set(True)
bpy.context.view_layer.objects.active = ob
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action="SELECT")
bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.003, scale_to_bounds=True)
bpy.ops.object.mode_set(mode="OBJECT")
img = bpy.data.images.new("Tex_" + name, size, size, alpha=False)
bm_ = mat.copy()
t = bm_.node_tree.nodes.new("ShaderNodeTexImage")
t.image = img
bm_.node_tree.nodes.active = t
me.materials.clear()
me.materials.append(bm_)
bpy.ops.object.bake(type="DIFFUSE", pass_filter={"COLOR"}, use_clear=True)
img.filepath_raw = os.path.join(OUT, img.name + ".png")
img.file_format = "PNG"
img.save()
sc.collection.objects.unlink(ob)
bpy.data.objects.remove(ob)
return img
# ------------------------------------------------------------------ build per-object pieces
# piece = (group, texture key, roblox material, bmesh in world space with a "UV" layer)
pieces = []
fence_bake = None # (image, uv list) from zone 1
fences = sorted([o for o in visible if any(s.material and s.material.name == FENCE_MAT for s in o.material_slots)
and coll_of(o) in ZONES], key=lambda o: o.name)
def split_faces(o, me):
"""-> {material: bmesh with only that material's faces}"""
names = [s.material for s in o.material_slots] or [None]
out = {}
used = {min(p.material_index, len(names) - 1) for p in me.polygons}
for idx in used:
m = names[idx]
bm = bmesh.new()
bm.from_mesh(me)
bmesh.ops.delete(bm, geom=[f for f in bm.faces if min(f.material_index, len(names) - 1) != idx], context="FACES")
if bm.faces:
key = m.name if m else "__none__"
if key in out:
tmp = bpy.data.meshes.new("_tmp"); bm.to_mesh(tmp); out[key][1].from_mesh(tmp); bpy.data.meshes.remove(tmp); bm.free()
else:
out[key] = (m, bm)
else:
bm.free()
return out
def decimate_bm(bm, ratio):
me = bpy.data.meshes.new("_dec")
bm.to_mesh(me)
bm.free()
ob = bpy.data.objects.new("_dec", me)
sc.collection.objects.link(ob)
mod = ob.modifiers.new("D", "DECIMATE")
mod.ratio = ratio
d2 = bpy.context.evaluated_depsgraph_get(); d2.update()
nm = bpy.data.meshes.new_from_object(ob.evaluated_get(d2))
out = bmesh.new()
out.from_mesh(nm)
sc.collection.objects.unlink(ob)
bpy.data.objects.remove(ob)
bpy.data.meshes.remove(me)
bpy.data.meshes.remove(nm)
return out
def set_uv_cell(bm, uv_xy):
for l in list(bm.loops.layers.uv):
bm.loops.layers.uv.remove(l)
uv = bm.loops.layers.uv.new("UV")
for f in bm.faces:
for lp in f.loops:
lp[uv].uv = uv_xy
def bm_from_mesh(me, keep_uv_name=None):
bm = bmesh.new()
bm.from_mesh(me)
if keep_uv_name:
keep = bm.loops.layers.uv.get(keep_uv_name)
for l in list(bm.loops.layers.uv):
if l != keep:
bm.loops.layers.uv.remove(l)
# rename to "UV"
uv = bm.loops.layers.uv.new("UV")
for f in bm.faces:
for lp in f.loops:
lp[uv].uv = lp[keep].uv
bm.loops.layers.uv.remove(keep)
return bm
def to_linear(c):
return c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4
def mean_color(o, m):
me = world_mesh(o)
parts = split_faces(o, me)
bpy.data.meshes.remove(me)
if m.name not in parts:
return None
bm = parts.pop(m.name)[1]
for _, b2 in parts.values():
b2.free()
tmp = bpy.data.meshes.new("_mc"); bm.to_mesh(tmp); bm.free()
img = bake_object_texture("_mean_" + m.name, tmp, m, 128)
bpy.data.meshes.remove(tmp)
px = list(img.pixels)
acc, n = [0.0, 0.0, 0.0], 0
for k in range(0, len(px), 4):
if px[k] + px[k + 1] + px[k + 2] > 0.03: # skip the black background around UV islands
acc[0] += px[k]; acc[1] += px[k + 1]; acc[2] += px[k + 2]; n += 1
os.remove(img.filepath_raw)
bpy.data.images.remove(img)
return [to_linear(a / max(1, n)) for a in acc]
for o in visible:
for s in o.material_slots:
m = s.material
if m and is_procedural(m) and m.name not in proc_color:
c = mean_color(o, m)
if c:
proc_color[m.name] = c
print("MEAN", m.name, [round(to_srgb(v) * 255) for v in c])
fences = [] # fences now go through the palette path like everything else
if False:
z1 = fences[0]
me = world_mesh(z1)
img = bake_object_texture("Fence_Wood", me, bpy.data.materials[FENCE_MAT], DEFAULT_BAKE)
uvs = [d.uv.copy() for d in me.uv_layers["BakeUV"].data]
fence_bake = (img, uvs)
pieces.append((group_of(z1), img.name, "Wood", bm_from_mesh(me, "BakeUV")))
bpy.data.meshes.remove(me)
for o in fences[1:]:
me2 = world_mesh(o)
if len(me2.loops) == len(uvs):
lay = me2.uv_layers.new(name="BakeUV")
for k, d in enumerate(lay.data):
d.uv = uvs[k]
pieces.append((group_of(o), img.name, "Wood", bm_from_mesh(me2, "BakeUV")))
else:
print("WARNING fence topology differs, baking separately:", o.name)
im2 = bake_object_texture("Fence_" + o.name, me2, bpy.data.materials[FENCE_MAT], DEFAULT_BAKE)
pieces.append((group_of(o), im2.name, "Wood", bm_from_mesh(me2, "BakeUV")))
bpy.data.meshes.remove(me2)
fence_set = set(fences)
baked = Counter()
for o in visible:
if o in fence_set:
continue
grp = group_of(o)
me = world_mesh(o)
for key, (m, bm) in split_faces(o, me).items():
if False:
# bake this object's faces of the procedural material
tmp = bpy.data.meshes.new("_proc"); bm.to_mesh(tmp); bm.free()
img = bake_object_texture("%s_%s" % (o.name, m.name), tmp, m, BAKE_SIZE.get(o.name, DEFAULT_BAKE))
baked[m.name] += 1
pieces.append((grp, img.name, "Snow" if "snow" in m.name.lower() else ("Slate" if "rock" in m.name.lower() else "SmoothPlastic"),
bm_from_mesh(tmp, "BakeUV")))
bpy.data.meshes.remove(tmp)
else:
low_name = m.name.lower() if m else ""
ratio = None
if grp.startswith("Zones"): # 10 copies of everything: keep it light
if "snow" in low_name:
ratio = ZONE_SNOW_RATIO
elif "bulb" in low_name:
ratio = BULB_RATIO
elif "wire" in low_name:
ratio = WIRE_RATIO
elif "snow" in low_name and grp != "Ground":
ratio = SNOW_RATIO
if ratio:
bm = decimate_bm(bm, ratio)
set_uv_cell(bm, cell_uv(m))
low = (m.name.lower() if m else "")
rb = "Neon" if (m and glow_of(m)) else ("Snow" if "snow" in low else ("Wood" if "wood" in low or "trunk" in low
or "cedar" in low or "fence" in low or "timber" in low
else ("Slate" if "rock" in low or "cliff" in low else ("Asphalt" if "asphalt" in low
else ("Metal" if "bronze" in low or "gold" in low else "SmoothPlastic")))))
# one colour per mesh part: Roblox gets Part.Color from the cell, no texture sampling at all
pieces.append((grp, "C%02d" % palette[m.name if m else "__none__"], rb, bm))
bpy.data.meshes.remove(me)
print("BAKED", dict(baked), "PALETTE", len(cells))
# ------------------------------------------------------------------ palette image
TEX = CELL * GRID
pal = bpy.data.images.new("Tex_Palette", TEX, TEX, alpha=False)
px = [0.0] * (TEX * TEX * 4)
for i, c in enumerate(cells):
r, g, b = to_srgb(c[0]), to_srgb(c[1]), to_srgb(c[2])
cx, cy = (i % GRID) * CELL, (i // GRID) * CELL
for y in range(cy, cy + CELL):
for x in range(cx, cx + CELL):
k = (y * TEX + x) * 4
px[k:k + 4] = (r, g, b, 1.0)
pal.pixels = px
pal.filepath_raw = os.path.join(OUT, "Tex_Palette.png")
pal.file_format = "PNG"
pal.save()
# ------------------------------------------------------------------ export materials (one per texture)
mats = {}
def export_mat(tex_name, glow):
key = tex_name + ("_glow" if glow else "")
if key in mats:
return mats[key]
m = bpy.data.materials.new("M_" + key)
try:
m.use_nodes = True
except Exception:
pass
nt = m.node_tree
nt.nodes.clear()
out = nt.nodes.new("ShaderNodeOutputMaterial")
b = nt.nodes.new("ShaderNodeBsdfPrincipled")
b.inputs["Roughness"].default_value = 0.6
t = nt.nodes.new("ShaderNodeTexImage")
t.image = bpy.data.images["Tex_Palette" if tex_name.startswith("C") else tex_name]
t.interpolation = "Closest"
nt.links.new(t.outputs["Color"], b.inputs["Base Color"])
if glow:
nt.links.new(t.outputs["Color"], b.inputs["Emission Color"])
b.inputs["Emission Strength"].default_value = 1.0
nt.links.new(b.outputs["BSDF"], out.inputs["Surface"])
mats[key] = m
return m
# ------------------------------------------------------------------ merge into chunks and export
def tris(bm):
return sum(len(f.verts) - 2 for f in bm.faces)
buckets = defaultdict(list) # (group, texture, roblox material) -> [bm]
for grp, tex, rb, bm in pieces:
buckets[(grp, tex, rb)].append(bm)
manifest = []
group_objs = defaultdict(list)
for (grp, tex, rb), bms in sorted(buckets.items()):
# sort pieces around the island so chunks are spatially compact
def ang(bm):
c = sum((v.co for v in bm.verts), Vector()) / max(1, len(bm.verts))
return math.atan2(c.y, c.x)
bms.sort(key=ang)
chunk, n, k = bmesh.new(), 0, 0
def flush():
nonlocal_holder = None
out_chunks = []
for bm in bms:
t = tris(bm)
if n and n + t > MAX_TRIS:
out_chunks.append(chunk); chunk, n = bmesh.new(), 0
me = bpy.data.meshes.new("_m"); bm.to_mesh(me); chunk.from_mesh(me); bpy.data.meshes.remove(me); bm.free()
n += t
if n:
out_chunks.append(chunk)
for k, ch in enumerate(out_chunks):
bmesh.ops.triangulate(ch, faces=ch.faces[:])
if tris(ch) > MAX_TRIS: # a single huge piece: decimate the chunk
ch = decimate_bm(ch, MAX_TRIS / tris(ch) * 0.97)
name = "%s_%s_%s_%d" % (grp, rb, tex.replace("Tex_", ""), k)
name = name[:60]
me = bpy.data.meshes.new(name)
ch.to_mesh(me)
ch.free()
glow = rb == "Neon"
me.materials.append(export_mat(tex, glow))
for p in me.polygons:
p.use_smooth = rb == "Snow"
cs = [v.co for v in me.vertices]
lo = Vector((min(c.x for c in cs), min(c.y for c in cs), min(c.z for c in cs)))
hi = Vector((max(c.x for c in cs), max(c.y for c in cs), max(c.z for c in cs)))
ob = bpy.data.objects.new(name, me)
work.objects.link(ob)
group_objs[grp].append(ob)
manifest.append({"name": name, "group": grp, "material": rb, "texture": tex, "tris": len(me.polygons),
"center": [round(v, 3) for v in (lo + hi) / 2]})
# export one GLB per group (selection in the work scene)
for grp, objs in group_objs.items():
for o in bpy.context.view_layer.objects:
o.select_set(False)
for o in objs:
o.select_set(True)
path = os.path.join(OUT, "Map_%s.glb" % grp)
bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True, export_yup=True,
export_apply=True, export_materials="EXPORT", export_image_format="AUTO")
print("GLB", grp, len(objs), "objects", round(os.path.getsize(path) / 1e6, 2), "MB",
sum(m["tris"] for m in manifest if m["group"] == grp), "tris")
json.dump({"parts": manifest, "palette": [[round(v, 4) for v in c] for c in cells]},
open(os.path.join(OUT, "manifest.json"), "w"), indent=1)
print("TOTAL", len(manifest), "meshes", sum(m["tris"] for m in manifest), "tris")
+329
View File
@@ -0,0 +1,329 @@
# Export map_reference_pines_split (saved copy: map/roblox/export_source.blend) for Roblox.
# Run: blender -b export_source.blend --python export_map_v2.py
#
# Output: map/roblox/map_v2/
# *.glb + manifest.json meshes, one material each (Roblox MeshPart = one material), <= MAX_TRIS triangles
# clone = "zones" content of player zone 1 (fence, lights, fence snow); Studio clones it for all 10 zones
# (manifest.zone_angles = Blender angle of every zone, zone 1 = 90 deg)
# Zone_Fence_Wood.png the procedural cedar wood baked into a texture (Cycles diffuse colour)
# terrain_columns.json ground (island snow, cliff, paths, plaza, drifts, curb snow) sampled for Roblox Terrain
# Left out on purpose: zone name signs (collections below), hidden objects.
import bpy, bmesh, json, math, os
from collections import Counter
from mathutils import Vector, Matrix
from mathutils.bvhtree import BVHTree
HERE = os.path.dirname(bpy.data.filepath)
OUT = os.path.join(HERE, "map_v2")
os.makedirs(OUT, exist_ok=True)
MAX_TRIS = 18000
ZONE1_ANGLE, ZONE_HALF = 90.0, 17.0
EXCLUDE = {"Festive_Nameplate_Details", "Sign_Fence_Style_Supports", "Zone_Player_Nameplates", "Studio"}
GROUND = {"Terrain", "Landscape_Snowdrifts", "Asphalt_Edge_Snowdrifts", "Continuous_Curb_Snow"}
ZONE_COLLS = {"Fences", "Snow_Draped_Reference", "Snow_Organic_Domes"}
CELL = 4.0
BAKE_SIZE = 1024
export_coll = bpy.data.collections.new("RobloxExport")
bpy.context.scene.collection.children.link(export_coll)
manifest = []
def obj_center(o):
cs = [o.matrix_world @ Vector(c) for c in o.bound_box]
return sum(cs, Vector()) / 8
def angle_of(o):
c = obj_center(o)
return math.degrees(math.atan2(c.y, c.x))
def in_zone1(o):
return abs(((angle_of(o) - ZONE1_ANGLE + 180) % 360) - 180) <= ZONE_HALF
def coll_of(o):
return o.users_collection[0].name if o.users_collection else ""
def lin_to_srgb255(c):
f = lambda v: 12.92 * v if v <= 0.0031308 else 1.055 * v ** (1 / 2.4) - 0.055
return [max(0, min(255, round(f(max(0.0, v)) * 255))) for v in c]
def bsdf(mat):
return next((n for n in mat.node_tree.nodes if n.type == "BSDF_PRINCIPLED"), None) if mat and mat.node_tree else None
def mat_props(mname):
m = bpy.data.materials.get(mname)
b = bsdf(m)
col = [0.8, 0.8, 0.8]
glow = False
metal = 0.0
if b:
col = list(b.inputs["Base Color"].default_value[:3])
metal = b.inputs["Metallic"].default_value
es = b.inputs["Emission Strength"].default_value
if es >= 0.5:
glow = True
ec = b.inputs["Emission Color"].default_value
col = list(ec[:3]) if max(ec[:3]) > 0.05 else col
low = mname.lower()
if "bulb" in low or "glass" in low:
glow = True
if "snow" in low:
rb = "Snow"
elif glow:
rb = "Neon"
elif "wood" in low or "cedar" in low or "trunk" in low:
rb = "Wood"
elif metal > 0.5 or "bronze" in low or "gold" in low:
rb = "Metal"
else:
rb = "SmoothPlastic"
return {"material": rb, "color": lin_to_srgb255(col), "glow": glow}
def evaluated_mesh(o):
dg = bpy.context.evaluated_depsgraph_get()
me = bpy.data.meshes.new_from_object(o.evaluated_get(dg))
me.transform(o.matrix_world)
return me
def faces_by_material(o, me):
names = [s.material.name if s.material else "" for s in o.material_slots] or [""]
out = Counter()
for p in me.polygons:
out[names[min(p.material_index, len(names) - 1)]] += len(p.vertices) - 2
return out, names
def finish(name, bm, info, smooth=True):
bmesh.ops.triangulate(bm, faces=bm.faces[:])
me = bpy.data.meshes.new(name)
bm.to_mesh(me)
bm.free()
ob = bpy.data.objects.new(name, me)
export_coll.objects.link(ob)
tris = len(me.polygons)
if tris > MAX_TRIS:
dec = ob.modifiers.new("Dec", "DECIMATE")
dec.ratio = MAX_TRIS / tris * 0.97
dg = bpy.context.evaluated_depsgraph_get()
dg.update()
nm = bpy.data.meshes.new_from_object(ob.evaluated_get(dg))
ob.modifiers.clear()
ob.data = nm
bpy.data.meshes.remove(me)
me = nm
cs = [v.co for v in me.vertices]
lo = Vector((min(c.x for c in cs), min(c.y for c in cs), min(c.z for c in cs)))
hi = Vector((max(c.x for c in cs), max(c.y for c in cs), max(c.z for c in cs)))
ctr = (lo + hi) / 2
me.transform(Matrix.Translation(-ctr))
for p in me.polygons:
p.use_smooth = smooth
info.update({"name": name, "center": [round(v, 4) for v in ctr], "size": [round(v, 3) for v in hi - lo],
"tris": len(me.polygons), "file": name + ".glb"})
manifest.append(info)
return ob
def export_group(prefix, objs, clone, raw_chunk=MAX_TRIS):
"""Merge objs per material (world space) into chunks of <= raw_chunk source triangles; chunks above
MAX_TRIS are decimated down to it in finish()."""
per_mat = {}
for o in objs:
me = evaluated_mesh(o)
counts, names = faces_by_material(o, me)
bpy.data.meshes.remove(me)
for mname, n in counts.items():
per_mat.setdefault(mname, []).append((o, n))
for mname, items in sorted(per_mat.items()):
if not mname:
continue
items.sort(key=lambda t: angle_of(t[0])) # spatially coherent chunks
chunks, cur, cur_n = [], [], 0
for o, n in items:
if cur and cur_n + n > raw_chunk:
chunks.append(cur); cur, cur_n = [], 0
cur.append(o); cur_n += n
if cur:
chunks.append(cur)
props = mat_props(mname)
for k, chunk in enumerate(chunks):
bm = bmesh.new()
for o in chunk:
me = evaluated_mesh(o)
tmp = bmesh.new()
tmp.from_mesh(me)
names = [s.material.name if s.material else "" for s in o.material_slots] or [""]
bmesh.ops.delete(tmp, geom=[f for f in tmp.faces if names[min(f.material_index, len(names) - 1)] != mname], context="FACES")
tmp.to_mesh(me)
tmp.free()
bm.from_mesh(me)
bpy.data.meshes.remove(me)
if not bm.faces:
bm.free(); continue
name = "%s_%s_%d" % (prefix, mname, k)
info = dict(props)
info["clone"] = clone
info["source_material"] = mname
finish(name, bm, info, smooth=(props["material"] in ("Snow",)) or "Snow" in mname)
# ------------------------------------------------------------------ classify visible objects
visible = [o for o in bpy.data.objects if o.type in ("MESH", "CURVE") and o.visible_get()]
zone_objs, global_objs, skipped = [], [], Counter()
for o in visible:
c = coll_of(o)
if c in EXCLUDE:
skipped[c] += 1
elif c in GROUND:
continue
elif c in ZONE_COLLS:
if in_zone1(o):
zone_objs.append(o)
else:
skipped["other zones"] += 1
else:
global_objs.append(o)
print("CLASSIFY zone1:", len(zone_objs), "global:", len(global_objs), "skipped:", dict(skipped))
# ------------------------------------------------------------------ zone 1: fence with baked wood
fence = next(o for o in zone_objs if o.name.startswith("Zone_01_Fence"))
wood_mat = fence.material_slots[0].material
me = evaluated_mesh(fence)
fob = bpy.data.objects.new("Zone_Fence", me)
export_coll.objects.link(fob)
bake_uv = me.uv_layers.new(name="BakeUV")
for l in me.uv_layers:
l.active_render = (l.name == "UVMap")
me.uv_layers.active = bake_uv
bpy.ops.object.select_all(action="DESELECT")
fob.select_set(True)
bpy.context.view_layer.objects.active = fob
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action="SELECT")
bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.004, scale_to_bounds=True)
bpy.ops.object.mode_set(mode="OBJECT")
img = bpy.data.images.new("Zone_Fence_Wood", BAKE_SIZE, BAKE_SIZE, alpha=False)
bake_mat = wood_mat.copy()
tex = bake_mat.node_tree.nodes.new("ShaderNodeTexImage")
tex.image = img
bake_mat.node_tree.nodes.active = tex
me.materials.clear()
me.materials.append(bake_mat)
sc = bpy.context.scene
sc.render.engine = "CYCLES"
sc.cycles.samples = 4
sc.cycles.device = "CPU"
sc.render.bake.use_pass_direct = False
sc.render.bake.use_pass_indirect = False
sc.render.bake.use_pass_color = True
sc.render.bake.margin = 6
bpy.ops.object.bake(type="DIFFUSE", pass_filter={"COLOR"}, use_clear=True)
img.filepath_raw = os.path.join(OUT, "Zone_Fence_Wood.png")
img.file_format = "PNG"
img.save()
for l in [l for l in me.uv_layers if l.name != "BakeUV"]:
me.uv_layers.remove(l)
exp_mat = bpy.data.materials.new("Zone_Fence_Wood_Mat")
try:
exp_mat.use_nodes = True
except Exception:
pass
nt = exp_mat.node_tree
b = next(n for n in nt.nodes if n.type == "BSDF_PRINCIPLED")
t2 = nt.nodes.new("ShaderNodeTexImage")
t2.image = img
nt.links.new(t2.outputs["Color"], b.inputs["Base Color"])
me.materials.clear()
me.materials.append(exp_mat)
cs = [v.co for v in me.vertices]
lo = Vector((min(c.x for c in cs), min(c.y for c in cs), min(c.z for c in cs)))
hi = Vector((max(c.x for c in cs), max(c.y for c in cs), max(c.z for c in cs)))
ctr = (lo + hi) / 2
me.transform(Matrix.Translation(-ctr))
manifest.append({"name": "Zone_Fence", "clone": "zones", "material": "Wood", "texture": "Zone_Fence_Wood.png",
"color": [255, 255, 255], "glow": False, "center": [round(v, 4) for v in ctr],
"size": [round(v, 3) for v in hi - lo], "tris": sum(len(p.vertices) - 2 for p in me.polygons),
"file": "Zone_Fence.glb"})
if manifest[-1]["tris"] > MAX_TRIS:
print("WARNING fence tris", manifest[-1]["tris"])
sc.render.engine = "BLENDER_EEVEE"
# ------------------------------------------------------------------ zone 1: lights + snow; global parts
export_group("Zone", [o for o in zone_objs if o is not fence], "zones", raw_chunk=45000)
export_group("Map", global_objs, None)
# ------------------------------------------------------------------ export every part as its own GLB
for info in manifest:
o = bpy.data.objects[info["name"]]
bpy.ops.object.select_all(action="DESELECT")
o.select_set(True)
bpy.context.view_layer.objects.active = o
bpy.ops.export_scene.gltf(filepath=os.path.join(OUT, info["file"]), export_format="GLB",
use_selection=True, export_yup=True, export_apply=True)
zone_angles = []
for k in range(1, 11):
z = bpy.data.objects.get("Zone_%02d_Fence" % k)
if z:
zone_angles.append(round(angle_of(z), 3))
lamps = [[round(v, 3) for v in obj_center(o)] for o in visible if o.name.startswith("Warm_Lantern") or
(coll_of(o) == "Plaza_Benches_And_Lanterns" and "Glass" in o.name)]
# ------------------------------------------------------------------ terrain columns
dg = bpy.context.evaluated_depsgraph_get()
trees = []
tlo = Vector((1e9, 1e9, 1e9)); thi = -tlo
for o in visible:
if coll_of(o) not in GROUND or o.type != "MESH":
continue
ev = o.evaluated_get(dg)
tm = ev.to_mesh()
tm.transform(o.matrix_world)
verts = [v.co.copy() for v in tm.vertices]
polys = [tuple(p.vertices) for p in tm.polygons]
mats = [(o.material_slots[p.material_index].material.name
if o.material_slots and o.material_slots[p.material_index].material else "") for p in tm.polygons]
ev.to_mesh_clear()
trees.append((BVHTree.FromPolygons(verts, polys), mats, o.name))
for v in verts:
tlo = Vector(map(min, tlo, v)); thi = Vector(map(max, thi, v))
def code_for(obj, mat):
m, n = mat.lower(), obj.lower()
if "rock" in m or "cliff" in m:
return "R"
if "curb" in m and "snow" not in m:
return "C"
if "asphalt" in m:
return "P" if "plaza" in n else "A"
return "S"
x0 = (int(tlo.x // CELL) - 1) * CELL
y0 = (int(tlo.y // CELL) - 1) * CELL
nx = int((thi.x - x0) // CELL) + 2
ny = int((thi.y - y0) // CELL) + 2
top, bot, mat = [], [], []
for j in range(ny):
for i in range(nx):
x = x0 + (i + 0.5) * CELL
y = y0 + (j + 0.5) * CELL
best_t, best_c, best_b = None, ".", None
for bvh, mats, name in trees:
hit = bvh.ray_cast(Vector((x, y, thi.z + 10)), Vector((0, 0, -1)))
if hit[0] is not None and (best_t is None or hit[0].z > best_t):
best_t = hit[0].z
best_c = code_for(name, mats[hit[2]])
hb = bvh.ray_cast(Vector((x, y, tlo.z - 10)), Vector((0, 0, 1)))
if hb[0] is not None and (best_b is None or hb[0].z < best_b):
best_b = hb[0].z
top.append(round(best_t, 2) if best_t is not None else None)
bot.append(round(best_b, 2) if best_b is not None else None)
mat.append(best_c)
json.dump({"cell": CELL, "x0": x0, "y0": y0, "nx": nx, "ny": ny, "top": top, "bot": bot, "mat": "".join(mat),
"zmin": tlo.z, "zmax": thi.z}, open(os.path.join(OUT, "terrain_columns.json"), "w"))
json.dump({"zone_angles": zone_angles, "zone1_angle": ZONE1_ANGLE, "parts": manifest, "lantern_lights": lamps},
open(os.path.join(OUT, "manifest.json"), "w"), indent=1)
total = 0
for m in manifest:
mult = len(zone_angles) if m["clone"] == "zones" else 1
total += m["tris"] * mult
print("PART", m["name"], m["tris"], m["material"], m["color"], m["clone"])
print("TERRAIN", nx, ny, dict(Counter(mat)))
print("TOTAL_PARTS", len(manifest), "IN_GAME_TRIS", total, "ZONES", zone_angles, "LAMPS", len(lamps))
+202
View File
@@ -0,0 +1,202 @@
# Export the non-terrain parts of map_refined_benches.blend as Roblox-ready GLBs + a manifest.
# Run: blender -b map_refined_benches.blend --python export_meshes.py
#
# * Zone 1 (fence, lights, fence snow) is exported once; Studio clones it 10x rotated about the island centre.
# * Plaza benches / lanterns are merged per material in world space.
# * The procedural fence wood is baked (Cycles, diffuse colour) into a 1024px PNG on a fresh UV map.
# * Every mesh is re-centred on its bounding-box centre; the manifest stores that centre (Blender coords).
import bpy, bmesh, json, math, os
from mathutils import Vector, Matrix
HERE = os.path.dirname(bpy.data.filepath)
OUT = os.path.join(HERE, "roblox", "meshes")
os.makedirs(OUT, exist_ok=True)
MAX_TRIS = 18000
ZONE_ANGLE, ZONE_HALF = 90.0, 18.0 # zone 1 sector (degrees)
BAKE_SIZE = 1024
dg = bpy.context.evaluated_depsgraph_get()
export_coll = bpy.data.collections.new("RobloxExport")
bpy.context.scene.collection.children.link(export_coll)
manifest = []
def obj_center(o):
cs = [o.matrix_world @ Vector(c) for c in o.bound_box]
return sum(cs, Vector()) / 8
def in_zone1(o):
c = obj_center(o)
a = math.degrees(math.atan2(c.y, c.x))
return abs(((a - ZONE_ANGLE + 180) % 360) - 180) <= ZONE_HALF
def collect_bm(objs, keep_uv=False, mat_filter=None, drop_modifiers=()):
"""Evaluated, world-space geometry of objs joined into one bmesh (optionally only faces of one material)."""
bm = bmesh.new()
for o in objs:
saved = []
for m in o.modifiers:
if m.type in drop_modifiers and m.show_render:
m.show_viewport = False; saved.append(m)
dg2 = bpy.context.evaluated_depsgraph_get(); dg2.update()
ev = o.evaluated_get(dg2)
me = bpy.data.meshes.new_from_object(ev)
for m in saved:
m.show_viewport = True
me.transform(o.matrix_world)
if mat_filter is not None:
tmp = bmesh.new(); tmp.from_mesh(me)
names = [s.material.name if s.material else "" for s in o.material_slots] or [""]
bmesh.ops.delete(tmp, geom=[f for f in tmp.faces if names[min(f.material_index, len(names) - 1)] != mat_filter],
context="FACES")
tmp.to_mesh(me); tmp.free()
bm.from_mesh(me)
bpy.data.meshes.remove(me)
return bm
def finish(name, bm, info):
"""bmesh -> object, decimate to MAX_TRIS, re-centre, register in the manifest (export later)."""
bmesh.ops.triangulate(bm, faces=bm.faces[:])
me = bpy.data.meshes.new(name)
bm.to_mesh(me); bm.free()
ob = bpy.data.objects.new(name, me)
export_coll.objects.link(ob)
tris = len(me.polygons)
if tris > MAX_TRIS:
dec = ob.modifiers.new("Dec", "DECIMATE"); dec.ratio = MAX_TRIS / tris * 0.97
d2 = bpy.context.evaluated_depsgraph_get(); d2.update()
nm = bpy.data.meshes.new_from_object(ob.evaluated_get(d2))
ob.modifiers.clear(); ob.data = nm; bpy.data.meshes.remove(me); me = nm
cs = [v.co for v in me.vertices]
lo = Vector((min(c.x for c in cs), min(c.y for c in cs), min(c.z for c in cs)))
hi = Vector((max(c.x for c in cs), max(c.y for c in cs), max(c.z for c in cs)))
ctr = (lo + hi) / 2
me.transform(Matrix.Translation(-ctr))
for p in me.polygons:
p.use_smooth = info.pop("smooth", True)
info.update({"name": name, "center": [round(v, 4) for v in ctr], "size": [round(v, 3) for v in hi - lo],
"tris": len(me.polygons), "file": name + ".glb"})
manifest.append(info)
return ob
def base_color(mat):
if mat and mat.node_tree:
b = next((n for n in mat.node_tree.nodes if n.type == "BSDF_PRINCIPLED"), None)
if b:
c = b.inputs["Base Color"].default_value
return [round(c[0], 4), round(c[1], 4), round(c[2], 4)]
return [0.8, 0.8, 0.8]
def lin_to_srgb255(c):
f = lambda v: 12.92 * v if v <= 0.0031308 else 1.055 * v ** (1 / 2.4) - 0.055
return [max(0, min(255, round(f(v) * 255))) for v in c]
# ------------------------------------------------------------------ zone 1: fence (baked wood)
fence_src = bpy.data.objects["Zone_01_Fence"]
wood_mat = fence_src.material_slots[0].material
ob = finish("Zone_Fence", collect_bm([fence_src]), {"clone": "zones", "material": "Wood", "texture": "Zone_Fence_Wood.png",
"color": [255, 255, 255], "smooth": True})
# bake: give the mesh the original wood shader (needs its UVMap/FaceDims/FaceSeed layers) -> rebuild with UVs kept
bpy.data.objects.remove(ob, do_unlink=True); manifest.pop()
d2 = bpy.context.evaluated_depsgraph_get()
me = bpy.data.meshes.new_from_object(fence_src.evaluated_get(d2))
me.transform(fence_src.matrix_world)
fob = bpy.data.objects.new("Zone_Fence", me)
export_coll.objects.link(fob)
bake_uv = me.uv_layers.new(name="BakeUV")
for l in me.uv_layers:
l.active_render = (l.name == "UVMap")
me.uv_layers.active = bake_uv
bpy.ops.object.select_all(action="DESELECT")
fob.select_set(True); bpy.context.view_layer.objects.active = fob
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action="SELECT")
bpy.ops.uv.smart_project(angle_limit=math.radians(66), island_margin=0.004, scale_to_bounds=True)
bpy.ops.object.mode_set(mode="OBJECT")
img = bpy.data.images.new("Zone_Fence_Wood", BAKE_SIZE, BAKE_SIZE, alpha=False)
bake_mat = wood_mat.copy()
tex = bake_mat.node_tree.nodes.new("ShaderNodeTexImage"); tex.image = img
bake_mat.node_tree.nodes.active = tex
me.materials.clear(); me.materials.append(bake_mat)
sc = bpy.context.scene
sc.render.engine = "CYCLES"
sc.cycles.samples = 4
sc.cycles.device = "CPU"
sc.render.bake.use_pass_direct = False
sc.render.bake.use_pass_indirect = False
sc.render.bake.use_pass_color = True
sc.render.bake.margin = 6
bpy.ops.object.bake(type="DIFFUSE", pass_filter={"COLOR"}, use_clear=True)
img.filepath_raw = os.path.join(OUT, "Zone_Fence_Wood.png"); img.file_format = "PNG"; img.save()
# keep only the bake UV + a plain textured material for export
for l in [l for l in me.uv_layers if l.name != "BakeUV"]:
me.uv_layers.remove(l)
exp_mat = bpy.data.materials.new("Zone_Fence_Wood_Mat")
try:
exp_mat.use_nodes = True
except Exception:
pass
nt = exp_mat.node_tree
bsdf = next(n for n in nt.nodes if n.type == "BSDF_PRINCIPLED")
t2 = nt.nodes.new("ShaderNodeTexImage"); t2.image = img
nt.links.new(t2.outputs["Color"], bsdf.inputs["Base Color"])
me.materials.clear(); me.materials.append(exp_mat)
cs = [v.co for v in me.vertices]
lo = Vector((min(c.x for c in cs), min(c.y for c in cs), min(c.z for c in cs)))
hi = Vector((max(c.x for c in cs), max(c.y for c in cs), max(c.z for c in cs)))
ctr = (lo + hi) / 2
me.transform(Matrix.Translation(-ctr))
manifest.append({"name": "Zone_Fence", "clone": "zones", "material": "Wood", "texture": "Zone_Fence_Wood.png",
"color": [255, 255, 255], "center": [round(v, 4) for v in ctr], "size": [round(v, 3) for v in hi - lo],
"tris": sum(len(p.vertices) - 2 for p in me.polygons), "file": "Zone_Fence.glb"})
# ------------------------------------------------------------------ zone 1: lights (wire + glowing bulbs), snow
lights_src = bpy.data.objects["Zone_01_Lights"]
lmats = [s.material.name for s in lights_src.material_slots if s.material]
for mname in lmats:
glow = "bulb" in mname.lower()
finish("Zone_" + mname, collect_bm([lights_src], mat_filter=mname, drop_modifiers=("BEVEL",)),
{"clone": "zones", "material": "Neon" if glow else "SmoothPlastic",
"color": lin_to_srgb255(base_color(bpy.data.materials[mname])), "glow": glow})
snow_objs = [o for o in bpy.data.objects if o.type == "MESH" and o.users_collection
and o.users_collection[0].name in ("Snow_Draped_Reference", "Snow_Organic_Domes") and in_zone1(o)]
finish("Zone_FenceSnow", collect_bm(snow_objs), {"clone": "zones", "material": "Snow", "color": [248, 251, 255],
"count_src": len(snow_objs)})
# ------------------------------------------------------------------ plaza benches + lanterns, merged per material
plaza = [o for o in bpy.data.objects if o.type in ("MESH", "CURVE") and o.users_collection
and o.users_collection[0].name in ("Plaza_Benches_And_Lanterns", "Refined_Bench_Details")]
by_mat = {}
for o in plaza:
for s in o.material_slots:
if s.material:
by_mat.setdefault(s.material.name, set()).add(o)
RB = {"Bench_Warm_Wood": "Wood", "Lantern_Dark_Bronze": "Metal", "Lantern_Warm_Glass": "Neon",
"Festive_Ribbon": "SmoothPlastic", "Snow_Full_Soft": "Snow", "Snow_Soft": "Snow"}
for mname, objs in by_mat.items():
objs = sorted(objs, key=lambda o: o.name)
halves = [objs]
probe = collect_bm(objs, mat_filter=mname); n = len(probe.faces) * 2; probe.free()
if n > MAX_TRIS:
k = math.ceil(n / MAX_TRIS)
halves = [objs[i::k] for i in range(k)]
for hi_, part in enumerate(halves):
finish("Plaza_%s_%d" % (mname, hi_), collect_bm(part, mat_filter=mname),
{"clone": None, "material": RB.get(mname, "SmoothPlastic"),
"color": lin_to_srgb255(base_color(bpy.data.materials[mname])),
"glow": RB.get(mname) == "Neon"})
# lantern light positions (for PointLights in Studio)
lamps = [[round(v, 3) for v in obj_center(o)] for o in bpy.data.objects if o.name.startswith("Warm_Lantern")]
# ------------------------------------------------------------------ export each mesh as its own GLB
for info in manifest:
o = bpy.data.objects[info["name"]]
bpy.ops.object.select_all(action="DESELECT")
o.select_set(True); bpy.context.view_layer.objects.active = o
bpy.ops.export_scene.gltf(filepath=os.path.join(OUT, info["file"]), export_format="GLB",
use_selection=True, export_yup=True, export_apply=True)
json.dump({"zone_angle_deg": ZONE_ANGLE, "zone_count": 10, "parts": manifest, "lantern_lights": lamps},
open(os.path.join(OUT, "manifest.json"), "w"), indent=1)
for m in manifest:
print("PART", m["name"], m["tris"], m["material"], m["color"], m.get("clone"))
print("LAMPS", len(lamps))
+58
View File
@@ -0,0 +1,58 @@
# Assets so the zone name signs match the fence: one baked board face of Fence_Warm_Cedar_Subtle
# (vertical + horizontal grain) and two of the fence's snow pieces (post cap, rail snow).
# Run: blender -b map_refined_benches.blend --python export_sign_assets.py
import bpy, bmesh, os
from mathutils import Vector, Matrix
OUT = os.path.join(os.path.dirname(bpy.data.filepath), "roblox", "sign")
os.makedirs(OUT, exist_ok=True)
sc = bpy.context.scene
sc.render.engine = "CYCLES"; sc.cycles.samples = 4; sc.cycles.device = "CPU"
sc.render.bake.use_pass_direct = False; sc.render.bake.use_pass_indirect = False
sc.render.bake.use_pass_color = True; sc.render.bake.margin = 4
wood = bpy.data.materials["Fence_Warm_Cedar_Subtle"]
def bake_face(name, w, h, rotate):
"""Plane whose UVMap is 0..1 (like each fence face). rotate=True turns the grain 90 degrees."""
bm = bmesh.new()
vs = [bm.verts.new(v) for v in ((0, 0, 0), (1, 0, 0), (1, 1, 0), (0, 1, 0))]
f = bm.faces.new(vs)
uvl = bm.loops.layers.uv.new("UVMap")
bake = bm.loops.layers.uv.new("BakeUV")
for lp, (x, y) in zip(f.loops, ((0, 0), (1, 0), (1, 1), (0, 1))):
lp[uvl].uv = (y, x) if rotate else (x, y)
lp[bake].uv = (x, y)
me = bpy.data.meshes.new(name); bm.to_mesh(me); bm.free()
me.uv_layers["UVMap"].active_render = True
me.uv_layers.active = me.uv_layers["BakeUV"]
ob = bpy.data.objects.new(name, me); sc.collection.objects.link(ob)
img = bpy.data.images.new(name, w, h, alpha=False)
mat = wood.copy(); me.materials.append(mat)
tex = mat.node_tree.nodes.new("ShaderNodeTexImage"); tex.image = img; mat.node_tree.nodes.active = tex
bpy.ops.object.select_all(action="DESELECT"); ob.select_set(True); bpy.context.view_layer.objects.active = ob
bpy.ops.object.bake(type="DIFFUSE", pass_filter={"COLOR"}, use_clear=True)
img.filepath_raw = os.path.join(OUT, name + ".png"); img.file_format = "PNG"; img.save()
bake_face("SignWood_Vertical", 256, 1024, rotate=False) # grain runs along image height (posts)
bake_face("SignWood_Horizontal", 1024, 256, rotate=True) # grain runs along image width (rails)
def export_piece(src_name, out_name):
src = bpy.data.objects[src_name]
dg = bpy.context.evaluated_depsgraph_get()
me = bpy.data.meshes.new_from_object(src.evaluated_get(dg))
me.transform(src.matrix_world)
cs = [v.co for v in me.vertices]
lo = Vector((min(c.x for c in cs), min(c.y for c in cs), min(c.z for c in cs)))
hi = Vector((max(c.x for c in cs), max(c.y for c in cs), max(c.z for c in cs)))
me.transform(Matrix.Translation(-(lo + hi) / 2))
for p in me.polygons:
p.use_smooth = True
ob = bpy.data.objects.new(out_name, me); sc.collection.objects.link(ob)
bpy.ops.object.select_all(action="DESELECT"); ob.select_set(True); bpy.context.view_layer.objects.active = ob
bpy.ops.export_scene.gltf(filepath=os.path.join(OUT, out_name + ".glb"), export_format="GLB",
use_selection=True, export_yup=True)
print("PIECE", out_name, [round(v, 3) for v in (hi - lo)], len(me.polygons))
export_piece("Snow_Drape_000", "SignSnow_PostCap")
export_piece("Snow_Soft_0036", "SignSnow_Rail")
print("DONE")
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
{"lamps": [[4.6, 10.05, 73.0], [-4.6, 10.05, 73.0], [46.63, 10.05, 56.35], [39.19, 10.05, 61.76], [70.85, 10.05, 18.18], [68.01, 10.05, 26.93], [68.01, 10.05, -26.93], [70.85, 10.05, -18.18], [39.19, 10.05, -61.76], [46.63, 10.05, -56.35], [-4.6, 10.05, -73.0], [4.6, 10.05, -73.0], [-46.63, 10.05, -56.35], [-39.19, 10.05, -61.76], [-70.85, 10.05, -18.18], [-68.01, 10.05, -26.93], [-68.01, 10.05, 26.93], [-70.85, 10.05, 18.18], [-39.19, 10.05, 61.76], [-46.63, 10.05, 56.35]], "garland": [[5.66, 4.45, 73.95], [13.93, 4.08, 74.32], [21.0, 4.45, 77.25], [20.05, 4.45, 86.02], [20.05, 4.08, 94.47], [18.12, 4.45, 101.96], [9.51, 4.08, 104.05], [1.06, 4.45, 104.05], [-7.39, 4.45, 104.05], [-15.37, 4.08, 103.22], [-21.47, 4.45, 98.95], [-20.05, 4.45, 90.24], [-19.98, 4.08, 81.82], [-17.02, 4.45, 75.15], [-9.88, 4.45, 73.95], [48.04, 4.45, 56.5], [54.96, 4.08, 51.94], [62.39, 4.45, 50.15], [66.78, 4.45, 57.81], [71.75, 4.08, 64.64], [74.59, 4.45, 71.84], [68.85, 4.08, 78.59], [62.01, 4.45, 83.56], [55.18, 4.45, 88.52], [48.24, 4.08, 92.54], [40.79, 4.45, 92.67], [36.82, 4.45, 84.79], [31.93, 4.08, 77.94], [30.4, 4.45, 70.8], [35.47, 4.45, 65.64], [72.08, 4.45, 17.47], [74.99, 4.08, 9.72], [79.95, 4.45, 3.9], [88.0, 4.45, 7.51], [96.04, 4.08, 10.12], [102.57, 4.45, 14.27], [101.9, 4.08, 23.11], [99.28, 4.45, 31.15], [96.67, 4.45, 39.19], [93.42, 4.08, 46.51], [87.47, 4.45, 51.0], [79.63, 4.45, 46.96], [71.64, 4.08, 44.28], [66.21, 4.45, 39.4], [67.28, 4.45, 32.25], [68.58, 4.45, -28.23], [66.38, 4.08, -36.22], [66.98, 4.45, -43.84], [75.61, 4.45, -45.65], [83.65, 4.08, -48.26], [91.37, 4.45, -48.74], [96.02, 4.08, -41.19], [98.63, 4.45, -33.16], [101.24, 4.45, -25.12], [102.92, 4.08, -17.28], [100.74, 4.45, -10.16], [92.02, 4.45, -8.82], [83.99, 4.08, -6.28], [76.73, 4.45, -7.04], [73.38, 4.45, -13.45], [38.89, 4.45, -63.15], [32.41, 4.08, -68.32], [28.42, 4.45, -74.84], [34.34, 4.45, -81.38], [39.31, 4.08, -88.21], [45.27, 4.45, -93.14], [53.47, 4.08, -89.77], [60.3, 4.45, -84.8], [67.14, 4.45, -79.83], [73.11, 4.08, -74.48], [75.53, 4.45, -67.43], [69.26, 4.45, -61.22], [64.26, 4.08, -54.45], [57.94, 4.45, -50.79], [51.46, 4.45, -54.02], [-5.66, 4.45, -73.95], [-13.93, 4.08, -74.32], [-21.0, 4.45, -77.25], [-20.05, 4.45, -86.02], [-20.05, 4.08, -94.47], [-18.12, 4.45, -101.96], [-9.51, 4.08, -104.05], [-1.06, 4.45, -104.05], [7.39, 4.45, -104.05], [15.37, 4.08, -103.22], [21.47, 4.45, -98.95], [20.05, 4.45, -90.24], [19.98, 4.08, -81.82], [17.02, 4.45, -75.15], [9.88, 4.45, -73.95], [-48.04, 4.45, -56.5], [-54.96, 4.08, -51.94], [-62.39, 4.45, -50.15], [-66.78, 4.45, -57.81], [-71.75, 4.08, -64.64], [-74.59, 4.45, -71.84], [-68.85, 4.08, -78.59], [-62.01, 4.45, -83.56], [-55.18, 4.45, -88.52], [-48.24, 4.08, -92.54], [-40.79, 4.45, -92.67], [-36.82, 4.45, -84.79], [-31.93, 4.08, -77.94], [-30.4, 4.45, -70.8], [-35.47, 4.45, -65.64], [-72.08, 4.45, -17.47], [-74.99, 4.08, -9.72], [-79.95, 4.45, -3.9], [-88.0, 4.45, -7.51], [-96.04, 4.08, -10.12], [-102.57, 4.45, -14.27], [-101.9, 4.08, -23.11], [-99.28, 4.45, -31.15], [-96.67, 4.45, -39.19], [-93.42, 4.08, -46.51], [-87.47, 4.45, -51.0], [-79.63, 4.45, -46.96], [-71.64, 4.08, -44.28], [-66.21, 4.45, -39.4], [-67.28, 4.45, -32.25], [-68.58, 4.45, 28.23], [-66.38, 4.08, 36.22], [-66.98, 4.45, 43.84], [-75.61, 4.45, 45.65], [-83.65, 4.08, 48.26], [-91.37, 4.45, 48.74], [-96.02, 4.08, 41.19], [-98.63, 4.45, 33.16], [-101.24, 4.45, 25.12], [-102.92, 4.08, 17.28], [-100.74, 4.45, 10.16], [-92.02, 4.45, 8.82], [-83.99, 4.08, 6.28], [-76.73, 4.45, 7.04], [-73.38, 4.45, 13.45], [-38.89, 4.45, 63.15], [-32.41, 4.08, 68.32], [-28.42, 4.45, 74.84], [-34.34, 4.45, 81.38], [-39.31, 4.08, 88.21], [-45.27, 4.45, 93.14], [-53.47, 4.08, 89.77], [-60.3, 4.45, 84.8], [-67.14, 4.45, 79.83], [-73.11, 4.08, 74.48], [-75.53, 4.45, 67.43], [-69.26, 4.45, 61.22], [-64.26, 4.08, 54.45], [-57.94, 4.45, 50.79], [-51.46, 4.45, 54.02]], "signs": [[-12.8, 7.41, 68.98], [30.19, 7.41, 63.33], [61.65, 7.41, 33.49], [69.56, 7.41, -9.14], [50.9, 7.41, -48.28], [12.8, 7.41, -68.98], [-30.19, 7.41, -63.33], [-61.65, 7.41, -33.49], [-69.56, 7.41, 9.14], [-50.9, 7.41, 48.28]], "lanterns": [[26.7, 7.5, 19.4], [26.7, 7.5, -19.4], [-10.2, 7.5, -31.38], [-33.0, 7.5, -0.0], [-10.2, 7.5, 31.38]]}
+39
View File
@@ -0,0 +1,39 @@
# Turn material_table.json into per-object Roblox styles: {object name: [RobloxMaterial, r, g, b, glow]}
import json, os
HERE = os.path.dirname(os.path.abspath(__file__))
t = json.load(open(os.path.join(HERE, "material_table.json"), encoding="utf-8"))
def roblox_material(name, info):
n = name.lower()
if info.get("emit", 0) > 0.5:
return "Neon"
if "snow" in n:
return "SmoothPlastic"
if "asphalt" in n:
return "Asphalt"
if "rock" in n or "cliff" in n:
return "Rock"
if "curb" in n or "stone" in n:
return "Slate"
if "wood" in n or "cedar" in n or "trunk" in n or "timber" in n:
return "Wood"
if "bronze" in n or "gold" in n and info.get("metal", 0) > 0.3:
return "Metal"
return "SmoothPlastic"
styles = {}
multi = 0
for obj, mats in t["objects"].items():
mats = [m for m in mats if m]
if not mats:
continue
if len(mats) > 1:
multi += 1
# one Roblox part = one material: pick the one that reads best for multi-material objects
PREF = ("Pine_Facet_1", "Candy_Red", "Snow", "Asphalt_Stylized_BlueGrey", "Light_Bulb")
m = next((p for p in PREF if p in mats), mats[0])
info = t["materials"][m]
col = info.get("emit_color", info["color"]) if info.get("emit", 0) > 0.5 else info["color"]
styles[obj] = [roblox_material(m, info), col[0], col[1], col[2], 1 if info.get("emit", 0) > 0.5 else 0, m]
json.dump(styles, open(os.path.join(HERE, "part_styles.json"), "w", encoding="utf-8"), ensure_ascii=False)
print("styles", len(styles), "multi-material objects", multi)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

+861
View File
@@ -0,0 +1,861 @@
{
"parts": [
{
"name": "Ground_Snow_C02_0",
"group": "Ground",
"material": "Snow",
"texture": "C02",
"tris": 17610,
"center": [
-40.695,
-72.158,
1.032
]
},
{
"name": "Ground_Snow_C02_1",
"group": "Ground",
"material": "Snow",
"texture": "C02",
"tris": 17610,
"center": [
76.93,
-14.825,
0.811
]
},
{
"name": "Ground_Snow_C02_2",
"group": "Ground",
"material": "Snow",
"texture": "C02",
"tris": 17610,
"center": [
-11.376,
71.742,
1.182
]
},
{
"name": "Ground_Snow_C02_3",
"group": "Ground",
"material": "Snow",
"texture": "C02",
"tris": 5870,
"center": [
-82.489,
9.441,
0.922
]
},
{
"name": "Ground_Slate_C12_0",
"group": "Ground",
"material": "Slate",
"texture": "C12",
"tris": 1790,
"center": [
0.02,
-1.1,
-12.145
]
},
{
"name": "Ground_Snow_C13_0",
"group": "Ground",
"material": "Snow",
"texture": "C13",
"tris": 17460,
"center": [
-0.941,
-1.003,
-1.674
]
},
{
"name": "Ground_Asphalt_C14_0",
"group": "Ground",
"material": "Asphalt",
"texture": "C14",
"tris": 4152,
"center": [
0.0,
0.0,
0.125
]
},
{
"name": "Ground_SmoothPlastic_C15_0",
"group": "Ground",
"material": "SmoothPlastic",
"texture": "C15",
"tris": 2160,
"center": [
-0.0,
0.0,
0.25
]
},
{
"name": "Plaza_Decor_Metal_C00_0",
"group": "Plaza_Decor",
"material": "Metal",
"texture": "C00",
"tris": 15910,
"center": [
-0.197,
0.0,
4.692
]
},
{
"name": "Plaza_Decor_Wood_C01_0",
"group": "Plaza_Decor",
"material": "Wood",
"texture": "C01",
"tris": 5640,
"center": [
-2.323,
-0.0,
2.922
]
},
{
"name": "Plaza_Decor_Snow_C02_0",
"group": "Plaza_Decor",
"material": "Snow",
"texture": "C02",
"tris": 17920,
"center": [
-0.002,
0.005,
7.699
]
},
{
"name": "Plaza_Decor_SmoothPlastic_C04_0",
"group": "Plaza_Decor",
"material": "SmoothPlastic",
"texture": "C04",
"tris": 2700,
"center": [
2.915,
0.0,
5.19
]
},
{
"name": "Plaza_Decor_SmoothPlastic_C06_0",
"group": "Plaza_Decor",
"material": "SmoothPlastic",
"texture": "C06",
"tris": 5600,
"center": [
0.0,
0.0,
3.603
]
},
{
"name": "Plaza_Decor_SmoothPlastic_C07_0",
"group": "Plaza_Decor",
"material": "SmoothPlastic",
"texture": "C07",
"tris": 6680,
"center": [
0.0,
0.0,
3.128
]
},
{
"name": "Plaza_Decor_Metal_C10_0",
"group": "Plaza_Decor",
"material": "Metal",
"texture": "C10",
"tris": 12960,
"center": [
0.0,
0.0,
1.14
]
},
{
"name": "Plaza_Decor_SmoothPlastic_C16_0",
"group": "Plaza_Decor",
"material": "SmoothPlastic",
"texture": "C16",
"tris": 1510,
"center": [
0.092,
-0.044,
7.785
]
},
{
"name": "Plaza_Decor_SmoothPlastic_C17_0",
"group": "Plaza_Decor",
"material": "SmoothPlastic",
"texture": "C17",
"tris": 1610,
"center": [
0.092,
-0.044,
7.785
]
},
{
"name": "Plaza_Decor_SmoothPlastic_C18_0",
"group": "Plaza_Decor",
"material": "SmoothPlastic",
"texture": "C18",
"tris": 1580,
"center": [
0.092,
-0.044,
7.785
]
},
{
"name": "Plaza_Decor_Wood_C19_0",
"group": "Plaza_Decor",
"material": "Wood",
"texture": "C19",
"tris": 360,
"center": [
0.0,
0.0,
1.6
]
},
{
"name": "Plaza_Decor_Neon_C21_0",
"group": "Plaza_Decor",
"material": "Neon",
"texture": "C21",
"tris": 540,
"center": [
3.074,
0.0,
7.5
]
},
{
"name": "Plaza_Decor_SmoothPlastic_C22_0",
"group": "Plaza_Decor",
"material": "SmoothPlastic",
"texture": "C22",
"tris": 1080,
"center": [
0.0,
0.0,
0.775
]
},
{
"name": "Plaza_Decor_SmoothPlastic_C23_0",
"group": "Plaza_Decor",
"material": "SmoothPlastic",
"texture": "C23",
"tris": 1080,
"center": [
0.0,
0.0,
0.65
]
},
{
"name": "Zones_North_Snow_C02_0",
"group": "Zones_North",
"material": "Snow",
"texture": "C02",
"tris": 17968,
"center": [
80.324,
35.211,
5.996
]
},
{
"name": "Zones_North_Snow_C02_1",
"group": "Zones_North",
"material": "Snow",
"texture": "C02",
"tris": 17952,
"center": [
40.061,
75.841,
5.997
]
},
{
"name": "Zones_North_Snow_C02_2",
"group": "Zones_North",
"material": "Snow",
"texture": "C02",
"tris": 17632,
"center": [
-34.008,
79.574,
5.996
]
},
{
"name": "Zones_North_Snow_C02_3",
"group": "Zones_North",
"material": "Snow",
"texture": "C02",
"tris": 17632,
"center": [
-77.772,
41.112,
5.997
]
},
{
"name": "Zones_North_Snow_C02_4",
"group": "Zones_North",
"material": "Snow",
"texture": "C02",
"tris": 1296,
"center": [
-82.19,
5.342,
4.727
]
},
{
"name": "Zones_North_Metal_C03_0",
"group": "Zones_North",
"material": "Metal",
"texture": "C03",
"tris": 2900,
"center": [
3.955,
36.84,
7.776
]
},
{
"name": "Zones_North_SmoothPlastic_C05_0",
"group": "Zones_North",
"material": "SmoothPlastic",
"texture": "C05",
"tris": 2360,
"center": [
3.955,
36.589,
9.167
]
},
{
"name": "Zones_North_SmoothPlastic_C08_0",
"group": "Zones_North",
"material": "SmoothPlastic",
"texture": "C08",
"tris": 11880,
"center": [
3.955,
36.709,
8.043
]
},
{
"name": "Zones_North_Neon_C09_0",
"group": "Zones_North",
"material": "Neon",
"texture": "C09",
"tris": 1980,
"center": [
3.955,
36.559,
7.408
]
},
{
"name": "Zones_North_SmoothPlastic_C11_0",
"group": "Zones_North",
"material": "SmoothPlastic",
"texture": "C11",
"tris": 2160,
"center": [
3.955,
36.972,
7.392
]
},
{
"name": "Zones_North_Wood_C20_0",
"group": "Zones_North",
"material": "Wood",
"texture": "C20",
"tris": 15644,
"center": [
75.2,
27.976,
4.435
]
},
{
"name": "Zones_North_Wood_C20_1",
"group": "Zones_North",
"material": "Wood",
"texture": "C20",
"tris": 14140,
"center": [
41.331,
72.025,
4.435
]
},
{
"name": "Zones_North_Wood_C20_2",
"group": "Zones_North",
"material": "Wood",
"texture": "C20",
"tris": 14140,
"center": [
-7.264,
82.622,
4.435
]
},
{
"name": "Zones_North_Wood_C20_3",
"group": "Zones_North",
"material": "Wood",
"texture": "C20",
"tris": 14140,
"center": [
-52.519,
61.164,
4.435
]
},
{
"name": "Zones_North_Wood_C20_4",
"group": "Zones_North",
"material": "Wood",
"texture": "C20",
"tris": 12636,
"center": [
-84.462,
27.345,
4.0
]
},
{
"name": "Zones_North_Neon_C24_0",
"group": "Zones_North",
"material": "Neon",
"texture": "C24",
"tris": 10730,
"center": [
-0.011,
54.901,
7.305
]
},
{
"name": "Zones_North_Neon_C25_0",
"group": "Zones_North",
"material": "Neon",
"texture": "C25",
"tris": 7040,
"center": [
-0.001,
55.051,
4.18
]
},
{
"name": "Zones_North_SmoothPlastic_C26_0",
"group": "Zones_North",
"material": "SmoothPlastic",
"texture": "C26",
"tris": 14904,
"center": [
14.121,
54.756,
7.029
]
},
{
"name": "Zones_North_SmoothPlastic_C26_1",
"group": "Zones_North",
"material": "SmoothPlastic",
"texture": "C26",
"tris": 3726,
"center": [
-84.413,
27.323,
7.024
]
},
{
"name": "Zones_South_Snow_C02_0",
"group": "Zones_South",
"material": "Snow",
"texture": "C02",
"tris": 17968,
"center": [
-80.326,
-35.21,
5.997
]
},
{
"name": "Zones_South_Snow_C02_1",
"group": "Zones_South",
"material": "Snow",
"texture": "C02",
"tris": 17952,
"center": [
-40.055,
-75.762,
5.996
]
},
{
"name": "Zones_South_Snow_C02_2",
"group": "Zones_South",
"material": "Snow",
"texture": "C02",
"tris": 17632,
"center": [
33.998,
-79.576,
5.996
]
},
{
"name": "Zones_South_Snow_C02_3",
"group": "Zones_South",
"material": "Snow",
"texture": "C02",
"tris": 17632,
"center": [
77.778,
-41.111,
5.996
]
},
{
"name": "Zones_South_Snow_C02_4",
"group": "Zones_South",
"material": "Snow",
"texture": "C02",
"tris": 1296,
"center": [
82.249,
-5.343,
4.73
]
},
{
"name": "Zones_South_Metal_C03_0",
"group": "Zones_South",
"material": "Metal",
"texture": "C03",
"tris": 2900,
"center": [
-3.955,
-36.84,
7.776
]
},
{
"name": "Zones_South_SmoothPlastic_C05_0",
"group": "Zones_South",
"material": "SmoothPlastic",
"texture": "C05",
"tris": 2360,
"center": [
-3.955,
-36.589,
9.167
]
},
{
"name": "Zones_South_SmoothPlastic_C08_0",
"group": "Zones_South",
"material": "SmoothPlastic",
"texture": "C08",
"tris": 11880,
"center": [
-3.955,
-36.709,
8.043
]
},
{
"name": "Zones_South_Neon_C09_0",
"group": "Zones_South",
"material": "Neon",
"texture": "C09",
"tris": 1980,
"center": [
-3.955,
-36.559,
7.408
]
},
{
"name": "Zones_South_SmoothPlastic_C11_0",
"group": "Zones_South",
"material": "SmoothPlastic",
"texture": "C11",
"tris": 2160,
"center": [
-3.955,
-36.972,
7.392
]
},
{
"name": "Zones_South_Wood_C20_0",
"group": "Zones_South",
"material": "Wood",
"texture": "C20",
"tris": 15644,
"center": [
-75.2,
-27.976,
4.435
]
},
{
"name": "Zones_South_Wood_C20_1",
"group": "Zones_South",
"material": "Wood",
"texture": "C20",
"tris": 14140,
"center": [
-41.331,
-72.025,
4.435
]
},
{
"name": "Zones_South_Wood_C20_2",
"group": "Zones_South",
"material": "Wood",
"texture": "C20",
"tris": 14140,
"center": [
7.264,
-82.622,
4.435
]
},
{
"name": "Zones_South_Wood_C20_3",
"group": "Zones_South",
"material": "Wood",
"texture": "C20",
"tris": 14140,
"center": [
52.519,
-61.164,
4.435
]
},
{
"name": "Zones_South_Wood_C20_4",
"group": "Zones_South",
"material": "Wood",
"texture": "C20",
"tris": 12636,
"center": [
84.462,
-27.345,
4.0
]
},
{
"name": "Zones_South_Neon_C24_0",
"group": "Zones_South",
"material": "Neon",
"texture": "C24",
"tris": 10730,
"center": [
0.022,
-54.9,
7.305
]
},
{
"name": "Zones_South_Neon_C25_0",
"group": "Zones_South",
"material": "Neon",
"texture": "C25",
"tris": 7040,
"center": [
0.021,
-55.053,
4.18
]
},
{
"name": "Zones_South_SmoothPlastic_C26_0",
"group": "Zones_South",
"material": "SmoothPlastic",
"texture": "C26",
"tris": 14904,
"center": [
-14.121,
-54.756,
7.029
]
},
{
"name": "Zones_South_SmoothPlastic_C26_1",
"group": "Zones_South",
"material": "SmoothPlastic",
"texture": "C26",
"tris": 3726,
"center": [
84.413,
-27.323,
7.024
]
}
],
"palette": [
[
0.045,
0.034,
0.027
],
[
0.32,
0.115,
0.04
],
[
0.88,
0.94,
1.0
],
[
0.85,
0.43,
0.035
],
[
0.65,
0.018,
0.025
],
[
0.65,
0.012,
0.025
],
[
0.95,
0.97,
1.0
],
[
0.7,
0.015,
0.025
],
[
0.035,
0.19,
0.025
],
[
1.0,
0.65,
0.18
],
[
0.95,
0.54,
0.04
],
[
0.012,
0.105,
0.075
],
[
0.2535,
0.2681,
0.3462
],
[
0.8337,
0.8739,
0.9387
],
[
0.1239,
0.1603,
0.2016
],
[
0.15,
0.14,
0.16
],
[
0.11,
0.32,
0.035
],
[
0.15,
0.4,
0.05
],
[
0.2,
0.46,
0.065
],
[
0.22,
0.09,
0.035
],
[
0.2909,
0.1156,
0.0653
],
[
1.0,
0.6,
0.15
],
[
0.035,
0.22,
0.075
],
[
0.04,
0.35,
0.6
],
[
1.0,
0.72,
0.3
],
[
1.0,
0.5,
0.12
],
[
0.03,
0.04,
0.03
]
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 KiB

File diff suppressed because it is too large. Load diff
+66
View File
@@ -0,0 +1,66 @@
# Dump object -> materials and a representative colour per material from the open .blend.
# Run: blender -b map_reference_pines.blend --python material_table.py
import bpy, json, os, re
def srgb(c):
f = lambda v: 12.92 * v if v <= 0.0031308 else 1.055 * max(v, 0) ** (1 / 2.4) - 0.055
return [max(0, min(255, round(f(v) * 255))) for v in c[:3]]
def mat_info(m):
info = {"color": srgb(m.diffuse_color), "emit": 0.0, "metal": 0.0, "rough": 0.5, "alpha": 1.0, "src": "viewport"}
if not m.node_tree:
return info
b = next((n for n in m.node_tree.nodes if n.type == "BSDF_PRINCIPLED"), None)
em = next((n for n in m.node_tree.nodes if n.type == "EMISSION"), None)
if b:
bc = b.inputs["Base Color"]
if bc.is_linked:
src = bc.links[0].from_node
# walk back to a colour ramp / RGB / mix and average its colours
stack, seen = [src], set()
cols = []
while stack:
n = stack.pop()
if n.name in seen:
continue
seen.add(n.name)
if n.type == "VALTORGB":
cols += [list(e.color[:3]) for e in n.color_ramp.elements]
elif n.type == "RGB":
cols.append(list(n.outputs[0].default_value[:3]))
elif n.type in ("MIX", "MIX_RGB"):
for i in n.inputs:
if i.type == "RGBA" and not i.is_linked:
cols.append(list(i.default_value[:3]))
for i in n.inputs:
if i.is_linked:
stack.append(i.links[0].from_node)
if cols:
avg = [sum(c[k] for c in cols) / len(cols) for k in range(3)]
info["color"] = srgb(avg); info["src"] = "ramp"
else:
info["color"] = srgb(bc.default_value); info["src"] = "bsdf"
info["metal"] = round(b.inputs["Metallic"].default_value, 2)
info["rough"] = round(b.inputs["Roughness"].default_value, 2) if not b.inputs["Roughness"].is_linked else 0.5
info["alpha"] = round(b.inputs["Alpha"].default_value, 2)
es = b.inputs.get("Emission Strength")
if es is not None and (es.default_value > 0.5 or es.is_linked):
info["emit"] = round(es.default_value, 2)
ec = b.inputs["Emission Color"]
if not ec.is_linked and info["emit"] > 0.5:
info["emit_color"] = srgb(ec.default_value)
if em and em.outputs[0].is_linked:
info["emit"] = max(info["emit"], round(em.inputs["Strength"].default_value, 2))
info["emit_color"] = srgb(em.inputs["Color"].default_value)
return info
objs = {}
for o in bpy.data.objects:
if o.type in ("MESH", "CURVE", "FONT"):
objs[o.name] = [s.material.name if s.material else "" for s in o.material_slots]
mats = {m.name: mat_info(m) for m in bpy.data.materials if m.users}
out = os.path.join(os.path.dirname(bpy.data.filepath), "roblox", "material_table.json")
json.dump({"objects": objs, "materials": mats}, open(out, "w", encoding="utf-8"), ensure_ascii=False, indent=1)
print("TABLE", len(objs), "objects", len(mats), "materials")
for k, v in sorted(mats.items()):
print("MAT", k, v)
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 881 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
+286
View File
@@ -0,0 +1,286 @@
{
"zone_angle_deg": 90.0,
"zone_count": 10,
"parts": [
{
"name": "Zone_Fence",
"clone": "zones",
"material": "Wood",
"texture": "Zone_Fence_Wood.png",
"color": [
255,
255,
255
],
"center": [
0.0,
88.8832,
4.0
],
"size": [
44.367,
34.516,
8.0
],
"tris": 12636,
"file": "Zone_Fence.glb"
},
{
"clone": "zones",
"material": "SmoothPlastic",
"color": [
48,
56,
48
],
"glow": false,
"name": "Zone_Light_Wire",
"center": [
0.0,
89.0,
7.0276
],
"size": [
43.99,
33.99,
5.145
],
"tris": 2904,
"file": "Zone_Light_Wire.glb"
},
{
"clone": "zones",
"material": "Neon",
"color": [
255,
221,
149
],
"glow": true,
"name": "Zone_Light_Bulb",
"center": [
0.0,
89.0,
7.3215
],
"size": [
44.357,
34.38,
7.131
],
"tris": 9760,
"file": "Zone_Light_Bulb.glb"
},
{
"clone": "zones",
"material": "Neon",
"color": [
255,
188,
97
],
"glow": true,
"name": "Zone_Light_Bulb_Gold",
"center": [
0.0,
89.0,
4.1805
],
"size": [
44.357,
34.38,
0.648
],
"tris": 6400,
"file": "Zone_Light_Bulb_Gold.glb"
},
{
"clone": "zones",
"material": "Snow",
"color": [
248,
251,
255
],
"count_src": 61,
"name": "Zone_FenceSnow",
"center": [
-0.0068,
88.9149,
5.7295
],
"size": [
44.945,
34.874,
6.619
],
"tris": 17460,
"file": "Zone_FenceSnow.glb"
},
{
"clone": null,
"material": "Metal",
"color": [
60,
52,
46
],
"glow": false,
"name": "Plaza_Lantern_Dark_Bronze_0",
"center": [
-0.3467,
-0.6184,
4.6921
],
"size": [
67.993,
65.814,
8.456
],
"tris": 10122,
"file": "Plaza_Lantern_Dark_Bronze_0.glb"
},
{
"clone": null,
"material": "Metal",
"color": [
60,
52,
46
],
"glow": false,
"name": "Plaza_Lantern_Dark_Bronze_1",
"center": [
-0.1967,
0.1392,
4.6921
],
"size": [
68.293,
66.772,
8.456
],
"tris": 10108,
"file": "Plaza_Lantern_Dark_Bronze_1.glb"
},
{
"clone": null,
"material": "Wood",
"color": [
153,
95,
56
],
"glow": false,
"name": "Plaza_Bench_Warm_Wood_0",
"center": [
-2.3225,
-0.0,
2.9224
],
"size": [
63.997,
67.28,
1.925
],
"tris": 8340,
"file": "Plaza_Bench_Warm_Wood_0.glb"
},
{
"clone": null,
"material": "Snow",
"color": [
241,
248,
255
],
"glow": false,
"name": "Plaza_Snow_Full_Soft_0",
"center": [
-2.449,
-0.0012,
3.93
],
"size": [
64.166,
67.129,
0.48
],
"tris": 4940,
"file": "Plaza_Snow_Full_Soft_0.glb"
},
{
"clone": null,
"material": "SmoothPlastic",
"color": [
211,
36,
44
],
"glow": false,
"name": "Plaza_Festive_Ribbon_0",
"center": [
2.9151,
0.0,
5.1904
],
"size": [
59.95,
63.025,
1.145
],
"tris": 2700,
"file": "Plaza_Festive_Ribbon_0.glb"
},
{
"clone": null,
"material": "Neon",
"color": [
255,
203,
108
],
"glow": true,
"name": "Plaza_Lantern_Warm_Glass_0",
"center": [
3.0742,
0.0,
7.5
],
"size": [
60.752,
63.867,
1.2
],
"tris": 540,
"file": "Plaza_Lantern_Warm_Glass_0.glb"
}
],
"lantern_lights": [
[
-26.698,
19.397,
7.5
],
[
-26.698,
-19.397,
7.5
],
[
10.198,
-31.385,
7.5
],
[
33.0,
-0.0,
7.5
],
[
10.198,
31.385,
7.5
]
]
}
+1
View File
@@ -0,0 +1 @@
{"Armrest": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.001": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.002": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.003": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.004": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.005": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.006": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.007": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.008": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Armrest.009": ["Metal", 60, 52, 46, 0, "Lantern_Dark_Bronze"], "Asphalt_Snowbank": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.001": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.002": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.003": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.004": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.005": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.006": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.007": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.008": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.009": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.010": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.011": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.012": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.013": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.014": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.015": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.016": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.017": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.018": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.019": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.020": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.021": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.022": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.023": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.024": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.025": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.026": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.027": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.028": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.029": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.030": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.031": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.032": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.033": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.034": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.035": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.036": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.037": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.038": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.039": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.040": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.041": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.042": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.043": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.044": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.045": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.046": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.047": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.048": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.049": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.050": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.051": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.052": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.053": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.054": ["SmoothPlastic", 241, 248, 255, 0, "Snow_Full_Soft"], "Asphalt_Snowbank.055Line truncated
+68
View File
@@ -0,0 +1,68 @@
# Sample the island ground of map_refined_benches.blend into a column grid for Roblox Terrain.
# Run: blender -b map_refined_benches.blend --python sample_terrain.py
# Output: terrain_columns.json (Blender units == studs; Blender Z-up -> Roblox Y-up handled in Luau)
import bpy, json, os
from mathutils import Vector
from mathutils.bvhtree import BVHTree
OUT = os.path.join(os.path.dirname(bpy.data.filepath), "roblox", "terrain_columns.json")
CELL = 4.0
GROUND_COLLS = {"Terrain", "Landscape_Snowdrifts", "Asphalt_Edge_Snowdrifts", "Continuous_Curb_Snow"}
dg = bpy.context.evaluated_depsgraph_get()
trees = [] # (bvh, per-face material name list, object name)
lo = Vector((1e9, 1e9, 1e9)); hi = -lo
for o in bpy.data.objects:
if o.type != "MESH" or not ({c.name for c in o.users_collection} & GROUND_COLLS):
continue
ev = o.evaluated_get(dg)
me = ev.to_mesh()
me.transform(o.matrix_world)
verts = [v.co.copy() for v in me.vertices]
polys = [tuple(p.vertices) for p in me.polygons]
mats = [(o.material_slots[p.material_index].material.name
if o.material_slots and o.material_slots[p.material_index].material else "") for p in me.polygons]
ev.to_mesh_clear()
trees.append((BVHTree.FromPolygons(verts, polys), mats, o.name))
for v in verts:
lo = Vector(map(min, lo, v)); hi = Vector(map(max, hi, v))
def code_for(obj, mat):
m = mat.lower(); n = obj.lower()
if "rock" in m or "cliff" in m:
return "R"
if "curb" in m or "curb" in n and "snow" not in m:
return "C"
if "asphalt" in m:
return "A"
if "tile" in m or "path" in m or "plaza" in n:
return "P"
return "S" # snow (ground, drifts)
x0 = (int(lo.x // CELL) - 1) * CELL
y0 = (int(lo.y // CELL) - 1) * CELL
nx = int((hi.x - x0) // CELL) + 2
ny = int((hi.y - y0) // CELL) + 2
top, bot, mat = [], [], []
for j in range(ny):
for i in range(nx):
x = x0 + (i + 0.5) * CELL
y = y0 + (j + 0.5) * CELL
best_t, best_c = None, "."
best_b = None
for bvh, mats, name in trees:
hit = bvh.ray_cast(Vector((x, y, hi.z + 10)), Vector((0, 0, -1)))
if hit[0] is not None and (best_t is None or hit[0].z > best_t):
best_t = hit[0].z
best_c = code_for(name, mats[hit[2]])
hb = bvh.ray_cast(Vector((x, y, lo.z - 10)), Vector((0, 0, 1)))
if hb[0] is not None and (best_b is None or hb[0].z < best_b):
best_b = hb[0].z
top.append(round(best_t, 2) if best_t is not None else None)
bot.append(round(best_b, 2) if best_b is not None else None)
mat.append(best_c)
os.makedirs(os.path.dirname(OUT), exist_ok=True)
json.dump({"cell": CELL, "x0": x0, "y0": y0, "nx": nx, "ny": ny, "top": top, "bot": bot, "mat": "".join(mat),
"zmin": lo.z, "zmax": hi.z}, open(OUT, "w"))
from collections import Counter
print("SAMPLED", nx, ny, dict(Counter(mat)), round(lo.z, 1), round(hi.z, 1))
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

+51
View File
@@ -0,0 +1,51 @@
# Split every object that uses several materials into one object per material, so Roblox (one
# material per MeshPart) keeps candy stripes, pine facet shades, wire vs bulbs, snow vs cliff.
# Saves a NEW file next to the source and exports FBX + GLB for Roblox.
# Run: blender -b map_reference_pines.blend --python split_by_material.py
import bpy, os
src = bpy.data.filepath
base = os.path.splitext(src)[0] + "_split"
def material_names(o):
return [s.material.name for s in o.material_slots if s.material]
targets = [o for o in bpy.data.objects if o.type == "MESH" and len(set(material_names(o))) > 1]
made = 0
for o in targets:
orig_name = o.name
before = set(bpy.data.objects)
bpy.ops.object.mode_set(mode="OBJECT") if bpy.context.object and bpy.context.object.mode != "OBJECT" else None
bpy.ops.object.select_all(action="DESELECT")
o.select_set(True)
bpy.context.view_layer.objects.active = o
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.select_all(action="SELECT")
bpy.ops.mesh.separate(type="MATERIAL")
bpy.ops.object.mode_set(mode="OBJECT")
pieces = [o] + [x for x in set(bpy.data.objects) - before]
for p in pieces:
# each piece now only has faces of one material; drop unused slots and name it after that material
used = {f.material_index for f in p.data.polygons}
mats = [p.material_slots[i].material for i in sorted(used) if i < len(p.material_slots)]
mname = mats[0].name if mats else "None"
p.data.materials.clear()
for f in p.data.polygons:
f.material_index = 0
if mats:
p.data.materials.append(mats[0])
p.name = "%s__%s" % (orig_name, mname)
made += 1
bpy.ops.wm.save_as_mainfile(filepath=base + ".blend", copy=True)
bpy.ops.object.select_all(action="DESELECT")
export_objs = [o for o in bpy.data.objects if o.type in ("MESH", "CURVE", "FONT") and o.visible_get()]
for o in export_objs:
o.select_set(True)
bpy.ops.export_scene.fbx(filepath=base + ".fbx", use_selection=True, object_types={"MESH", "OTHER"},
apply_unit_scale=True, apply_scale_options="FBX_SCALE_ALL", use_mesh_modifiers=True,
mesh_smooth_type="FACE", path_mode="AUTO")
bpy.ops.export_scene.gltf(filepath=base + ".glb", export_format="GLB", use_selection=True,
export_yup=True, export_apply=True)
print("SPLIT objects:", len(targets), "-> pieces:", made, "| exported", len(export_objs), "objects")
print("FILES", base + ".blend", base + ".fbx", base + ".glb")
+1
View File
@@ -0,0 +1 @@
{"cell": 4.0, "x0": -144.0, "y0": -144.0, "nx": 72, "ny": 72, "top": [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, -1.49, -1.42, -1.0, -0.05, 0.28, 0.11, 0.51, 0.6, -0.28, -1.42, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.56, 0.56, 0.56, 0.5, 0.28, 0.09, 0.08, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.04, 0.11, 0.22, 0.47, -1.25, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.24, 0.27, 0.17, 0.17, 0.11, 0.07, 0.08, 0.09, 0.09, 0.09, 0.1, 0.11, 0.11, 0.11, 0.11, 0.1, 0.09, 0.08, 0.06, 0.16, 0.39, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.59, 0.29, 0.12, 0.22, 0.27, 0.23, 0.13, 0.12, 0.13, 0.14, 0.15, 0.15, 0.16, 0.22, 0.67, 1.0, 0.16, 0.15, 0.14, 0.13, 0.11, 0.08, 0.05, 0.13, 0.3, 0.53, -0.99, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.17, 0.24, 0.05, 0.09, 0.16, 0.24, 0.25, 0.22, 0.18, 0.17, 0.18, 0.2, 0.2, 0.33, 0.4, 0.41, 1.05, 1.43, 0.69, 0.32, 0.32, 0.22, 0.16, 0.13, 0.1, 0.09, 0.11, 0.21, 0.25, 0.5, -0.4, -5.41, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, -1.48, 0.41, 0.38, 0.16, 0.07, 0.08, 0.1, 0.17, 0.25, 0.29, 0.27, 0.23, 0.23, 0.23, 0.24, 0.32, 0.61, 0.93, 1.11, 1.1, 0.98, 0.86, 0.74, 0.72, 0.76, 0.54, 0.21, 0.17, 0.15, 0.14, 0.13, 0.31, 0.41, 0.37, 0.21, 0.5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, -0.88, 0.49, 0.25, 0.24, 0.28, 0.24, 0.18, 0.17, 0.25, 0.39, 0.49, 0.5, 0.41, 0.29, 0.29, 0.1, 0.05, 0.17, 0.7, 0.83, 0.49, 0.4, 0.36, 0.17, 0.76, 0.96, 1.02, 0.74, 0.31, 0.22, 0.21, 0.2, 0.18, 0.33, 0.52, 0.55, 0.4, 0.19, 0.35, -1.29, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.54, 0.22, 0.32, 0.48, 0.55, 0.52, 0.82, 0.33, 0.34, 0.51, 0.73, 0.84, 0.82, 0.65, 0.39, 0.26, 0.0, 0.0, -0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.82, 0.83, 0.68, 0.62, 0.28, 0.26, 0.25, 0.23, 0.29, 0.5, 0.56, 0.45, 0.28, 0.14, 0.3, -0.58, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.38, 0.11, 0.24, 0.44, 0.65, 1.1, 2.19, 1.37, 0.4, 0.46, 0.76, 1.07, 1.21, 1.04, 0.76, 0.5, 0.13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.14, 0.51, 0.46, 1.07, 0.3, 0.3, 0.3, 0.28, 0.29, 0.42, 0.43, 0.36, 0.25, 0.16, 0.13, 0.14, 0.27, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0.54, 0.05, 0.09, 0.16, 0.35, 0.58, 0.67, 1.15, 0.4, 0.26, 0.42, 0.84, 1.12, 1.16, 1.01, 0.71, 0.45, 0.25, 0.0, 0.0, 0.0, -0.0, 0.0, -0.0, 0.0, -0.0, 0.0, 0.0, 0.2, 0.32, 0.32, 0.3, 0.3, 0.3, 0.22, 0.13, 0.26, 0.38, 0.32, 0.25, 0.2, 0.15, 0.21, 0.24, 0.21, -0.64, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, -0.13, 0.06, 0.08, 0.13, 0.17, 0.25, 0.43, 0.48, 0.36, -0.0, 0.0, 0.0, 0.08, 0.77, 0.87, 0.74, 0.47, 0.31, 0.12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,Line truncated
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB