Replace iron maiden with textured Meshy model and working hinged doors
@@ -1,5 +1,13 @@
|
||||
# Succubus model credits
|
||||
|
||||
## Iron maiden v01 (2026-10-28)
|
||||
|
||||
Generated using Meshy from the user-approved project concept art. Resource:
|
||||
multi-image-to-3d; task 01a1845b-d214-7150-8267-02bdbab6abd8. Game geometry,
|
||||
independent hinged doors and smooth interior prepared locally in Blender.
|
||||
Source, reference, provenance and reproduction commands:
|
||||
tools/model_sources/iron_maiden_v01/README.md. PBR textures are retained.
|
||||
|
||||
Anatomical base, morphs, skeleton and weights: MakeHuman Community, CC0.
|
||||
https://www.makehumancommunity.org/about/license.html
|
||||
https://github.com/makehumancommunity/makehuman/tree/master/makehuman/data
|
||||
|
||||
@@ -44,6 +44,10 @@ func setup(game,development):
|
||||
var n=queue.pop_back()
|
||||
for c in n.get_children():queue.append(c)
|
||||
if n is MeshInstance3D and n!=d.flame:
|
||||
if d.device.get_meta("apparatus_model","")=="iron_maiden_v01":
|
||||
var glow=ShaderMaterial.new();glow.shader=preload("res://maiden_heat.gdshader")
|
||||
n.material_overlay=glow;heat_materials.append(glow)
|
||||
continue
|
||||
var mat=ShaderMaterial.new();mat.shader=preload("res://forged.gdshader")
|
||||
if n.material_override is StandardMaterial3D:mat.set_shader_parameter("tint",n.material_override.albedo_color)
|
||||
n.material_override=mat;heat_materials.append(mat)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://c4pu3eygt6e4y"
|
||||
path="res://.godot/imported/iron_maiden.glb-becc2a15b0689d3fd809e932ed47a928.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/equipment/iron_maiden_v01/iron_maiden.glb"
|
||||
dest_files=["res://.godot/imported/iron_maiden.glb-becc2a15b0689d3fd809e932ed47a928.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=false
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=true
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/naming_version=1
|
||||
gltf/embedded_image_handling=1
|
||||
|
After Width: | Height: | Size: 15 MiB |
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dx0sqfg38ks84"
|
||||
path="res://.godot/imported/iron_maiden_Image_0.jpg-f6ee579cc3c55dbc17f6bfbca1b8dae5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "abc55db7df710ef5a99ca62f55de62bb"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/equipment/iron_maiden_v01/iron_maiden_Image_0.jpg"
|
||||
dest_files=["res://.godot/imported/iron_maiden_Image_0.jpg-f6ee579cc3c55dbc17f6bfbca1b8dae5.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 2.3 MiB |
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c7u0kec30jl02"
|
||||
path="res://.godot/imported/iron_maiden_Image_1.jpg-d51c196e2c01c86d3db2645e99535ca7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "7269fcd31a2b122b8c924eadc56822f7"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/equipment/iron_maiden_v01/iron_maiden_Image_1.jpg"
|
||||
dest_files=["res://.godot/imported/iron_maiden_Image_1.jpg-d51c196e2c01c86d3db2645e99535ca7.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 11 MiB |
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dv2tn24mj4s58"
|
||||
path="res://.godot/imported/iron_maiden_Image_2.jpg-da441b4b500293093b6aec87e40a7f71.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "97940641db71c7ef90df2e4c5be83693"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/equipment/iron_maiden_v01/iron_maiden_Image_2.jpg"
|
||||
dest_files=["res://.godot/imported/iron_maiden_Image_2.jpg-da441b4b500293093b6aec87e40a7f71.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"source_task": "01a1845b-d214-7150-8267-02bdbab6abd8",
|
||||
"resource": "multi-image-to-3d",
|
||||
"height_m": 3.1,
|
||||
"hinges_blender": {
|
||||
"LeftDoor": [
|
||||
-0.8125486969947815,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"RightDoor": [
|
||||
0.8134756684303284,
|
||||
0.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
"door_height": [
|
||||
0.25,
|
||||
2.48
|
||||
],
|
||||
"construction": "Closed source partitioned once; two front quadrants, separate smooth lining, recomputed normals.",
|
||||
"triangles": 92228
|
||||
}
|
||||
@@ -24,6 +24,9 @@ func build(game,d):
|
||||
preload("res://new_equipment.gd").new().build(g,d)
|
||||
return
|
||||
var root=d.device
|
||||
if d.selected==3:
|
||||
preload("res://iron_maiden.gd").new().build(g,d)
|
||||
return
|
||||
if d.selected==0:
|
||||
preload("res://pillory.gd").new().build(g,d)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
extends RefCounted
|
||||
# Meshy shell is split locally at the actual hinge plane, not from the open concept.
|
||||
const MODEL=preload("res://art/equipment/iron_maiden_v01/iron_maiden.glb")
|
||||
func build(g,d):
|
||||
var root=d.device
|
||||
var model=MODEL.instantiate();root.add_child(model)
|
||||
root.set_meta("apparatus_model","iron_maiden_v01")
|
||||
d.door=model.find_child("LeftDoor",true,false)
|
||||
d.second_door=model.find_child("RightDoor",true,false)
|
||||
assert(d.door!=null and d.second_door!=null,"Iron maiden requires two independent hinge nodes")
|
||||
d.door.rotation.y=-1.8;d.second_door.rotation.y=1.8
|
||||
d.flame=g.ball(root,Vector3(0,.20,0),Vector3(1.15,.25,.85),Color("ff8735"))
|
||||
d.flame.material_override=g.mat(Color("ff8735"),true);d.flame.hide()
|
||||
@@ -0,0 +1,49 @@
|
||||
extends RefCounted
|
||||
var failures=0
|
||||
func check(ok,label):
|
||||
if not ok:failures+=1;push_error("IRON MAIDEN QA: "+label)
|
||||
func shot(g,name):
|
||||
await RenderingServer.frame_post_draw
|
||||
g.get_viewport().get_texture().get_image().save_png("res://captures/iron-maiden/"+name+".png")
|
||||
func run(g):
|
||||
await g.get_tree().create_timer(.3).timeout
|
||||
g.start_game();g.set_process(false);g.reset_shift();g.game_started=true;g.paused=false
|
||||
g.hud.hide();g.menu.show_page("")
|
||||
DirAccess.make_dir_recursive_absolute("res://captures/iron-maiden")
|
||||
var w=g.workshop;var d=w.add_station(3,Vector3(3,0,0))
|
||||
check(d.device.get_meta("apparatus_model","")=="iron_maiden_v01","Meshy model selected")
|
||||
check(d.door!=d.second_door and d.door.get_child_count()>0 and d.second_door.get_child_count()>0,"independent populated doors")
|
||||
check(d.door.position.x<0 and d.second_door.position.x>0,"opposite side hinges")
|
||||
var surfaces=d.device.find_children("*","MeshInstance3D",true,false)
|
||||
var textured=0
|
||||
for mesh in surfaces:
|
||||
if mesh==d.flame:continue
|
||||
for i in range(mesh.mesh.get_surface_count()):
|
||||
var mat=mesh.mesh.surface_get_material(i)
|
||||
if mat is StandardMaterial3D and mat.albedo_texture!=null:textured+=1
|
||||
check(mesh.material_override==null,"original surface material preserved")
|
||||
check(mesh.material_overlay is ShaderMaterial,"independent heat overlay")
|
||||
check(textured>0,"Meshy textures present")
|
||||
g.camera.position=Vector3(5.8,3.5,3);g.camera.look_at(d.device.position+Vector3(0,1.5,0));g.camera.size=4.5
|
||||
await shot(g,"open")
|
||||
for k in range(19):
|
||||
d.door.rotation.y=-1.8+float(k)*.1;d.second_door.rotation.y=1.8-float(k)*.1
|
||||
check(d.door.transform.is_finite() and d.second_door.transform.is_finite(),"finite hinge sweep")
|
||||
if k==9:await shot(g,"half")
|
||||
check(absf(d.door.rotation.y)<.0001 and absf(d.second_door.rotation.y)<.0001,"both doors reach closed pose")
|
||||
await shot(g,"closed")
|
||||
# Exercise the actual station state machine and heat without replacing PBR.
|
||||
w.unlock=3;g.uid=0;w.spawn();var s=g.souls.back();s.required=[3];s.entering=false;s.entry_time=1
|
||||
g.set_soul_reveal(s.visual,1);w.attach(s,0);w.step_station(d,.9,false)
|
||||
for k in range(35):w.step_station(d,.1,true)
|
||||
check(d.stage==1,"station advances through closure into heat")
|
||||
check(d.motion.heat>0,"heat advances")
|
||||
await shot(g,"heated")
|
||||
for k in range(100):
|
||||
w.step_station(d,.1,true)
|
||||
if d.soul<0:break
|
||||
check(d.soul<0 and g.done==1,"completion releases soul and rewards once")
|
||||
for k in range(40):w.step_station(d,.1,false)
|
||||
check(is_equal_approx(d.door.rotation.y,-1.8) and is_equal_approx(d.second_door.rotation.y,1.8),"doors reopen after cooldown")
|
||||
print("IRON MAIDEN QA ","PASSED" if failures==0 else "FAILED",": textured model, hinges, sweep, close/heat/reward/reopen")
|
||||
g.get_tree().quit(1 if failures else 0)
|
||||
@@ -0,0 +1,10 @@
|
||||
shader_type spatial;
|
||||
render_mode blend_add, depth_draw_never, unshaded, shadows_disabled;
|
||||
uniform float heat=0.0;
|
||||
varying float model_height;
|
||||
void vertex(){ model_height=VERTEX.y; }
|
||||
void fragment(){
|
||||
float warmth=heat*(.35+.65*(1.0-smoothstep(0.0,2.8,model_height)));
|
||||
ALBEDO=vec3(1.0,.07,.003)*warmth*warmth*.22;
|
||||
ALPHA=heat*.45;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ var quips = ["Ещё один. Наверху сегодня скидки на
|
||||
|
||||
func _ready():
|
||||
var args=OS.get_cmdline_user_args()
|
||||
test_mode="--test-intro" in args or "--test-room-decor" in args or "--test-camera-controls" in args or "--test-rubies" in args or "--test-runtime-burn" in args or "--test-single-punishment" in args or "--test-expansion" in args or "--test-imps" in args or "--test-flight-camera" in args or "--test-maintenance" in args or "--test-castle" in args or "--test-building" in args or "--test-workflow" in args or "--test-roster" in args or "--test-priority" in args or "--test-mesh" in args or "--test-economy" in args or "--test-posture" in args or "--test-gait" in args or "--test-visuals" in args or "--test-mode" in args or "--test-exit" in args or "--test-ui" in args or "--test-audio" in args or "--test-sentences" in args or "--test-hud" in args
|
||||
test_mode="--test-iron-maiden" in args or "--test-intro" in args or "--test-room-decor" in args or "--test-camera-controls" in args or "--test-rubies" in args or "--test-runtime-burn" in args or "--test-single-punishment" in args or "--test-expansion" in args or "--test-imps" in args or "--test-flight-camera" in args or "--test-maintenance" in args or "--test-castle" in args or "--test-building" in args or "--test-workflow" in args or "--test-roster" in args or "--test-priority" in args or "--test-mesh" in args or "--test-economy" in args or "--test-posture" in args or "--test-gait" in args or "--test-visuals" in args or "--test-mode" in args or "--test-exit" in args or "--test-ui" in args or "--test-audio" in args or "--test-sentences" in args or "--test-hud" in args
|
||||
capture_mode="--capture-workflow" in args or "--capture-roster" in args or "--capture-economy" in args or "--capture-posture" in args or "--capture-gait" in args or "--capture" in args or "--capture-workshop" in args
|
||||
if FileAccess.file_exists("res://build_info.json"):
|
||||
var stamp=JSON.parse_string(FileAccess.get_file_as_string("res://build_info.json"))
|
||||
@@ -144,7 +144,8 @@ func _ready():
|
||||
say("Первый день. Последняя надежда на отпуск.")
|
||||
refresh_ui()
|
||||
if automatic: build_auto_arm()
|
||||
if "--test-intro" in args:call_deferred("run_intro_tests")
|
||||
if "--test-iron-maiden" in args:call_deferred("run_iron_maiden_tests")
|
||||
elif "--test-intro" in args:call_deferred("run_intro_tests")
|
||||
elif "--test-exit" in args: call_deferred("test_exit")
|
||||
elif "--test-audio" in args: call_deferred("run_audio_tests")
|
||||
elif "--test-ui" in args: call_deferred("run_ui_tests")
|
||||
@@ -1011,3 +1012,6 @@ func run_room_decor_tests():
|
||||
|
||||
func run_intro_tests():
|
||||
await preload("res://intro_tests.gd").new().run(self)
|
||||
|
||||
func run_iron_maiden_tests():
|
||||
await preload("res://iron_maiden_tests.gd").new().run(self)
|
||||
|
||||
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.2 MiB |
@@ -15,6 +15,29 @@
|
||||
|
||||
## Последние выполненные задачи
|
||||
|
||||
- **Железная дева Meshy v01 (2026-10-28):** по утверждённому арту создана и
|
||||
включена вместо процедурной модели. `art/equipment/iron_maiden_v01/`:
|
||||
GLB, три PBR-карты 4K, manifest и import sidecars. Высота 3,10 м, 92 228
|
||||
треугольников, отдельные Body / LeftDoor / RightDoor и гладкая внутренняя
|
||||
обшивка без шипов. Створки получены из закрытого корпуса, а не ошибочного
|
||||
открытого ракурса арта; нулевые углы собирают исходный закрытый силуэт.
|
||||
`iron_maiden.gd` подключает модель через equipment.gd. В apparatus_motion
|
||||
нагрев новой модели использует material_overlay, сохраняя PBR-текстуры.
|
||||
- Исходник Meshy: multi-image-to-3d `01a1845b-d214-7150-8267-02bdbab6abd8`,
|
||||
фактический расход 30 кредитов, одна генерация. `tools/model_sources/
|
||||
iron_maiden_v01/` содержит исходный GLB, утверждённый арт, превью и Blender.
|
||||
Воспроизводимые команды: build_iron_maiden.py / review_iron_maiden.py.
|
||||
Ранний локальный вариант выглядел расплавленным: устранены неверные
|
||||
custom normals после разрезания и Solidify мелких декоративных деталей.
|
||||
Окончательный вариант пересчитывает нормали и использует отдельную обшивку.
|
||||
- Проверки девы: Godot 4.3 import PASS без ошибок; `--test-iron-maiden` PASS:
|
||||
PBR, две независимые петли, 19 промежуточных положений, закрытие/нагрев/
|
||||
награда/повторное открытие. `--test-single-punishment` PASS для всех шести
|
||||
устройств, мужской/женской души, сгорания и однократной награды. Рендеры
|
||||
открытого/промежуточного/закрытого состояния и игровые кадры просмотрены.
|
||||
Сохранённый обзор: `reviews/iron_maiden_v01/preview.png` и `in-game.png`.
|
||||
Изменены исходники; Windows EXE не пересобирался.
|
||||
|
||||
- **Вступление (готово):** новая смена запускает облёт главной героини.
|
||||
Через 2 секунды проигрывается целиком пользовательская запись Serafina
|
||||
(`audio/intro_serafina.mp3`, исходный ElevenLabs MP3 от 2026-10-28 18:59:40,
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
"""Prepare the approved Meshy cabinet with independently hinged, matching doors.
|
||||
|
||||
Blender 5: blender -b --python tools/build_iron_maiden.py
|
||||
The closed source is the single source of truth for both door silhouettes.
|
||||
"""
|
||||
import bpy, bmesh, json, math
|
||||
from pathlib import Path
|
||||
from mathutils import Vector
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SOURCE = ROOT / 'tools/model_sources/iron_maiden_v01/source.glb'
|
||||
OUT = ROOT / 'Demon_v0.19/art/equipment/iron_maiden_v01'
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
bpy.ops.import_scene.gltf(filepath=str(SOURCE))
|
||||
meshes = [o for o in bpy.context.scene.objects if o.type == 'MESH']
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
for obj in meshes:
|
||||
obj.select_set(True)
|
||||
bpy.context.view_layer.objects.active = meshes[0]
|
||||
bpy.ops.object.convert(target='MESH')
|
||||
bpy.ops.object.join()
|
||||
source = bpy.context.object
|
||||
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
|
||||
verts = [v.co for v in source.data.vertices]
|
||||
lo = Vector(tuple(min(v[i] for v in verts) for i in range(3)))
|
||||
hi = Vector(tuple(max(v[i] for v in verts) for i in range(3)))
|
||||
factor = 3.10 / (hi.z - lo.z)
|
||||
center = (lo + hi) * .5
|
||||
for v in source.data.vertices:
|
||||
v.co = Vector(((v.co.x-center.x)*factor, (v.co.y-center.y)*factor, (v.co.z-lo.z)*factor))
|
||||
if len(source.data.polygons)>80000:
|
||||
decimate=source.modifiers.new('Game triangle budget','DECIMATE')
|
||||
decimate.ratio=80000/len(source.data.polygons)
|
||||
bpy.ops.object.modifier_apply(modifier=decimate.name)
|
||||
|
||||
# Blender -Y is Godot +Z (the existing station approach direction).
|
||||
# Cut the closed surface once. Each triangle then belongs to exactly one part.
|
||||
bm = bmesh.new(); bm.from_mesh(source.data)
|
||||
door_bottom, door_top, hinge_y = .25, 2.48, 0.0
|
||||
for point, normal in [((0,0,door_bottom),(0,0,1)),((0,0,door_top),(0,0,1)),((0,hinge_y,0),(0,1,0)),((0,0,0),(1,0,0))]:
|
||||
bmesh.ops.bisect_plane(bm, geom=list(bm.verts)+list(bm.edges)+list(bm.faces),
|
||||
dist=1e-6, plane_co=point, plane_no=normal)
|
||||
bm.to_mesh(source.data);bm.free()
|
||||
|
||||
def group_for(face):
|
||||
c=face.calc_center_median()
|
||||
if door_bottom+1e-5 < c.z < door_top-1e-5 and c.y < hinge_y-1e-5:
|
||||
return 'LeftDoor' if c.x < 0 else 'RightDoor'
|
||||
return 'Body'
|
||||
|
||||
parts={}
|
||||
for name in ['Body','LeftDoor','RightDoor']:
|
||||
mesh=source.data.copy();bm=bmesh.new();bm.from_mesh(mesh)
|
||||
discard=[f for f in bm.faces if group_for(f)!=name]
|
||||
bmesh.ops.delete(bm,geom=discard,context='FACES')
|
||||
loose=[v for v in bm.verts if not v.link_faces]
|
||||
bmesh.ops.delete(bm,geom=loose,context='VERTS')
|
||||
bm.to_mesh(mesh);bm.free();mesh.update()
|
||||
obj=bpy.data.objects.new(name+'Surface',mesh);bpy.context.collection.objects.link(obj)
|
||||
parts[name]=obj
|
||||
bpy.data.objects.remove(source,do_unlink=True)
|
||||
|
||||
# Separate smooth lining preserves the source exterior and central closing seam.
|
||||
inner=bpy.data.materials.new('Smooth interior iron');inner.diffuse_color=(.055,.065,.075,1)
|
||||
inner.use_nodes=True
|
||||
inner.node_tree.nodes.clear()
|
||||
principled=inner.node_tree.nodes.new('ShaderNodeBsdfPrincipled')
|
||||
material_output=inner.node_tree.nodes.new('ShaderNodeOutputMaterial')
|
||||
inner.node_tree.links.new(principled.outputs['BSDF'],material_output.inputs['Surface'])
|
||||
principled.inputs['Base Color'].default_value=(.055,.065,.075,1)
|
||||
principled.inputs['Metallic'].default_value=.78;principled.inputs['Roughness'].default_value=.50
|
||||
for name,obj in parts.items():
|
||||
custom=obj.data.attributes.get('custom_normal')
|
||||
if custom:obj.data.attributes.remove(custom)
|
||||
for polygon in obj.data.polygons:polygon.use_smooth=True
|
||||
|
||||
# Do not solidify the source's tiny rivets and decorative folds: inward offsets
|
||||
# on those details produce self-intersections. A separate smooth lining defines
|
||||
# the cavity, while the original outer surfaces stay untouched.
|
||||
profile=[(.25,.73,.54),(.5,.75,.56),(1.0,.75,.56),(1.7,.75,.56),(2.15,.72,.54),(2.35,.55,.40),(2.43,.35,.25)]
|
||||
liners={}
|
||||
for name,start,end in [('Body',0,math.pi),('LeftDoor',math.pi,math.pi*1.5),('RightDoor',math.pi*1.5,math.pi*2)]:
|
||||
count=48 if name=='Body' else 24
|
||||
vertices=[];faces=[]
|
||||
for z,rx,ry in profile:
|
||||
for k in range(count+1):
|
||||
a=start+(end-start)*k/count
|
||||
vertices.append((math.cos(a)*rx*.86,math.sin(a)*ry*.70,z))
|
||||
for j in range(len(profile)-1):
|
||||
for k in range(count):
|
||||
a=j*(count+1)+k;b=a+count+1
|
||||
faces.append((a,b,b+1,a+1))
|
||||
data=bpy.data.meshes.new(name+'Lining');data.from_pydata(vertices,[],faces);data.materials.append(inner)
|
||||
liner=bpy.data.objects.new(name+'Lining',data);bpy.context.collection.objects.link(liner)
|
||||
for p in data.polygons:p.use_smooth=True
|
||||
liners[name]=liner
|
||||
|
||||
hinges={}
|
||||
for name,sign in [('LeftDoor',-1),('RightDoor',1)]:
|
||||
obj=parts[name]
|
||||
edge=[v.co.x for v in obj.data.vertices if abs(v.co.y-hinge_y)<.045 and .45<v.co.z<2.20]
|
||||
hx=(min(edge) if sign<0 else max(edge)) if edge else sign*.72
|
||||
pivot=Vector((hx,hinge_y,0))
|
||||
empty=bpy.data.objects.new(name,None);bpy.context.collection.objects.link(empty);empty.location=pivot
|
||||
for v in obj.data.vertices:v.co-=pivot
|
||||
obj.parent=empty;obj.location=(0,0,0)
|
||||
liner=liners[name]
|
||||
for v in liner.data.vertices:v.co-=pivot
|
||||
liner.parent=empty
|
||||
hinges[name]=list(pivot)
|
||||
parts['Body'].name='Body'
|
||||
|
||||
# Embedded glTF images already have packed_file. Repacking those from their
|
||||
# virtual filenames can discard the embedded bytes in Blender 5.
|
||||
for image in bpy.data.images:
|
||||
if image.source=='FILE' and not image.packed_file and image.size[0]>0:image.pack()
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(ROOT/'tools/model_sources/iron_maiden_v01/iron_maiden.blend'))
|
||||
bpy.ops.export_scene.gltf(filepath=str(OUT/'iron_maiden.glb'),export_format='GLB',export_yup=True,export_animations=False)
|
||||
for obj in parts.values():obj.data.calc_loop_triangles()
|
||||
manifest={'source_task':'01a1845b-d214-7150-8267-02bdbab6abd8','resource':'multi-image-to-3d',
|
||||
'height_m':3.10,'hinges_blender':hinges,'door_height':[door_bottom,door_top],
|
||||
'construction':'Closed source partitioned once; two front quadrants, separate smooth lining, recomputed normals.',
|
||||
'triangles':sum(len(o.data.loop_triangles) for o in parts.values())+sum(len(o.data.polygons)*2 for o in liners.values())}
|
||||
(OUT/'manifest.json').write_text(json.dumps(manifest,indent=2),encoding='utf-8')
|
||||
print('IRON_MAIDEN_EXPORTED',json.dumps(manifest))
|
||||
@@ -0,0 +1,31 @@
|
||||
# Iron maiden — approved concept, Meshy generation and game preparation
|
||||
|
||||
Reference: `concept.png`, approved in chat on 2026-10-28. Only the three closed
|
||||
front/side/back crops were sent to Meshy. The open drawing is deliberately not
|
||||
used for construction: its door silhouettes do not close consistently.
|
||||
|
||||
Meshy resource: `multi-image-to-3d`.
|
||||
Task: `01a1845b-d214-7150-8267-02bdbab6abd8`.
|
||||
Reported consumption: **30 credits**. Textured GLB with PBR, 4K.
|
||||
Original bytes: `source.glb`, SHA256
|
||||
`1cd971b887f682be8da72507472965c45c806932c2fafaab90c68e586a7fc190`.
|
||||
`meshy-preview.png` is the service's render of the original closed model.
|
||||
|
||||
Reproduce the game asset using Blender 5:
|
||||
|
||||
```powershell
|
||||
& 'C:\Program Files\Blender Foundation\Blender 5.0\blender.exe' -b --python tools/build_iron_maiden.py
|
||||
& 'C:\Program Files\Blender Foundation\Blender 5.0\blender.exe' -b --python tools/review_iron_maiden.py
|
||||
```
|
||||
|
||||
The local build reduces the source mesh, partitions its closed surface at the
|
||||
hinge and center planes, adds a separate smooth interior lining, and exports
|
||||
`Body`, `LeftDoor`, `RightDoor`. The doors' zero rotations reconstruct the closed
|
||||
source; their rotations in game reuse the existing station state machine.
|
||||
Custom normals are cleared after cutting and recalculated on the new topology;
|
||||
this prevents the incorrect melted-looking shading seen in the first local draft.
|
||||
The edited Blender source is `iron_maiden.blend`.
|
||||
|
||||
Game output: `Demon_v0.19/art/equipment/iron_maiden_v01/iron_maiden.glb`.
|
||||
Run the game with `-- --test-iron-maiden` to exercise the station and capture its
|
||||
open, intermediate, closed and heated poses. Technical captures remain local.
|
||||
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 192 KiB |
@@ -0,0 +1,41 @@
|
||||
"""Render source/game prop in Blender for orientation and hinge review.
|
||||
blender -b --python tools/review_iron_maiden.py -- [--source]
|
||||
"""
|
||||
import bpy, math, sys, json
|
||||
from pathlib import Path
|
||||
from mathutils import Vector
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
source='--source' in sys.argv
|
||||
path=ROOT/('tools/model_sources/iron_maiden_v01/source.glb' if source else 'Demon_v0.19/art/equipment/iron_maiden_v01/iron_maiden.glb')
|
||||
out=ROOT/'Demon_v0.19/captures/iron-maiden';out.mkdir(parents=True,exist_ok=True)
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
bpy.ops.import_scene.gltf(filepath=str(path))
|
||||
mesh=[o for o in bpy.context.scene.objects if o.type=='MESH']
|
||||
points=[o.matrix_world@v.co for o in mesh for v in o.data.vertices]
|
||||
lo=Vector([min(v[i] for v in points) for i in range(3)]);hi=Vector([max(v[i] for v in points) for i in range(3)])
|
||||
center=(lo+hi)/2;size=max(hi-lo)
|
||||
print('MODEL_BOUNDS',list(lo),list(hi),'POLYGONS',sum(len(o.data.polygons) for o in mesh))
|
||||
scene=bpy.context.scene;scene.render.engine='CYCLES';scene.cycles.samples=16
|
||||
scene.render.resolution_x=900;scene.render.resolution_y=900;scene.render.resolution_percentage=100
|
||||
scene.world=bpy.data.worlds.new('Studio');scene.world.use_nodes=True
|
||||
nodes=scene.world.node_tree.nodes;nodes.clear()
|
||||
background=nodes.new('ShaderNodeBackground');background.inputs[0].default_value=(.12,.14,.18,1);background.inputs[1].default_value=.5
|
||||
output=nodes.new('ShaderNodeOutputWorld');scene.world.node_tree.links.new(background.outputs[0],output.inputs[0])
|
||||
for name,location,power,scale in [('Key',(3,-4,5),700,4),('Fill',(-3,-2,2),450,3),('Rim',(1,3,4),900,3)]:
|
||||
lamp=bpy.data.lights.new(name,'AREA');lamp.energy=power;lamp.shape='DISK';lamp.size=scale
|
||||
obj=bpy.data.objects.new(name,lamp);scene.collection.objects.link(obj);obj.location=center+Vector(location)*size/3
|
||||
obj.rotation_euler=(center-obj.location).to_track_quat('-Z','Y').to_euler()
|
||||
camera=bpy.data.objects.new('Camera',bpy.data.cameras.new('Camera'));scene.collection.objects.link(camera);scene.camera=camera
|
||||
camera.data.type='ORTHO';camera.data.ortho_scale=size*1.30
|
||||
views=[('source-front' if source else 'studio-closed',(0,-6,1.0)),('source-back' if source else 'studio-back',(0,6,1.0))]
|
||||
if not source:views += [('studio-half',(4,-6,2.0)),('studio-open',(4,-6,2.0))]
|
||||
for name,direction in views:
|
||||
if name in ('studio-half','studio-open'):
|
||||
angle=.9 if name=='studio-half' else 1.8
|
||||
bpy.data.objects['LeftDoor'].rotation_mode='XYZ'
|
||||
bpy.data.objects['RightDoor'].rotation_mode='XYZ'
|
||||
bpy.data.objects['LeftDoor'].rotation_euler.z=-angle
|
||||
bpy.data.objects['RightDoor'].rotation_euler.z=angle
|
||||
camera.location=center+Vector(direction)*size
|
||||
camera.rotation_euler=(center-camera.location).to_track_quat('-Z','Y').to_euler()
|
||||
scene.render.filepath=str(out/(name+'.png'));bpy.ops.render.render(write_still=True)
|
||||