translated the remaining german notes, python comments, help and messages to english (in-game strings, parsed report lines and cli values stay german)
This commit is contained in:
1 parent
86fe26d786
commit
526f6072f6
36 files changed
+1553
-1544
No files matched your search
@@ -1,5 +1,5 @@
|
||||
# Blender 3.0 (headless): level.obj aus geom_export (v x y z r g b, vt, usemtl page_NN/flat_N) laden,
|
||||
# in Spielkoordinaten (Blender x = Spiel-x, y = -Spiel-z, z = Spiel-y) rendern.
|
||||
# Blender 3.0 (headless): load level.obj from geom_export (v x y z r g b, vt, usemtl page_NN/flat_N),
|
||||
# render in game coordinates (Blender x = game x, y = -game z, z = game y).
|
||||
# blender -b -P render_level.py -- OBJDIR OUTPREFIX [samples] [scale%]
|
||||
import bpy, sys, os, json, math
|
||||
from mathutils import Vector
|
||||
@@ -50,10 +50,10 @@ def make_mat(name, d):
|
||||
else:
|
||||
kd = d.get('kd', (1, 1, 1))
|
||||
mul.inputs[1].default_value = (*kd, 1)
|
||||
if kd[2] > 0.5 and kd[0] < 0.3: # Meer
|
||||
if kd[2] > 0.5 and kd[0] < 0.3: # sea
|
||||
bsdf.inputs['Roughness'].default_value = 0.25
|
||||
bsdf.inputs['Specular'].default_value = 0.5
|
||||
# leicht selbstleuchtend, damit die eingebackene Beleuchtung (Vertexfarben) sichtbar bleibt
|
||||
# slightly emissive so the baked lighting (vertex colours) stays visible
|
||||
Lk.new(mul.outputs[0], bsdf.inputs['Base Color'])
|
||||
Lk.new(mul.outputs[0], bsdf.inputs['Emission'])
|
||||
bsdf.inputs['Emission Strength'].default_value = 0.25
|
||||
@@ -69,7 +69,7 @@ for ln in open(os.path.join(objdir, 'level.obj')):
|
||||
if ln.startswith('v '):
|
||||
p = ln.split()
|
||||
x, y, z = float(p[1]), float(p[2]), float(p[3])
|
||||
V.append((x, z, y)) # Spiel (x, y, -z) -> Blender (x, -spiel_z, y) = (x, z_obj, y_obj)
|
||||
V.append((x, z, y)) # game (x, y, -z) -> Blender (x, -game_z, y) = (x, z_obj, y_obj)
|
||||
C.append((float(p[4]), float(p[5]), float(p[6])) if len(p) >= 7 else (1, 1, 1))
|
||||
elif ln.startswith('vt '):
|
||||
p = ln.split(); VT.append((float(p[1]), float(p[2])))
|
||||
@@ -81,7 +81,7 @@ for ln in open(os.path.join(objdir, 'level.obj')):
|
||||
q = t.split('/')
|
||||
vi.append(int(q[0]) - 1)
|
||||
ti.append(int(q[1]) - 1 if len(q) > 1 and q[1] else -1)
|
||||
faces.append((vi[::-1], ti[::-1], mat)) # Spiegelung -> Umlaufsinn umdrehen
|
||||
faces.append((vi[::-1], ti[::-1], mat)) # mirroring -> reverse winding
|
||||
|
||||
matnames = sorted(set(f[2] for f in faces))
|
||||
mesh = bpy.data.meshes.new('level')
|
||||
@@ -103,7 +103,7 @@ ob = bpy.data.objects.new('level', mesh)
|
||||
sc.collection.objects.link(ob)
|
||||
|
||||
|
||||
# --------------------------------------------------------------- Objekt-Marker (Strats aus strats.json)
|
||||
# --------------------------------------------------------------- object markers (strats from strats.json)
|
||||
def flatmat(name, rgb, emit=0.6):
|
||||
m = bpy.data.materials.new(name); m.use_nodes = True
|
||||
b = m.node_tree.nodes['Principled BSDF']
|
||||
@@ -143,7 +143,7 @@ if sj and os.path.exists(sj):
|
||||
mat = RM[r]
|
||||
o = bpy.context.active_object; o.data.materials.append(mat)
|
||||
|
||||
# --------------------------------------------------------------- Licht, Welt
|
||||
# --------------------------------------------------------------- light, world
|
||||
w = bpy.data.worlds.new('w'); sc.world = w; w.use_nodes = True
|
||||
bg = w.node_tree.nodes['Background']
|
||||
bg.inputs[0].default_value = (0.55, 0.72, 0.95, 1); bg.inputs[1].default_value = 0.9
|
||||
@@ -151,7 +151,7 @@ sun = bpy.data.lights.new('sun', 'SUN'); sun.energy = 2.6; sun.angle = math.radi
|
||||
so = bpy.data.objects.new('sun', sun); sc.collection.objects.link(so)
|
||||
so.rotation_euler = (math.radians(42), 0, math.radians(-140))
|
||||
|
||||
# Cycles liefert mit dem Debian-Blender 3.0.1 nur Schwarz -> Eevee (braucht X: eigenes Xvfb, z. B. :7)
|
||||
# Cycles renders only black with Debian Blender 3.0.1 -> Eevee (needs X: a separate Xvfb, e.g. :7)
|
||||
sc.render.engine = 'BLENDER_EEVEE'
|
||||
ee = sc.eevee
|
||||
ee.taa_render_samples = samples
|
||||
@@ -164,9 +164,9 @@ try:
|
||||
sc.view_settings.view_transform = 'Filmic'
|
||||
sc.view_settings.look = 'Medium High Contrast'
|
||||
except TypeError:
|
||||
pass # Debian-Blender ohne OCIO-Konfiguration: nur 'Standard'
|
||||
pass # Debian Blender without OCIO config: only 'Standard'
|
||||
|
||||
# Bereiche (Spielkoordinaten x, z, y) fuer die Beschriftung
|
||||
# areas (game coordinates x, z, y) for the labels; keys are the label text (German, as in the level)
|
||||
LABELS = {'Start': (18, 15.5, 2.2), 'Galerie': (23.5, 26.5, 1.2), 'Gehege': (37.5, 25.4, 1.2),
|
||||
'Parkour': (33.0, 15.5, 2.6), 'Ziel': (50.0, 15.5, 6.0)}
|
||||
|
||||
@@ -195,9 +195,9 @@ def shoot(name, loc, look, lens=35, ortho=None, res=(1600, 1000)):
|
||||
|
||||
|
||||
views = os.environ.get('VIEWS', 'schraeg,oben').split(',')
|
||||
if 'schraeg' in views: # von Suedwesten, schraeg oben
|
||||
if 'schraeg' in views: # 'schraeg' = oblique: from the south-west, above
|
||||
shoot('schraeg', (10, -50, 27), (30.5, -21.5, 0), lens=33)
|
||||
if 'schraeg2' in views: # von Nordosten (hinter dem Ziel)
|
||||
if 'schraeg2' in views: # from the north-east (behind the goal)
|
||||
shoot('schraeg2', (60, 2, 22), (29, -21, 0), lens=30)
|
||||
if 'oben' in views:
|
||||
if 'oben' in views: # 'oben' = top view
|
||||
shoot('oben', (31, -21.5, 80), (31, -21.4, 0), ortho=44)
|
||||
Reference in new issue
Block a user