import bpy, math, os, random
from mathutils import Vector
from math import sin, cos, pi

# Fresh scene
bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True)
scene = bpy.context.scene
scene.render.engine = 'BLENDER_EEVEE'
scene.render.resolution_x = 900
scene.render.resolution_y = 900
scene.render.resolution_percentage = 60
scene.render.image_settings.file_format = 'PNG'
scene.render.film_transparent = False
try: scene.view_settings.look = 'Medium High Contrast'
except: pass
scene.view_settings.exposure = 0.15
scene.view_settings.gamma = 1.0

# World: dark indigo print stock
world = bpy.data.worlds.new('Night_Market_World') if not bpy.data.worlds else bpy.data.worlds[0]
scene.world = world
world.use_nodes = True
wn = world.node_tree.nodes
wl = world.node_tree.links
wn.clear()
out = wn.new('ShaderNodeOutputWorld')
bg = wn.new('ShaderNodeBackground')
bg.inputs['Color'].default_value = (0.002, 0.003, 0.012, 1)
bg.inputs['Strength'].default_value = 0.12
wl.new(bg.outputs['Background'], out.inputs['Surface'])

# Collections

def coll(name):
    c = bpy.data.collections.get(name) or bpy.data.collections.new(name)
    if c not in scene.collection.children:
        try: scene.collection.children.link(c)
        except: pass
    return c
C_BG=coll('01_MARKET_ARCHITECTURE')
C_SIGNS=coll('02_MULTICULTURAL_SIGNS')
C_CART=coll('03_RAMEN_CART')
C_HERO=coll('04_RAMEN_SAMURAI')
C_NOODLES=coll('05_NOODLE_CHOREOGRAPHY')
C_FX=coll('06_INK_HALFTONE_MOTION')
C_FRAME=coll('07_PANEL_FRAME')

# Materials: emissive hand-printed flats (no realistic glossy response)
def emat(name, color, strength=1.0):
    m=bpy.data.materials.get(name) or bpy.data.materials.new(name)
    m.use_nodes=True
    n=m.node_tree.nodes; l=m.node_tree.links
    n.clear()
    e=n.new('ShaderNodeEmission')
    e.inputs['Color'].default_value=(*color,1)
    e.inputs['Strength'].default_value=strength
    o=n.new('ShaderNodeOutputMaterial')
    l.new(e.outputs['Emission'],o.inputs['Surface'])
    m.diffuse_color=(*color,1)
    m['graphic_flat']=True
    m['emission_strength']=strength
    return m

INK=emat('INK_outline',(0.003,0.002,0.008),0.25)
BLACK=emat('BROWN_BLACK_print',(0.012,0.006,0.014),0.35)
INDIGO=emat('DARK_indigo',(0.018,0.035,0.11),0.9)
NAVY=emat('NAVY_robes',(0.025,0.07,0.18),1.0)
CONCRETE=emat('MUTED_concrete',(0.09,0.075,0.09),0.8)
CONCRETE2=emat('CONCRETE_shadow',(0.035,0.042,0.065),0.7)
BROWN=emat('AGED_brown',(0.12,0.045,0.025),0.85)
STEEL=emat('DULL_steel',(0.18,0.21,0.24),0.9)
DIRTY=emat('DIRTY_white',(0.76,0.72,0.52),1.05)
CREAM=emat('BONE_highlight',(0.95,0.76,0.42),1.15)
ACID=emat('ACID_green',(0.42,1.0,0.025),1.35)
CHART=emat('CHARTREUSE',(0.78,1.0,0.02),1.3)
LIME=emat('LIME_ink',(0.58,0.95,0.05),1.25)
AMBER=emat('AMBER_orange',(1.0,0.30,0.025),1.35)
SODIUM=emat('SODIUM_yellow',(1.0,0.62,0.035),1.25)
GOLD=emat('BROTH_gold',(1.0,0.78,0.06),1.45)
CRIMSON=emat('DEEP_crimson',(0.68,0.012,0.025),1.2)
VERMILION=emat('VERMILION',(1.0,0.07,0.025),1.25)
CYAN=emat('SELECTIVE_cyan',(0.02,0.72,0.88),1.25)
TURQ=emat('TURQUOISE',(0.01,0.85,0.65),1.2)
VIOLET=emat('ULTRAVIOLET',(0.42,0.05,0.9),1.1)
MAGENTA=emat('MAGENTA_accent',(1.0,0.025,0.42),1.1)
PAPER=emat('PAPER',(0.9,0.82,0.58),1.0)

# Helpers
def link_obj(obj, collection):
    for c in list(obj.users_collection):
        c.objects.unlink(obj)
    collection.objects.link(obj)
    return obj

def box(name, loc, dims, mat, collection=C_BG, bevel=0.0, rot=(0,0,0)):
    bpy.ops.mesh.primitive_cube_add(location=loc, rotation=rot)
    o=bpy.context.object; o.name=name; o.dimensions=dims
    bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
    if mat: o.data.materials.append(mat)
    link_obj(o,collection)
    if bevel:
        mod=o.modifiers.new('tiny_ink_round','BEVEL'); mod.width=bevel; mod.segments=1
    return o

def cyl(name, loc, radius, depth, mat, collection=C_BG, rot=(0,0,0), vertices=24, bevel=0.0):
    bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, radius=radius, depth=depth, location=loc, rotation=rot)
    o=bpy.context.object; o.name=name
    if mat: o.data.materials.append(mat)
    link_obj(o,collection)
    if bevel:
        mod=o.modifiers.new('printed_edge','BEVEL'); mod.width=bevel; mod.segments=1
    return o

def uv(name, loc, scale, mat, collection=C_BG, segments=24, rings=12):
    bpy.ops.mesh.primitive_uv_sphere_add(segments=segments, ring_count=rings, location=loc)
    o=bpy.context.object; o.name=name; o.scale=scale
    bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
    if mat:o.data.materials.append(mat)
    link_obj(o,collection)
    return o

def poly(name, pts, y, depth, mat, collection=C_BG, bevel=0.0):
    verts=[]
    for x,z in pts: verts.append((x,y-depth/2,z))
    for x,z in pts: verts.append((x,y+depth/2,z))
    n=len(pts)
    faces=[tuple(range(n-1,-1,-1)),tuple(range(n,2*n))]
    for i in range(n):
        j=(i+1)%n; faces.append((i,j,n+j,n+i))
    me=bpy.data.meshes.new(name+'_mesh'); me.from_pydata(verts,[],faces); me.update()
    o=bpy.data.objects.new(name,me); collection.objects.link(o)
    if mat:o.data.materials.append(mat)
    if bevel:
        mod=o.modifiers.new('ink_edge','BEVEL'); mod.width=bevel; mod.segments=1
    return o

def poly_layer(name, pts, y, mat, collection=C_BG, scale=1.0, outline=0.0, depth=0.12):
    cx=sum(p[0] for p in pts)/len(pts); cz=sum(p[1] for p in pts)/len(pts)
    if outline:
        op=[(cx+(x-cx)*(scale+outline),cz+(z-cz)*(scale+outline)) for x,z in pts]
        poly(name+'_INK',op,y+0.08,depth+0.08,INK,collection)
    ip=[(cx+(x-cx)*scale,cz+(z-cz)*scale) for x,z in pts]
    return poly(name,ip,y,depth,mat,collection)

def curve_obj(name, pts, bevel, mat, collection=C_FX, cyclic=False, resolution=2):
    cu=bpy.data.curves.new(name+'_curve','CURVE'); cu.dimensions='3D'; cu.resolution_u=resolution
    cu.bevel_depth=bevel; cu.bevel_resolution=0; cu.resolution_u=2; cu.fill_mode='FULL'
    sp=cu.splines.new('BEZIER'); sp.bezier_points.add(len(pts)-1)
    for bp,co in zip(sp.bezier_points,pts):
        bp.co=co; bp.handle_left_type='AUTO'; bp.handle_right_type='AUTO'
    sp.use_cyclic_u=cyclic
    o=bpy.data.objects.new(name,cu); collection.objects.link(o)
    cu.materials.append(mat)
    return o

def noodle(name, xzpts, color, width=0.09, y=-0.5, outline=0.14, collection=C_NOODLES, misreg=False):
    pts=[(x,y,z) for x,z in xzpts]
    curve_obj(name+'_black',pts,outline,INK,collection,resolution=3)
    if misreg:
        curve_obj(name+'_cyan_shift',[(x+0.06,y+0.035,z+0.025) for x,z in xzpts],width*0.72,CYAN,collection,resolution=3)
        curve_obj(name+'_red_shift',[(x-0.055,y+0.045,z-0.02) for x,z in xzpts],width*0.70,VERMILION,collection,resolution=3)
    return curve_obj(name,pts,width,color,collection,resolution=3)

def line_between(name,a,b,r,mat,collection=C_FX):
    a=Vector(a); b=Vector(b); d=b-a; mid=(a+b)/2
    bpy.ops.mesh.primitive_cylinder_add(vertices=12, radius=r, depth=d.length, location=mid)
    o=bpy.context.object; o.name=name
    o.rotation_mode='QUATERNION'; o.rotation_quaternion=d.to_track_quat('Z','Y')
    if mat:o.data.materials.append(mat)
    link_obj(o,collection)
    return o

def text_obj(name, body, loc, size, mat, collection=C_SIGNS, align='CENTER', rot=(pi/2,0,0), extrude=0.012, shadow=True):
    if shadow:
        c=bpy.data.curves.new(name+'_shadow_curve','FONT'); c.body=body; c.align_x=align; c.size=size; c.extrude=extrude*1.2; c.offset=0.01
        so=bpy.data.objects.new(name+'_INK',c); collection.objects.link(so); so.location=(loc[0]+0.045,loc[1]+0.06,loc[2]-0.035); so.rotation_euler=rot; c.materials.append(INK)
    c=bpy.data.curves.new(name+'_curve','FONT'); c.body=body; c.align_x=align; c.align_y='CENTER'; c.size=size; c.extrude=extrude; c.offset=0.0
    o=bpy.data.objects.new(name,c); collection.objects.link(o); o.location=loc; o.rotation_euler=rot; c.materials.append(mat)
    return o

def torus(name, loc, major, minor, mat, collection=C_BG, rot=(0,0,0)):
    bpy.ops.mesh.primitive_torus_add(major_radius=major, minor_radius=minor, major_segments=32, minor_segments=8, location=loc, rotation=rot)
    o=bpy.context.object; o.name=name; o.data.materials.append(mat); link_obj(o,collection); return o

def dots(name, center, w,h, spacing, r, mat, y, collection=C_FX, rot=(pi/2,0,0), jitter=0.0):
    x0,z0=center; ix=0; x=-w/2
    while x<=w/2+1e-6:
        iz=0; z=-h/2
        while z<=h/2+1e-6:
            jx=(random.random()-0.5)*jitter; jz=(random.random()-0.5)*jitter
            cyl(f'{name}_{ix}_{iz}',(x0+x+jx,y,z0+z+jz),r,0.035,mat,collection,rot=rot,vertices=12)
            z+=spacing; iz+=1
        x+=spacing; ix+=1

# ---------------- BACKDROP / CITY LAYERS ----------------
box('Backdrop_ink',(0,4.8,6.0),(25,0.5,14),BLACK,C_BG)
box('Backdrop_concrete',(0,4.45,6.0),(24.3,0.18,13.3),CONCRETE2,C_BG)
box('Tower_left',(-8.1,3.7,7.0),(6.0,0.7,14.0),INDIGO,C_BG)
box('Tower_right',(8.0,3.6,7.0),(6.3,0.7,14.0),BROWN,C_BG)
box('Tower_mid',(1.5,4.0,8.0),(5.2,0.45,11.5),CONCRETE2,C_BG)
for x in (-10.5,-6.2,-3.5,4.8,9.8,11.0):
    box('vertical_ink_seam', (x,3.25,6.5),(0.18,0.12,12),BLACK,C_BG)
random.seed(7)
win_mats=[AMBER,SODIUM,CRIMSON,ACID,CYAN,DIRTY]
for row,z in enumerate([3.2,4.4,5.6,6.8,8.0,9.2,10.4]):
    for col,x in enumerate([-10.2,-8.9,-7.6,-6.3,-5.0,-3.7,0.0,1.25,2.5,4.9,6.2,7.5,8.8,10.1]):
        if random.random()<0.60:
            w=random.choice([0.35,0.5,0.75]); h=random.choice([0.18,0.28,0.42])
            box('window_%02d_%02d'%(row,col),(x,3.20,z),(w,0.09,h),random.choice(win_mats),C_BG)
            if random.random()<0.27:
                box('window_glitch',(x+0.03,3.13,z+h*0.45),(w*0.5,0.04,0.035),INK,C_FX)
box('roofline_left',(-8.4,2.9,11.7),(7.0,0.5,0.45),BLACK,C_BG)
box('roofline_right',(8.3,2.8,11.3),(6.5,0.5,0.55),BLACK,C_BG)
for x,z in [(-10,11.9),(-7.7,12.0),(7.0,11.6),(9.7,11.7)]:
    cyl('water_tank',(x,3.0,z),0.55,0.65,BLACK,C_BG); cyl('tank_band',(x,2.92,z),0.58,0.10,CRIMSON if x<0 else ACID,C_BG)
box('Street_ground',(0,0.8,-0.18),(28,16,0.35),BLACK,C_BG)
box('Street_surface',(0,0.7,0.02),(27.5,15.0,0.18),CONCRETE2,C_BG)
for i,x in enumerate([-10,-6,-2,2,6,10]):
    line_between('floor_perspective_mark',(x,-1.5,0.13),(x*0.48,5.0,0.13),0.035,CRIMSON if i%2 else CYAN,C_FX)
for x in (-8,-4,0,4,8): box('floor_dash',(x,-0.8,0.15),(1.5,0.18,0.04),SODIUM,C_FX,rot=(0,0,0.1))

# ---------------- MULTICULTURAL SIGN SYSTEM ----------------
def sign_board(name, loc, dims, boardmat, text, tmat, size, rotz=0, extra=None):
    box(name+'_INK',(loc[0]+0.05,loc[1]+0.10,loc[2]-0.05),(dims[0]*1.04,dims[1]+0.14,dims[2]*1.08),INK,C_SIGNS,rot=(0,0,rotz))
    box(name,loc,dims,boardmat,C_SIGNS,rot=(0,0,rotz))
    t=text_obj(name+'_lettering',text,(loc[0],loc[1]-dims[1]*0.56,loc[2]),size,tmat,C_SIGNS,shadow=True)
    t.rotation_euler=(pi/2,0,rotz)
    if extra: extra()
    return bpy.data.objects.get(name)

sign_board('Sign_ramen_left',(-7.0,2.85,9.0),(5.1,0.25,1.05),ACID,'RAMEN  /  ラーメン',INK,0.46,rotz=-0.02)
text_obj('Sign_ramen_redghost','RAMEN',(-6.94,2.62,8.96),0.39,VERMILION,C_FX,shadow=False)
sign_board('Sign_china_right',(7.2,2.82,9.15),(4.6,0.25,1.0),CRIMSON,'中華  CHOW',CREAM,0.42,rotz=0.03)
sign_board('Sign_global_middle',(5.8,2.76,7.55),(5.2,0.22,0.88),CHART,'TACOS  •  CHAI  •  K-FOOD',BLACK,0.27,rotz=-0.04)
sign_board('Sign_arabic',(-8.7,2.78,6.55),(3.7,0.22,0.86),AMBER,'مطبخ 24H',INK,0.42,rotz=0.02)
sign_board('Sign_spanish',(-5.8,2.72,4.75),(3.6,0.22,0.78),VERMILION,'TACOS Y RAMEN',CREAM,0.28,rotz=-0.05)
sign_board('Sign_south_asian',(9.3,2.72,5.55),(3.6,0.22,0.9),VIOLET,'CHAI  चाय',SODIUM,0.35,rotz=0.01)
box('Vertical_sign_ink',(-3.95,2.48,7.1),(0.95,0.22,4.2),INK,C_SIGNS,rot=(0,0,-0.03))
box('Vertical_sign',(-4.02,2.38,7.1),(0.72,0.18,3.95),SODIUM,C_SIGNS,rot=(0,0,-0.03))
text_obj('Vertical_lettering','夜 食',(-4.02,2.25,7.1),0.52,CRIMSON,C_SIGNS,shadow=True)
box('Micro_ad_ink',(1.7,2.55,9.5),(2.4,0.16,0.58),INK,C_SIGNS)
box('Micro_ad',(1.7,2.47,9.5),(2.15,0.12,0.40),CYAN,C_SIGNS)
text_obj('Micro_ad_text','OPEN / 24',(1.7,2.38,9.5),0.24,INK,C_SIGNS,shadow=False)
for x in (-9.2,-4.7,4.7,9.6): box('sign_hanger',(x,2.55,10.0),(0.10,0.12,1.4),BLACK,C_SIGNS)
dots('halftone_amber',(-8.7,6.55),3.1,0.45,0.27,0.045,CRIMSON,2.63,C_FX,jitter=0.03)
dots('halftone_crimson',(7.2,9.15),4.0,0.55,0.34,0.05,AMBER,2.66,C_FX,jitter=0.04)
dots('halftone_violet',(9.3,5.55),2.7,0.5,0.30,0.04,INK,2.57,C_FX,jitter=0.03)

# ---------------- STREET PROPS ----------------
box('Awning_left_ink',(-7.0,1.7,4.0),(5.0,1.0,0.40),INK,C_BG,rot=(0.12,0,0.03))
for i in range(6):
    x=-9.1+i*0.85
    box('Awning_left_patch',(x,1.12,3.86),(0.68,0.14,0.32),[CRIMSON,AMBER,ACID,CRIMSON,DIRTY,AMBER][i],C_BG,rot=(0.12,0,0.03))
box('Awning_right_ink',(8.2,1.9,4.0),(4.6,0.85,0.42),INK,C_BG,rot=(-0.08,0,-0.04))
for i in range(5):
    x=6.3+i*0.9
    box('Awning_right_patch',(x,1.45,3.84),(0.72,0.14,0.31),[ACID,BROWN,CRIMSON,SODIUM,CYAN][i],C_BG,rot=(-0.08,0,-0.04))
box('Vending_ink',(-5.3,0.95,2.9),(2.0,0.9,3.7),INK,C_BG,bevel=0.08)
box('Vending_body',(-5.3,0.88,2.9),(1.72,0.72,3.42),STEEL,C_BG,bevel=0.05)
box('Vending_glow',(-5.3,0.47,3.35),(1.35,0.035,1.75),ACID,C_BG)
for z in (2.75,3.15,3.55,3.95):
    box('vending_slot',(-5.3,0.42,z),(1.15,0.025,0.12),INK,C_FX); cyl('vending_can',(-5.75,0.38,z+0.14),0.12,0.04,AMBER,C_FX,rot=(pi/2,0,0),vertices=16)
cable_paths=[[(-11,1.5,10.7),(-8,0.8,9.9),(-5,0.9,10.5),(-2,1.1,9.7),(2,1.0,10.2),(6,0.8,9.6),(11,1.2,10.4)],[(-10,0.7,8.2),(-7,0.4,7.6),(-3,0.7,8.1),(1,0.6,7.4),(5,0.8,8.2),(10,1.0,7.4)],[(-4,0.0,11.3),(-3.4,-0.3,8.8),(-2.9,-0.2,6.2)]]
for i,p in enumerate(cable_paths):
    curve_obj('hanging_cable_%02d'%i,p,0.045,BLACK,C_BG,resolution=2)
    if i<2: curve_obj('cable_color_echo_%02d'%i,[(x,y-0.035,z+0.02) for x,y,z in p],0.018,CRIMSON if i==0 else CYAN,C_FX,resolution=2)
for i,(x,z,ma) in enumerate([(-10.5,7.9,CRIMSON),(-3.0,8.7,SODIUM),(4.2,8.5,VERMILION),(10.0,7.8,AMBER)]):
    line_between('lantern_wire',(x,1.0,z+1.0),(x,1.0,z+0.55),0.035,BLACK,C_BG)
    uv('lantern_ink',(x,0.72,z),(.48,.32,.60),INK,C_BG); uv('lantern',(x,0.65,z),(.34,.25,.46),ma,C_BG)
    box('lantern_band',(x,0.35,z),(0.48,0.05,0.08),DIRTY,C_FX); cyl('lantern_cap',(x,0.6,z+0.48),0.08,0.12,INK,C_BG)
for x in (-3.7,5.6,7.2):
    cyl('stool_seat',(x,-0.2,1.25),0.52,0.25,INK,C_BG,vertices=16); cyl('stool_top',(x,-0.34,1.30),0.40,0.16,CRIMSON if x<0 else SODIUM,C_BG,vertices=16)
    for dx in (-0.28,0.28): line_between('stool_leg',(x+dx,-0.18,1.15),(x+dx*1.12,-0.18,0.3),0.055,BLACK,C_BG)
for x in (6.4,8.9):
    torus('bike_wheel_ink',(x,1.45,1.55),0.72,0.10,INK,C_BG,rot=(pi/2,0,0)); torus('bike_wheel_echo',(x,1.36,1.55),0.57,0.055,CRIMSON,C_BG,rot=(pi/2,0,0))
line_between('bike_frame',(6.4,1.35,1.55),(7.5,1.32,2.55),0.09,CYAN,C_BG); line_between('bike_frame2',(7.5,1.32,2.55),(8.9,1.35,1.55),0.09,CYAN,C_BG); line_between('bike_bar',(7.5,1.32,2.55),(8.2,1.35,2.85),0.07,INK,C_BG); line_between('bike_handle',(8.15,1.34,2.82),(8.72,1.34,2.7),0.07,INK,C_BG)
box('delivery_box',(7.4,1.25,3.0),(1.7,0.65,0.95),AMBER,C_BG,bevel=.06)
text_obj('delivery_text','出前',(7.4,0.88,3.0),0.28,INK,C_BG,shadow=False)

# ---------------- RAMEN CART ----------------
box('Cart_body_ink',(2.6,0.15,1.65),(4.8,1.8,2.65),INK,C_CART,bevel=.10); box('Cart_body',(2.6,0.03,1.72),(4.4,1.55,2.35),BROWN,C_CART,bevel=.06)
box('Cart_front_panel',(2.6,-0.78,1.75),(3.8,0.07,1.55),INDIGO,C_CART); box('Cart_front_red',(2.65,-0.83,1.75),(2.5,0.035,0.16),CRIMSON,C_CART)
for x in (1.0,2.0,3.0,4.0): box('cart_slats',(x,-0.86,1.75),(0.10,0.04,1.5),AMBER,C_FX)
for x in (0.8,4.4):
    cyl('cart_wheel_ink',(x,-0.83,0.75),0.72,0.30,INK,C_CART,rot=(pi/2,0,0),vertices=24); cyl('cart_wheel',(x,-1.00,0.75),0.54,0.12,CRIMSON if x<2 else SODIUM,C_CART,rot=(pi/2,0,0),vertices=24); cyl('cart_hub',(x,-1.08,0.75),0.12,0.08,DIRTY,C_FX,rot=(pi/2,0,0),vertices=16)
box('Cart_counter_ink',(2.6,-0.05,2.85),(5.0,1.95,0.42),INK,C_CART,bevel=.08); box('Cart_counter',(2.6,-0.18,2.92),(4.65,1.65,0.28),AMBER,C_CART,bevel=.04)
for x in (0.3,4.9): line_between('cart_canopy_post',(x,0.3,3.1),(x,0.3,5.0),0.08,INK,C_CART)
box('Cart_canopy_ink',(2.6,0.25,4.95),(5.2,1.55,0.5),INK,C_CART,rot=(0,0,-0.02)); box('Cart_canopy',(2.6,0.12,4.92),(4.85,1.35,0.34),CRIMSON,C_CART,rot=(0,0,-0.02))
for i in range(7):
    x=0.45+i*0.72; box('canopy_stripe',(x,-0.62,4.89),(0.42,0.06,0.34),[AMBER,DIRTY,ACID,AMBER,DIRTY,ACID,AMBER][i],C_CART,rot=(0,0,-0.02))
box('Cart_marquee_ink',(2.6,-0.73,5.55),(3.9,0.18,0.88),INK,C_CART,bevel=.03); box('Cart_marquee',(2.6,-0.85,5.55),(3.55,0.10,0.67),ACID,C_CART,bevel=.02)
text_obj('Cart_marquee_text','RAMEN  力',(2.6,-0.93,5.55),0.38,INK,C_CART,shadow=False)
bpy.ops.mesh.primitive_cone_add(vertices=32, radius1=1.18, radius2=0.91, depth=0.52, location=(2.55,-1.06,3.42)); bowl=bpy.context.object; bowl.name='BOWL_ink_silhouette'; bowl.data.materials.append(INK); link_obj(bowl,C_CART)
bpy.ops.mesh.primitive_cone_add(vertices=32, radius1=1.00, radius2=0.76, depth=0.42, location=(2.55,-1.15,3.46)); bowl=bpy.context.object; bowl.name='BOWL_vermilion'; bowl.data.materials.append(VERMILION); link_obj(bowl,C_CART)
cyl('BROTH_surface',(2.55,-1.19,3.69),0.76,0.07,GOLD,C_CART,vertices=32); torus('BOWL_rim',(2.55,-1.25,3.69),0.79,0.09,DIRTY,C_CART)
uv('egg',(2.25,-1.33,3.77),(.24,.10,.17),DIRTY,C_CART)
for x,z in [(2.8,3.78),(2.98,3.62),(2.35,3.58),(2.72,3.87)]: cyl('scallion',(x,-1.39,z),0.055,0.05,ACID,C_CART,rot=(pi/2,0,0),vertices=12)
cyl('slide_bowl_ink',(4.25,-0.9,3.25),0.72,0.35,INK,C_CART,vertices=24); cyl('slide_bowl',(4.25,-0.99,3.3),0.58,0.28,AMBER,C_CART,vertices=24); cyl('slide_broth',(4.25,-1.15,3.47),0.45,0.06,CRIMSON,C_CART,vertices=24)
text_obj('Cart_sfx','ズズッ!',(3.9,-1.02,4.36),0.32,CRIMSON,C_FX,shadow=True)

# ---------------- HERO: RAMEN SAMURAI ----------------
poly_layer('Hero_back_foot',[(-2.55,0.72),(-1.42,0.72),(-0.78,1.12),(-1.00,1.48),(-2.20,1.40),(-2.72,1.05)],-0.35,CRIMSON,C_HERO,outline=.06,depth=.22)
poly_layer('Hero_front_foot',[(-0.05,0.70),(1.18,0.70),(1.75,1.10),(1.43,1.50),(0.35,1.46),(-0.25,1.10)],-0.37,AMBER,C_HERO,outline=.06,depth=.22)
robe=[(-2.25,4.35),(-1.65,5.0),(-0.55,4.25),(0.15,3.55),(1.42,1.55),(0.55,1.12),(-0.65,1.30),(-1.35,1.02),(-2.85,1.35),(-2.55,2.55),(-3.05,3.35)]
poly_layer('Hero_robe_body',robe,-0.28,NAVY,C_HERO,outline=.10,depth=.30)
poly_layer('Hero_robe_fold',[(-1.48,4.32),(-0.65,4.05),(0.18,3.40),(0.92,1.62),(0.4,1.35),(-0.2,2.55),(-1.95,3.55)],-0.48,CRIMSON,C_HERO,outline=.025,depth=.10)
poly_layer('Hero_robe_highlight',[(-2.42,3.35),(-1.62,3.82),(-1.15,3.35),(-1.48,1.32),(-2.6,1.42)],-0.50,ACID,C_HERO,outline=.035,depth=.08)
poly_layer('Hero_robe_shadow',[(-0.7,3.95),(0.12,3.32),(1.36,1.6),(0.6,1.16),(-0.02,2.62)],-0.53,INDIGO,C_HERO,outline=.02,depth=.08)
body=[(-2.32,4.15),(-2.10,6.85),(-1.25,7.45),(-0.25,7.35),(0.62,6.45),(0.25,4.25),(-0.55,3.65)]
poly_layer('Hero_torso',body,-0.32,NAVY,C_HERO,outline=.11,depth=.32)
poly('Hero_torso_red_registration',[(x-0.07,z+0.02) for x,z in body],-0.22,0.10,VERMILION,C_FX); poly('Hero_torso_cyan_registration',[(x+0.08,z-0.02) for x,z in body],-0.24,0.08,CYAN,C_FX)
poly_layer('Hero_chest_plate',[(-1.72,6.68),(-0.72,7.05),(0.08,6.43),(-0.22,5.42),(-1.45,5.62)],-0.56,STEEL,C_HERO,outline=.05,depth=.12)
poly_layer('Hero_chest_plate_color',[(-1.52,6.55),(-0.76,6.83),(-0.18,6.35),(-0.38,5.73),(-1.30,5.86)],-0.64,CRIMSON,C_HERO,outline=.025,depth=.07)
poly_layer('Hero_sash',[(-2.0,5.82),(-1.72,6.18),(0.35,4.55),(0.04,4.10),(-2.2,5.35)],-0.70,AMBER,C_HERO,outline=.05,depth=.10)
box('Sash_buckle',(-0.56,-0.78,4.94),(0.36,0.10,0.46),ACID,C_HERO,rot=(0,0,-0.2))
poly_layer('Hero_shoulder_left',[(-2.3,6.62),(-2.85,7.05),(-2.95,7.58),(-2.43,7.78),(-1.75,7.23),(-1.78,6.55)],-0.50,CRIMSON,C_HERO,outline=.08,depth=.18)
poly_layer('Hero_shoulder_right',[(-0.35,6.72),(0.38,7.22),(1.18,7.20),(1.25,6.65),(0.65,6.22),(-0.12,6.20)],-0.53,ACID,C_HERO,outline=.08,depth=.18)
for pts,ma in [([(-2.55,7.02),(-2.15,6.72)],CREAM), ([(0.2,6.8),(0.95,6.82)],INK), ([(0.35,7.1),(0.92,6.48)],INK)]: line_between('armor_line',(pts[0][0],-0.72,pts[0][1]),(pts[1][0],-0.72,pts[1][1]),0.035,ma,C_HERO)
poly_layer('Hero_neck',[(-1.55,7.10),(-0.65,7.10),(-0.62,7.65),(-1.48,7.70)],-0.48,BROWN,C_HERO,outline=.04,depth=.16)
head=[(-1.68,8.72),(-1.43,9.25),(-0.72,9.38),(-0.25,8.88),(-0.42,7.90),(-0.92,7.52),(-1.56,7.86)]
poly_layer('Hero_head_ink',head,-0.42,INK,C_HERO,outline=.06,depth=.30)
face=[(-1.48,8.68),(-1.28,9.04),(-0.74,9.12),(-0.42,8.78),(-0.56,8.03),(-1.0,7.72),(-1.43,7.98)]
poly_layer('Hero_face',face,-0.62,DIRTY,C_HERO,outline=.02,depth=.10)
hair=[(-1.7,8.72),(-1.56,9.33),(-1.13,9.62),(-0.57,9.57),(-0.24,9.08),(-0.62,8.86),(-1.10,9.08),(-1.43,8.66)]
poly_layer('Hero_hair',hair,-0.73,BLACK,C_HERO,outline=.06,depth=.10)
poly_layer('Hero_topknot',[(-1.2,9.52),(-1.18,10.12),(-0.78,10.36),(-0.45,10.08),(-0.58,9.60)],-0.57,BLACK,C_HERO,outline=.06,depth=.16)
poly('Hero_hair_streak',[(-1.43,9.32),(-1.14,9.60),(-0.92,9.52),(-1.22,9.18)],-0.82,0.05,CRIMSON,C_HERO)
poly('Hero_face_shadow',[(-1.42,8.18),(-0.93,7.73),(-0.58,8.10),(-0.66,8.47),(-1.05,8.36)],-0.80,0.04,VERMILION,C_HERO)
poly('Hero_brow',[(-1.36,8.65),(-0.95,8.73),(-0.68,8.62),(-0.88,8.53),(-1.33,8.55)],-0.84,0.045,INK,C_HERO)
poly('Hero_eye_white',[(-1.32,8.45),(-1.00,8.53),(-0.77,8.46),(-1.04,8.37)],-0.86,0.05,PAPER,C_HERO)
poly('Hero_pupil',[(-0.92,8.45),(-0.79,8.48),(-0.82,8.36),(-0.94,8.35)],-0.90,0.04,INK,C_HERO)
poly('Hero_nose',[(-0.72,8.36),(-0.55,8.18),(-0.77,8.16)],-0.87,0.04,INK,C_HERO); poly('Hero_mouth',[(-1.04,7.96),(-0.62,7.94),(-0.80,7.87),(-1.14,7.91)],-0.88,0.04,INK,C_HERO)
uv('Hero_ear',(-1.52,-0.86,8.35),(.16,.05,.22),AMBER,C_HERO)
poly_layer('Hero_raised_sleeve',[(-0.28,6.76),(0.28,7.18),(1.24,7.62),(1.58,8.16),(1.12,8.43),(0.38,7.95),(-0.38,7.43)],-0.62,NAVY,C_HERO,outline=.08,depth=.18)
poly_layer('Hero_raised_sleeve_stripe',[(0.42,7.34),(1.2,7.82),(1.45,8.13),(1.23,8.3),(0.65,7.91)],-0.75,AMBER,C_HERO,outline=.025,depth=.08)
poly_layer('Hero_raised_bracer',[(1.18,7.90),(1.73,8.13),(2.08,8.42),(1.75,8.76),(1.25,8.47)],-0.72,STEEL,C_HERO,outline=.05,depth=.12)
poly_layer('Hero_raised_hand',[(1.73,8.38),(2.08,8.44),(2.35,8.73),(2.12,8.96),(1.78,8.82),(1.58,8.56)],-0.82,DIRTY,C_HERO,outline=.035,depth=.10)
poly_layer('Hero_lower_sleeve',[(-2.05,6.18),(-2.55,5.88),(-2.2,5.25),(-1.05,4.86),(-0.35,5.35),(-0.70,5.90),(-1.42,6.38)],-0.66,CRIMSON,C_HERO,outline=.08,depth=.18)
poly_layer('Hero_lower_sleeve_fold',[(-2.2,5.62),(-1.2,5.08),(-0.72,5.35),(-1.45,5.92)],-0.78,ACID,C_HERO,outline=.02,depth=.07)
poly_layer('Hero_lower_bracer',[(-0.9,5.36),(-0.35,5.15),(0.14,5.35),(-0.08,5.75),(-0.62,5.78)],-0.82,STEEL,C_HERO,outline=.045,depth=.12)
poly_layer('Hero_lower_hand',[(-0.38,5.18),(0.10,5.16),(0.42,5.43),(0.18,5.70),(-0.33,5.57),(-0.56,5.34)],-0.90,DIRTY,C_HERO,outline=.03,depth=.10)
line_between('Hero_sword_sheath',(-2.05,-0.10,4.25),(0.18,-0.10,2.05),0.16,INK,C_HERO); line_between('Hero_sword_color',(-2.05,-0.22,4.25),(0.18,-0.22,2.05),0.085,CRIMSON,C_HERO); line_between('Hero_sword_edge',(-1.97,-0.28,4.30),(0.26,-0.28,2.12),0.025,DIRTY,C_HERO); cyl('Hero_sword_guard',(-2.05,-0.38,4.25),0.28,0.08,GOLD,C_HERO,rot=(pi/2,0,0),vertices=12)
line_between('hair_tie',(-0.98,-0.86,9.45),(-0.38,-0.86,9.62),0.045,ACID,C_HERO); poly_layer('robe_tab',[(-2.25,3.1),(-3.1,2.55),(-2.6,2.1),(-1.9,2.8)],-0.72,VERMILION,C_HERO,outline=.04,depth=.08)
for i,(a,b,ma) in enumerate([((2.03,-1.02,8.78),(3.9,-1.05,9.62),AMBER),((2.14,-1.08,8.65),(4.05,-1.12,9.45),DIRTY)]):
    line_between('Raised_chopstick_%02d_ink'%i,a,b,0.085,INK,C_HERO); line_between('Raised_chopstick_%02d'%i,(a[0],a[1]-0.05,a[2]),(b[0],b[1]-0.05,b[2]),0.033,ma,C_HERO)
for i,(a,b,ma) in enumerate([((0.05,-1.08,5.42),(1.25,-1.10,6.05),ACID),((0.20,-1.13,5.27),(1.42,-1.15,5.92),SODIUM)]):
    line_between('Lower_chopstick_%02d_ink'%i,a,b,0.075,INK,C_HERO); line_between('Lower_chopstick_%02d'%i,(a[0],a[1]-0.05,a[2]),(b[0],b[1]-0.05,b[2]),0.027,ma,C_HERO)

# ---------------- NOODLE CHOREOGRAPHY ----------------
shield=[]
for i in range(28):
    t=-0.45 + i*(2*pi+0.90)/27; shield.append((-0.55+2.02*cos(t),-1.34,6.15+1.62*sin(t)))
noodle('NOODLE_shield_coil',[(x,z) for x,y,z in shield],CHART,width=.105,y=-1.34,outline=.22,misreg=True)
arc=[]
for i in range(13):
    t=1.0+i*1.55/12; arc.append((-0.55+2.08*cos(t),6.15+1.68*sin(t)))
noodle('NOODLE_shield_red_arc',arc,VERMILION,width=.075,y=-1.52,outline=.14,misreg=True)
foreground=[(-10,1.10),(-8.2,1.30),(-6.6,2.2),(-5.1,3.6),(-3.4,5.25),(-1.0,6.18),(1.6,6.0),(4.0,4.65),(6.8,3.15),(10,2.85)]
noodle('NOODLE_foreground_whip',foreground,GOLD,width=.30,y=-3.0,outline=.48,misreg=True)
noodle('NOODLE_foreground_hotline',[(-9.0,1.38),(-6.4,2.3),(-4.9,3.6),(-2.7,5.2),(0.0,5.95),(2.7,5.5),(5.4,3.75),(8.9,2.9)],VERMILION,width=.075,y=-3.42,outline=.13)
raised=[(2.0,8.78),(2.7,9.15),(3.55,9.48),(4.7,9.12),(5.8,8.20),(6.65,6.95),(7.6,7.65),(8.9,8.7),(10.4,8.55)]
noodle('NOODLE_raised_lash',raised,ACID,width=.16,y=-1.55,outline=.29,misreg=True)
noodle('NOODLE_raised_lash_echo',[(x,z+0.22*sin(i/len(raised)*pi)) for i,(x,z) in enumerate(raised)],AMBER,width=.065,y=-1.66,outline=.12)
lasso=[(0.52,6.0),(1.8,6.9),(3.4,7.1),(5.2,6.55),(6.45,5.7),(7.2,5.85),(7.75,6.45),(7.25,7.0),(6.45,6.9),(6.1,6.2),(6.55,5.55),(7.6,5.35),(9.2,5.55)]
noodle('NOODLE_wrist_lasso',lasso,LIME,width=.105,y=-1.45,outline=.21,misreg=True)
blade=[(10.0,7.6),(9.4,7.35),(5.05,6.12),(5.18,6.35)]
poly_layer('Incoming_blade',blade,-1.05,DIRTY,C_FX,outline=.05,depth=.12); poly_layer('Incoming_blade_red_edge',blade,-1.16,CRIMSON,C_FX,scale=.995,depth=.035)
line_between('blade_highlight',(9.6,-1.24,7.37),(5.3,-1.24,6.28),0.035,PAPER,C_FX)
poly_layer('Opponent_forearm',[(10.0,5.0),(8.55,5.15),(7.55,5.75),(7.7,6.35),(8.9,6.55),(10.0,6.4)],-0.95,INDIGO,C_FX,outline=.10,depth=.20); uv('Opponent_wrist',(7.55,-1.14,6.0),(.52,.18,.42),CRIMSON,C_FX)
for j,(phase,ma) in enumerate([(0.0,AMBER),(pi/2,ACID),(pi,CREAM),(3*pi/2,VERMILION)]):
    pts=[]
    for i in range(22):
        t=i/21; pts.append((2.55+3.9*t,3.65+1.35*t+0.48*sin(t*5*pi+phase)))
    noodle('NOODLE_corkscrew_%02d'%j,pts,ma,width=.07 if j else .10,y=-1.55-0.03*j,outline=.15,misreg=(j==0))
high=[(1.55,8.7),(0.2,9.65),(-1.8,10.0),(-3.2,9.45),(-2.9,8.55),(-1.6,8.25),(-0.8,8.8),(-1.15,9.6),(-2.25,10.25),(-4.1,10.35),(-5.5,9.55)]
noodle('NOODLE_high_lasso',high,VERMILION,width=.105,y=-1.22,outline=.22,misreg=True)
wrap1=[(2.55,3.7),(1.25,4.25),(0.35,4.85),(-0.25,4.25),(-0.05,3.35),(0.9,2.92),(1.7,3.25)]; noodle('NOODLE_cart_wrap',wrap1,ACID,width=.075,y=-1.25,outline=.16)
wrap2=[(3.0,4.1),(4.4,4.5),(5.15,4.15),(4.8,3.3),(4.15,2.8),(4.8,2.1),(6.0,1.9)]; noodle('NOODLE_stool_wrap',wrap2,GOLD,width=.08,y=-1.2,outline=.17,misreg=True)
wrap3=[(-2.4,5.6),(-3.2,6.2),(-4.3,6.1),(-4.5,5.25),(-3.8,4.8),(-3.2,5.1)]; noodle('NOODLE_sign_wrap',wrap3,CYAN,width=.07,y=-1.2,outline=.15,misreg=True)
knot=[(-0.35,5.32),(-0.8,5.0),(-0.4,4.65),(0.3,4.82),(0.1,5.3),(-0.6,5.55),(-0.95,5.1),(-0.5,4.55),(0.25,4.35),(1.2,4.45)]; noodle('NOODLE_knot_split',knot,CHART,width=.065,y=-1.62,outline=.14,misreg=True)
crack=[(-7.5,7.2),(-5.8,7.55),(-4.1,7.35),(-2.4,7.65),(-0.6,8.0),(1.7,7.55),(3.6,7.05),(5.1,7.5),(6.8,7.2),(8.4,6.75),(9.8,6.9)]; noodle('NOODLE_crack_whip',crack,CRIMSON,width=.105,y=-2.15,outline=.23,misreg=True); noodle('NOODLE_crack_tip',[(8.2,6.75),(9.4,6.55),(10.2,6.1)],SODIUM,width=.05,y=-2.25,outline=.12,misreg=True)

# ---------------- BROTH + STEAM + DROPLETS ----------------
broth1=[(2.42,3.68),(2.05,4.25),(1.65,4.78),(1.83,5.23),(2.45,5.50),(3.0,5.3),(3.1,4.7),(2.78,4.2)]; broth2=[(2.7,3.7),(3.25,4.1),(3.78,4.35),(4.05,4.9),(3.85,5.45)]
noodle('BROTH_ribbon_A',broth1,GOLD,width=.145,y=-1.7,outline=.26,misreg=True); noodle('BROTH_ribbon_B',broth2,AMBER,width=.11,y=-1.72,outline=.22,misreg=True)
for i,(x,z,r,ma) in enumerate([(1.35,4.85,.11,GOLD),(1.1,5.4,.08,SODIUM),(3.2,5.95,.12,AMBER),(3.75,5.65,.07,GOLD),(4.35,5.15,.10,VERMILION),(0.55,4.2,.08,SODIUM),(4.75,4.7,.06,GOLD)]):
    uv('broth_drop_%02d'%i,(x,-1.92,z),(r,.065,r*1.15),INK,C_FX); uv('broth_drop_color_%02d'%i,(x,-2.0,z),(r*.62,.035,r*.75),ma,C_FX)
steam1=[(2.35,3.85),(1.95,4.35),(2.1,4.85),(2.7,5.05),(2.95,5.55),(2.55,6.05),(2.1,6.35)]; steam2=[(2.75,3.9),(3.25,4.45),(3.15,4.95),(2.75,5.35),(3.25,5.82),(3.9,6.0),(4.15,6.55)]; steam3=[(2.25,4.0),(1.6,4.6),(1.65,5.25),(1.25,5.75),(0.75,5.9)]
for i,(p,ma) in enumerate([(steam1,DIRTY),(steam2,CYAN),(steam3,CREAM)]): noodle('STEAM_calligraphic_%02d'%i,p,ma,width=.105,y=-1.48,outline=.19,misreg=True)
text_obj('Steam_glyph','湯',(3.65,-1.80,6.55),0.52,DIRTY,C_FX,shadow=True)

# ---------------- GRAPHIC MOTION / IMPACT / HALFTONE ----------------
def star_pts(cx,cz,r1,r2,n=10,phase=0): return [(cx+(r1 if i%2==0 else r2)*cos(phase+i*pi/n),cz+(r1 if i%2==0 else r2)*sin(phase+i*pi/n)) for i in range(2*n)]
for i,(cx,cz,ma) in enumerate([(6.35,6.15,SODIUM),(5.2,5.0,ACID),(-4.3,7.6,CRIMSON),(4.8,8.9,CYAN)]):
    poly('Impact_%02d_ink'%i,star_pts(cx,cz,.85,.28,9,phase=0.1),-1.85,.10,INK,C_FX); poly('Impact_%02d'%i,star_pts(cx,cz,.68,.20,9,phase=0.1),-1.92,.05,ma,C_FX)
for j in range(4):
    pts=[]
    for i in range(13):
        t=0.35+i*1.85/12; pts.append((-0.7+2.8*cos(t),-1.0-j*.03,6.2+2.1*sin(t)))
    curve_obj('motion_arc_%02d'%j,pts,0.025,[CYAN,AMBER,CRIMSON,ACID][j],C_FX,resolution=2)
for i in range(8):
    z=8.0-i*0.42; x0=-4.5+i*0.25; x1=4.7+i*0.45; line_between('speed_line_%02d'%i,(x0,-0.15,z),(x1,-0.15,z+0.12*sin(i)),0.018,DIRTY if i%2 else CYAN,C_FX)
for i,(x,z,ma) in enumerate([(-3.0,8.9,VERMILION),(4.9,9.4,CYAN),(8.5,7.0,ACID)]): box('stepped_echo_%02d'%i,(x+0.17,2.35,z+0.10),(1.1,0.04,.34),ma,C_FX,rot=(0,0,.08))
dots('halftone_shadow_left',(-2.6,3.25),2.8,1.55,0.34,0.052,INK,-0.72,C_FX,jitter=0.03); dots('halftone_shadow_right',(6.3,3.2),2.6,1.3,0.31,0.045,BLACK,-0.72,C_FX,jitter=0.02)
for x,z,ma in [(-10.8,10.9,CRIMSON),(10.8,10.8,CYAN),(-10.8,1.1,ACID),(10.8,1.0,AMBER)]:
    box('registration_block',(x,-2.2,z),(0.45,0.08,0.22),ma,C_FRAME); box('registration_block_offset',(x+0.10,-2.25,z+0.08),(0.45,0.06,0.22),CYAN if ma==CRIMSON else VERMILION,C_FRAME)
text_obj('SFX_SLURP','SLURP!',(-5.7,-1.1,8.0),0.45,SODIUM,C_FX,shadow=True); text_obj('SFX_KRACK','KRAK!',(6.5,-1.95,7.2),0.45,ACID,C_FX,shadow=True); text_obj('SFX_WHOOSH','ズズズ',(0.9,-1.95,10.15),0.38,CRIMSON,C_FX,shadow=True); text_obj('SFX_HISS','SHH!',(4.8,-1.92,6.7),0.34,CYAN,C_FX,shadow=True)

# ---------------- PANEL BORDER ----------------
box('Frame_left',(-11.65,-2.65,6.0),(0.42,0.25,12.7),INK,C_FRAME); box('Frame_right',(11.65,-2.65,6.0),(0.42,0.25,12.7),INK,C_FRAME); box('Frame_top',(0,-2.65,12.25),(23.7,0.25,0.42),INK,C_FRAME); box('Frame_bottom',(0,-3.0,0.25),(23.7,0.25,0.42),INK,C_FRAME)
box('Frame_left_red',(-11.42,-2.74,6.0),(0.06,0.05,12.3),VERMILION,C_FRAME); box('Frame_right_cyan',(11.42,-2.74,6.0),(0.06,0.05,12.3),CYAN,C_FRAME)
box('Title_tab',(-7.8,-2.8,11.75),(5.2,0.12,0.42),BLACK,C_FRAME); text_obj('Title_text','THE NOODLE WAY',(-7.8,-2.9,11.75),0.24,ACID,C_FRAME,shadow=False)

# Camera
bpy.ops.object.camera_add(location=(10.6,-29.5,8.0))
cam=bpy.context.object; cam.name='Camera_Presentation_ComicPanel'
def point_camera(obj, target):
    direction=Vector(target)-obj.location; obj.rotation_euler=direction.to_track_quat('-Z','Y').to_euler()
point_camera(cam,(-0.2,0.0,5.6)); cam.data.lens=54; cam.data.sensor_width=36; scene.camera=cam; link_obj(cam,C_FRAME)
for name,loc,energy,color,size in [('Key_sodium',(-2,-10,10),900,(1.0,0.24,0.05),8.0),('Rim_acid',(6,-4,10),700,(0.35,1.0,0.05),6.0),('Fill_crimson',(-8,-2,6),500,(1.0,0.02,0.02),5.0)]:
    bpy.ops.object.light_add(type='AREA', location=loc); l=bpy.context.object; l.name=name; l.data.energy=energy; l.data.color=color; l.data.shape='DISK'; l.data.size=size; point_camera(l,(0,0,5)); link_obj(l,C_FX)
bpy.ops.object.light_add(type='POINT',location=(2,-4,4)); l=bpy.context.object; l.name='Broth_point'; l.data.energy=80; l.data.color=(1.0,.28,.04); link_obj(l,C_CART)

scene['title']='THE NOODLE WAY — Ramen Samurai / Multicultural Night Market'
scene['description']='Stylized NPR action panel: improvised ramen martial art, noodle shield, broth ribbons, steam glyphs, multicultural cyberpunk market.'
scene['palette']='acid green / chartreuse / amber / sodium orange / crimson / selective cyan / indigo / brown-black'
scene['graphic_language']='ink outlines, halftone dots, misregistered print layers, hard flats, motion glyphs'
bpy.context.view_layer.objects.active=cam; cam.select_set(True)
scene.render.filepath='/tmp/ramen_samurai_preview.png'
bpy.ops.wm.save_as_mainfile(filepath='/tmp/ramen_samurai.blend')
result={'objects':len(scene.objects),'materials':len(bpy.data.materials),'camera':cam.name,'blend':'/tmp/ramen_samurai.blend'}


Error executing tool execute_blender_code: Blender connection timed out at localhost:9876


[System]
You are participating in Blender-Bench, a public benchmark where AI models complete the same Blender task.

Your result will be compared head-to-head with another model. Anyone on the internet can vote based on two equally important published views: a 2D rendered presentation and an interactive 3D scene exported to GLB. Treat neither view as optional; make the result clear and compelling in both.

Complete the request as well as you can. The benchmark does not prescribe a workflow or visual style; use whichever Blender techniques you consider appropriate. Make the important requirements evident in the published result, save a complete scene, and present the work clearly in every requested output.

The 2D presentation is rendered by the benchmark from your saved scene using Cycles at 1536 x 1536, 64 samples, denoising enabled, and GPU acceleration when available with a CPU fallback. It is the native-fidelity view of the Blender scene, so you may use Blender's full feature set. Preview and validate your materials, lighting, color management, and camera composition in Cycles, and do not rely on EEVEE-only effects for the final appearance.

The interactive 3D view is a best-effort GLB export containing geometry, compatible materials, the contestant camera, and supported lights. Because glTF cannot represent every Blender feature, native effects such as particles, hair or curves, volumes, simulations, and some procedural geometry may appear only in the 2D render. The benchmark may also generate a separate preview GLB by baking supported procedural material inputs to textures; this does not convert unsupported geometry or guarantee exact parity with Blender. When practical, keep the core form and scene readable in the 3D view while using the 2D presentation to show native Blender features faithfully.

## Harness Instructions

You are operating Blender through the provided tools. Tool calls execute one at a time, in the order you issue them, against a single live Blender instance — each call sees the state left by the previous one, and issuing several calls in one message gains no parallelism. The scene starts empty. Build what the user's prompt asks for in the current scene. Work step by step and verify your own work.

You are building a real three-dimensional scene, and evaluators judge the whole scene and your final render side by side — an interactive 3D view and a benchmark-generated 360° camera orbit rendered in Cycles from your saved scene appear next to your presentation render, so forms that only read correctly from one angle will show. Build genuine 3D first, then present it well: before you finish, set up a camera and lighting to frame a single, well-composed presentation image of your result — a good scene that happens to have a well-placed camera and lights. The final benchmark capture overrides the scene render settings and renders in Cycles at 1536x1536, 64 samples, with denoising and GPU acceleration (CPU fallback). Preview and validate materials, lighting, color management, and composition in Cycles; do not rely on EEVEE-only effects. Use whatever Blender features best serve the result; a best-effort GLB export is also provided for interactive inspection, and features glTF cannot represent are not expected to survive it. When you are finished, reply with the single word DONE and no tool calls.

[User]
## Task

Complete the following Blender task:

<task>

One frame from an animated cyberpunk comic that never existed: the Ramen Samurai fighting in a dense multicultural night market, using noodles, broth, steam, bowls, and chopsticks as an improvised martial art. The image should feel like a lost action panel from an aggressively stylized animated graphic novel — playful, kinetic, urban, and unmistakably non-photoreal.

The visual language should lean toward the graphic energy of Into the Spider-Verse without directly copying any single frame: exaggerated perspective, layered ink outlines, halftone shadows, displaced color channels, stepped animation-like poses, screen-tone textures, hand-painted flats, graphic motion shapes, and deliberately imperfect print registration. The final image must look illustrated, printed, and composited from multiple graphic systems rather than rendered with realistic materials.

The setting is a multicultural cyberpunk street district inspired by the lived-in density of Blade Runner and broader global megacity nightlife. Japanese ramen signage shares the frame with Korean hangul, Chinese characters, Arabic storefront lettering, Spanish hand-painted signs, English advertising fragments, South Asian food stalls, improvised electronics, delivery bikes, hanging cables, patched awnings, vending machines, lanterns, and crowded architectural layers. The environment should feel culturally mixed and organically accumulated, not like a generic “Asian neon alley.”

Color palette. Avoid a scene dominated by pink and blue. Use a much wider neon spectrum:

- acid green and chartreuse signage
- amber, tungsten orange, and sodium-vapor yellow
- deep crimson and vermilion lantern light
- cyan used selectively rather than everywhere
- violet and magenta only as secondary accents
- turquoise, lime, dirty white, electric red, and occasional ultraviolet highlights
- dark indigo, brown-black, and muted concrete tones as grounding colors

The competing colors should overlap through hard-edged graphic light zones rather than smooth realistic illumination. Different signs should create separate color regions across the character and environment. The samurai’s face should remain readable and controlled, with the most intense chromatic misregistration pushed toward the edges of the frame and fast-moving noodle attacks.

The Ramen Samurai. A sharp graphic silhouette: layered street robes mixed with partial samurai armor, practical cyberpunk additions, tied-back hair or topknot, and a sheathed sword still present but clearly secondary. He should not primarily fight with the sword. His entire fighting style is built around ramen preparation transformed into combat.

The noodle fighting style must dominate the image. Long noodles spiral around him in multiple active trajectories, forming whips, loops, lassos, coils, snapping arcs, defensive rings, and striking tendrils. Some noodles wrap around an opponent’s weapon outside the frame; others lash toward silhouettes at the edge of the panel. A broad ribbon of noodles should sweep through the foreground with extreme foreshortening. Chopsticks are used like paired control batons, directing the noodle movement with precise martial gestures.

The noodles should not merely float decoratively. They must visibly perform actions:

- one strand catches or redirects an incoming blade
- one loop binds an unseen opponent’s wrist
- one noodle whip cracks across the foreground
- one circular coil forms a shield around the samurai
- several strands trail broth droplets like motion sparks
- one bundle launches from the bowl in a corkscrew attack
- loose noodles knot, split, reconnect, and change direction around obstacles
- noodles wrap around signs, stools, lantern poles, and the ramen cart, making the whole environment part of the choreography

The broth also participates in the combat. It erupts from the bowl in stylized golden-orange arcs, rendered as painted ribbon shapes with halftone droplets and graphic splash bursts. Steam forms bold calligraphic strokes, creature-like curls, and directional glyphs that echo the movement of the noodles. The bowl may rotate or slide across the counter like a spinning weapon platform while remaining readable as a ramen bowl.

The pose should capture a single decisive instant: one hand raised with chopsticks controlling a wide noodle lash, the other hand redirecting a second strand close to the body. His torso twists sharply, robes and armor breaking into angular motion shapes. His eyes lock toward an opponent outside the frame. The body should read clearly even in silhouette, with a strong line of action and no static seated pose.

Composition. Use an extreme comic-book camera: slightly low angle, close enough that the foreground noodle attack crosses the lens, with the samurai placed off-center. Leave open negative space toward the direction of attack so the noodles can travel through the panel. The ramen cart, bowl, signs, and surrounding market should frame the action without competing with the character.

Graphic devices should be built into the scene:

- thick-to-thin ink outlines
- coarse halftone shadows
- offset red, yellow, green, and cyan print layers around moving forms
- repeated animation-smear noodle silhouettes
- panel-breaking noodle strands crossing the border
- angular impact bursts where noodles strike objects
- small printed sound-effect glyphs integrated into signs and steam
- screen-tone gradients instead of smooth shading
- hard two- or three-step lighting
- selective frame tearing and displaced color blocks
- motion lines that follow the circular noodle choreography
- occasional misaligned background duplicates suggesting stepped animation frames

The main image should feel even more NPR than a conventional comic render. Avoid realistic reflections, smooth plastic materials, cinematic depth of field, physically accurate fog, glossy ray-traced surfaces, or ordinary 3D shading. Every visible element should be simplified into bold color groups, drawn contour logic, printed texture, or graphic pattern.

The scene should communicate instantly: this is a Ramen Samurai in a multicultural cyberpunk city, and ramen itself is his weapon, shield, movement system, and fighting discipline.

</task>

[Tool]
{
  "status": "error",
  "message": "Traceback (most recent call last):\n  File \"<repo>\\.runner\\blender-mcp-v1.0.0\\addon\\mcp_to_blender_server.py\", line 230, in _execute_code\n    exec(code, namespace)\n    ~~~~^^^^^^^^^^^^^^^^^\n  File \"<string>\", line 6, in <module>\n  File \"<repo>\\.runner\\blender-mcp-v1.0.0\\addon\\weak_sandbox.py\", line 127, in _blocked\n    raise RuntimeError(\n    ...<3 lines>...\n    )\nRuntimeError: Operator 'bpy.ops.wm.read_factory_settings(use_empty=True)' is not allowed in LLM-generated code: Resets all user preferences and startup file, use bpy.ops.wm.read_homefile() or bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True) instead\n"
}

[Tool]
{
  "status": "error",
  "message": "Traceback (most recent call last):\n  File \"<repo>\\.runner\\blender-mcp-v1.0.0\\addon\\mcp_to_blender_server.py\", line 230, in _execute_code\n    exec(code, namespace)\n    ~~~~^^^^^^^^^^^^^^^^^\n  File \"<string>\", line 8, in <module>\nTypeError: bpy_struct: item.attr = val: enum \"BLENDER_EEVEE_NEXT\" not found in ('BLENDER_EEVEE', 'BLENDER_WORKBENCH', 'CYCLES')\n"
}

[Tool] Error executing tool execute_blender_code: Blender connection timed out at localhost:9876

        Execute Python code in the connected Blender instance.

        The code runs in Blender's Python environment with full access to ``bpy``.
        To return data, assign a JSON-serialisable dict to a variable named ``result``.
        Deferred completion via ``check_is_finished`` is only supported by the
        interactive addon server, and is rejected in background mode.

Code

execute_blender_codeArguments

        Execute Python code in a background Blender process.

        Opens *blend_file* with ``blender --background`` and runs *code*.
        Assign a dict to ``result`` to return data.

Blend File

Code

execute_blender_code_for_cliArguments

Return a summary of the blend file: data-block counts, active workspace, and render engine.

get_blendfile_summary_datablocksArguments

Return a data-block summary by opening *blend_file* in background Blender.

Blend File

get_blendfile_summary_datablocks_for_cliArguments

        Report external file references that are missing from disk
        (images, libraries, fonts, sounds, movie clips, caches, sequences).

get_blendfile_summary_missing_filesArguments

Report missing file references by opening *blend_file* in background Blender.

Blend File

get_blendfile_summary_missing_files_for_cliArguments

Return a tree of directly and indirectly linked library files.

get_blendfile_summary_of_linked_librariesArguments

Return linked-library info by opening *blend_file* in background Blender.

Blend File

get_blendfile_summary_of_linked_libraries_for_cliArguments

Simple/fast access to the blend file's path, save status, age, and backups.

get_blendfile_summary_path_infoArguments

Return path info by opening *blend_file* in background Blender.

Blend File

get_blendfile_summary_path_info_for_cliArguments

Guess the primary use-cases of the current blend file (scored 0-100 with certainty).

get_blendfile_summary_usage_guessArguments

Guess use-cases by opening *blend_file* in background Blender.

Blend File

get_blendfile_summary_usage_guess_for_cliArguments

        Return a structured summary of the object identified by *name*.

        Includes type, transforms, parent, children, modifiers, constraints,
        materials, visibility, data-block name, and collections.

Name

get_object_detail_summaryArguments

        Return the scene's collection hierarchy and their objects.

        Each collection lists its objects (name, type, parent, data name,
        selection, visibility) and nested child collections.

get_objects_summaryArguments

        Return the Blender Python API docs for *identifier*, or list
        modules matching a trailing-``*`` discovery pattern.

        *identifier* should be a fully-qualified Python name (e.g.
        ``bpy.app`` or ``bpy.types.Scene.frame_current``).
        The trailing-``*`` forms are supported as discovery entry-points:

        - ``*`` enumerates the top-level modules (``bpy``, ``bmesh``,
          ``mathutils``, ``gpu``, ...).
        - ``X.*`` enumerates the direct-child identifiers under the
          *X* namespace (``bpy.*`` -> ``bpy.app``, ``bpy.context``, ...).

        Both return a ``namespace`` response even when ``X.rst`` would
        otherwise resolve to ``exact``; the ``.*`` form lets an agent
        force the child listing.

        The response always carries ``kind``, ``found``, and ``identifier``.
        The remaining keys depend on ``kind``:

        - ``"exact"`` (``found=True``): ``<identifier>.rst`` was read.
          Extra keys: ``content`` (RST text), ``examples``. When the
          file exceeds 32 KB, ``content`` is replaced with a dot-point
          summary of the file's top-level definitions (prefixed by a
          header noting the truncation) and ``examples`` is empty -
          re-query individual members for their rendered blocks.
        - ``"namespace"`` (``found=True``):
          no ``<identifier>.rst`` but ``<identifier>.<child>.rst`` siblings exist.
          Extra key: ``submodules`` (list of child identifiers).
        - ``"definition"`` (``found=True``):
          *identifier* is defined inside a parent RST
          (e.g. ``bpy.props.IntProperty`` lives in ``bpy.props.rst``).
          Extra keys: ``content`` (rendered block), ``examples``.
        - ``"partial"`` (``found=False``):
          the parent RST was located but the trailing component isn't defined in it.
          Extra keys:
          - ``parent`` the identifier whose RST was loaded.
          - ``available`` top-level definitions in that RST.
          - ``submodules`` sibling identifiers ``<parent>.<child>`` with their own RSTs,
            filtered to those whose last component contains every character of the missing tail.

          For a toctree landing page like ``bpy.types`` ``available`` is empty and ``submodules``
          is the near-miss list; for a self-contained module like ``bpy.props`` it's the reverse.
        - ``"suggestions"`` (``found=False``):
          no direct match, but *identifier* appears as a component of other files.
          Extra key: ``suggestions`` (list of full identifiers).
        - ``"missing"`` (``found=False``): nothing matched.

        ``examples`` (present on the ``exact`` and ``definition`` kinds)
        is a list of ``{path, content}`` entries referenced from this documentation.

Identifier

get_python_api_docsArguments

        Take a screenshot of a single Blender area and return it as a PNG image.

        *area_ui_type* matches the area's ``ui_type``.

        *size_limit_in_bytes* caps the image size in bytes.
        Zero (the default) uses the MCP message size limit.

Area Ui Type

Size Limit In Bytes

get_screenshot_of_area_as_imageArguments

        Take a screenshot of the entire Blender window and return it as a PNG image.

        *size_limit_in_bytes* caps the image size in bytes.
        Zero (the default) uses the MCP message size limit.

Size Limit In Bytes

get_screenshot_of_window_as_imageArguments

Return a JSON description of the Blender window layout, areas, active object, and selection.

get_screenshot_of_window_as_jsonArguments

Switch the active workspace tab to *name*.

Name

jump_to_tab_by_nameArguments

        Switch to a workspace whose main area matches *space_type*.

        If *allow_edits* is True and no matching workspace exists, a new one
        is created by duplicating the current workspace.

Space Type

Allow Edits

jump_to_tab_by_space_typeArguments

        Move the 3D viewport to focus on an object by *name*.

        If *allow_edits* is True the object may be un-hidden and its
        collections enabled to make it visible.

Name

Allow Edits

        Move the 3D viewport to the object whose data block matches *name*.

        If *allow_edits* is True the object may be un-hidden and its
        collections enabled to make it visible.

Name

Allow Edits

Render a small, low-quality thumbnail to *output_path* (temporarily overrides settings).

Output Path

render_thumbnail_to_pathArguments

Render the current scene to *output_path* using current render settings.

Output Path

render_viewport_to_pathArguments

Full-text search over the bundled Blender Python API reference.

Returns a ranked list of hits. Each hit has:

- ``path``: file path relative to the bundled docs.
- ``text``: the matching paragraph plus ``context``
  paragraphs on either side.
- ``breadcrumb``: the section path containing the hit
  (``Section > Sub-section > ...``).
- ``index``: the hit's position in the result list.
- ``score``: a relevance score; higher is better.

The query is tokenised on whitespace and matched
case-insensitively. Every token must appear somewhere in
the paragraph body, the file path, or an enclosing section
title - in any order. Common English stop-words (``the``,
``a``, ``how``, ``to``, ...) are dropped, so natural
phrasings like ``"how to bake"`` work as expected. Regular
expressions are not supported.

Use ``context`` to pull more surrounding paragraphs into
each hit (symmetric, default 0). Use ``index`` with the
position of a previous hit (same query) to get that hit
alone with its text widened to its enclosing section.

Read-only; consults bundled RST files only.

Query

Max Results

Context

Index

search_api_docsArguments

Full-text search over the bundled Blender user manual.

Returns a ranked list of hits. Each hit has:

- ``path``: file path relative to the bundled docs.
- ``text``: the matching paragraph plus ``context``
  paragraphs on either side.
- ``breadcrumb``: the section path containing the hit
  (``Section > Sub-section > ...``).
- ``index``: the hit's position in the result list.
- ``score``: a relevance score; higher is better.

The query is tokenised on whitespace and matched
case-insensitively. Every token must appear somewhere in
the paragraph body, the file path, or an enclosing section
title - in any order. Common English stop-words (``the``,
``a``, ``how``, ``to``, ...) are dropped, so natural
phrasings like ``"how to bake"`` work as expected. Regular
expressions are not supported.

Use ``context`` to pull more surrounding paragraphs into
each hit (symmetric, default 0). Use ``index`` with the
position of a previous hit (same query) to get that hit
alone with its text widened to its enclosing section.

Read-only; consults bundled RST files only.

Query

Max Results

Context

Index

search_manual_docsArguments

[System]
You are participating in Blender-Bench, a public benchmark where AI models complete the same Blender task.

Your result will be compared head-to-head with another model. Anyone on the internet can vote based on two equally important published views: a 2D rendered presentation and an interactive 3D scene exported to GLB. Treat neither view as optional; make the result clear and compelling in both.

Complete the request as well as you can. The benchmark does not prescribe a workflow or visual style; use whichever Blender techniques you consider appropriate. Make the important requirements evident in the published result, save a complete scene, and present the work clearly in every requested output.

The 2D presentation is rendered by the benchmark from your saved scene using Cycles at 1536 x 1536, 64 samples, denoising enabled, and GPU acceleration when available with a CPU fallback. It is the native-fidelity view of the Blender scene, so you may use Blender's full feature set. Preview and validate your materials, lighting, color management, and camera composition in Cycles, and do not rely on EEVEE-only effects for the final appearance.

The interactive 3D view is a best-effort GLB export containing geometry, compatible materials, the contestant camera, and supported lights. Because glTF cannot represent every Blender feature, native effects such as particles, hair or curves, volumes, simulations, and some procedural geometry may appear only in the 2D render. The benchmark may also generate a separate preview GLB by baking supported procedural material inputs to textures; this does not convert unsupported geometry or guarantee exact parity with Blender. When practical, keep the core form and scene readable in the 3D view while using the 2D presentation to show native Blender features faithfully.

## Harness Instructions

You are operating Blender through the provided tools. Tool calls execute one at a time, in the order you issue them, against a single live Blender instance — each call sees the state left by the previous one, and issuing several calls in one message gains no parallelism. The scene starts empty. Build what the user's prompt asks for in the current scene. Work step by step and verify your own work.

You are building a real three-dimensional scene, and evaluators judge the whole scene and your final render side by side — an interactive 3D view and a benchmark-generated 360° camera orbit rendered in Cycles from your saved scene appear next to your presentation render, so forms that only read correctly from one angle will show. Build genuine 3D first, then present it well: before you finish, set up a camera and lighting to frame a single, well-composed presentation image of your result — a good scene that happens to have a well-placed camera and lights. The final benchmark capture overrides the scene render settings and renders in Cycles at 1536x1536, 64 samples, with denoising and GPU acceleration (CPU fallback). Preview and validate materials, lighting, color management, and composition in Cycles; do not rely on EEVEE-only effects. Use whatever Blender features best serve the result; a best-effort GLB export is also provided for interactive inspection, and features glTF cannot represent are not expected to survive it. When you are finished, reply with the single word DONE and no tool calls.

[User]
## Task

Complete the following Blender task:

<task>

One frame from an animated cyberpunk comic that never existed: the Ramen Samurai fighting in a dense multicultural night market, using noodles, broth, steam, bowls, and chopsticks as an improvised martial art. The image should feel like a lost action panel from an aggressively stylized animated graphic novel — playful, kinetic, urban, and unmistakably non-photoreal.

The visual language should lean toward the graphic energy of Into the Spider-Verse without directly copying any single frame: exaggerated perspective, layered ink outlines, halftone shadows, displaced color channels, stepped animation-like poses, screen-tone textures, hand-painted flats, graphic motion shapes, and deliberately imperfect print registration. The final image must look illustrated, printed, and composited from multiple graphic systems rather than rendered with realistic materials.

The setting is a multicultural cyberpunk street district inspired by the lived-in density of Blade Runner and broader global megacity nightlife. Japanese ramen signage shares the frame with Korean hangul, Chinese characters, Arabic storefront lettering, Spanish hand-painted signs, English advertising fragments, South Asian food stalls, improvised electronics, delivery bikes, hanging cables, patched awnings, vending machines, lanterns, and crowded architectural layers. The environment should feel culturally mixed and organically accumulated, not like a generic “Asian neon alley.”

Color palette. Avoid a scene dominated by pink and blue. Use a much wider neon spectrum:

- acid green and chartreuse signage
- amber, tungsten orange, and sodium-vapor yellow
- deep crimson and vermilion lantern light
- cyan used selectively rather than everywhere
- violet and magenta only as secondary accents
- turquoise, lime, dirty white, electric red, and occasional ultraviolet highlights
- dark indigo, brown-black, and muted concrete tones as grounding colors

The competing colors should overlap through hard-edged graphic light zones rather than smooth realistic illumination. Different signs should create separate color regions across the character and environment. The samurai’s face should remain readable and controlled, with the most intense chromatic misregistration pushed toward the edges of the frame and fast-moving noodle attacks.

The Ramen Samurai. A sharp graphic silhouette: layered street robes mixed with partial samurai armor, practical cyberpunk additions, tied-back hair or topknot, and a sheathed sword still present but clearly secondary. He should not primarily fight with the sword. His entire fighting style is built around ramen preparation transformed into combat.

The noodle fighting style must dominate the image. Long noodles spiral around him in multiple active trajectories, forming whips, loops, lassos, coils, snapping arcs, defensive rings, and striking tendrils. Some noodles wrap around an opponent’s weapon outside the frame; others lash toward silhouettes at the edge of the panel. A broad ribbon of noodles should sweep through the foreground with extreme foreshortening. Chopsticks are used like paired control batons, directing the noodle movement with precise martial gestures.

The noodles should not merely float decoratively. They must visibly perform actions:

- one strand catches or redirects an incoming blade
- one loop binds an unseen opponent’s wrist
- one noodle whip cracks across the foreground
- one circular coil forms a shield around the samurai
- several strands trail broth droplets like motion sparks
- one bundle launches from the bowl in a corkscrew attack
- loose noodles knot, split, reconnect, and change direction around obstacles
- noodles wrap around signs, stools, lantern poles, and the ramen cart, making the whole environment part of the choreography

The broth also participates in the combat. It erupts from the bowl in stylized golden-orange arcs, rendered as painted ribbon shapes with halftone droplets and graphic splash bursts. Steam forms bold calligraphic strokes, creature-like curls, and directional glyphs that echo the movement of the noodles. The bowl may rotate or slide across the counter like a spinning weapon platform while remaining readable as a ramen bowl.

The pose should capture a single decisive instant: one hand raised with chopsticks controlling a wide noodle lash, the other hand redirecting a second strand close to the body. His torso twists sharply, robes and armor breaking into angular motion shapes. His eyes lock toward an opponent outside the frame. The body should read clearly even in silhouette, with a strong line of action and no static seated pose.

Composition. Use an extreme comic-book camera: slightly low angle, close enough that the foreground noodle attack crosses the lens, with the samurai placed off-center. Leave open negative space toward the direction of attack so the noodles can travel through the panel. The ramen cart, bowl, signs, and surrounding market should frame the action without competing with the character.

Graphic devices should be built into the scene:

- thick-to-thin ink outlines
- coarse halftone shadows
- offset red, yellow, green, and cyan print layers around moving forms
- repeated animation-smear noodle silhouettes
- panel-breaking noodle strands crossing the border
- angular impact bursts where noodles strike objects
- small printed sound-effect glyphs integrated into signs and steam
- screen-tone gradients instead of smooth shading
- hard two- or three-step lighting
- selective frame tearing and displaced color blocks
- motion lines that follow the circular noodle choreography
- occasional misaligned background duplicates suggesting stepped animation frames

The main image should feel even more NPR than a conventional comic render. Avoid realistic reflections, smooth plastic materials, cinematic depth of field, physically accurate fog, glossy ray-traced surfaces, or ordinary 3D shading. Every visible element should be simplified into bold color groups, drawn contour logic, printed texture, or graphic pattern.

The scene should communicate instantly: this is a Ramen Samurai in a multicultural cyberpunk city, and ramen itself is his weapon, shield, movement system, and fighting discipline.

</task>

[Tool]
{
  "status": "error",
  "message": "Traceback (most recent call last):\n  File \"<repo>\\.runner\\blender-mcp-v1.0.0\\addon\\mcp_to_blender_server.py\", line 230, in _execute_code\n    exec(code, namespace)\n    ~~~~^^^^^^^^^^^^^^^^^\n  File \"<string>\", line 6, in <module>\n  File \"<repo>\\.runner\\blender-mcp-v1.0.0\\addon\\weak_sandbox.py\", line 127, in _blocked\n    raise RuntimeError(\n    ...<3 lines>...\n    )\nRuntimeError: Operator 'bpy.ops.wm.read_factory_settings(use_empty=True)' is not allowed in LLM-generated code: Resets all user preferences and startup file, use bpy.ops.wm.read_homefile() or bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True) instead\n"
}

[Tool]
{
  "status": "error",
  "message": "Traceback (most recent call last):\n  File \"<repo>\\.runner\\blender-mcp-v1.0.0\\addon\\mcp_to_blender_server.py\", line 230, in _execute_code\n    exec(code, namespace)\n    ~~~~^^^^^^^^^^^^^^^^^\n  File \"<string>\", line 8, in <module>\nTypeError: bpy_struct: item.attr = val: enum \"BLENDER_EEVEE_NEXT\" not found in ('BLENDER_EEVEE', 'BLENDER_WORKBENCH', 'CYCLES')\n"
}

[Tool] Error executing tool execute_blender_code: Blender connection timed out at localhost:9876

Code

execute_blender_codeArguments

Blend File

Code

execute_blender_code_for_cliArguments

get_blendfile_summary_datablocksArguments

Blend File

Blend File

Blend File

get_blendfile_summary_path_infoArguments

Blend File

get_blendfile_summary_usage_guessArguments

Blend File

Name

get_object_detail_summaryArguments

get_objects_summaryArguments

Identifier

get_python_api_docsArguments

Area Ui Type

Size Limit In Bytes

get_screenshot_of_area_as_imageArguments

Size Limit In Bytes

get_screenshot_of_window_as_imageArguments

get_screenshot_of_window_as_jsonArguments

Switch the active workspace tab to *name*.

Name

jump_to_tab_by_nameArguments

Space Type

Allow Edits

jump_to_tab_by_space_typeArguments

Name

Allow Edits

Name

Allow Edits

Output Path

render_thumbnail_to_pathArguments

Output Path

render_viewport_to_pathArguments

Query

Max Results

Context

Index

search_api_docsArguments

Query

Max Results

Context

Index

search_manual_docsArguments

payment=(self "https://checkout.stripe.com" "https://connect-js.stripe.com" "https://js.stripe.com" "https://*.js.stripe.com" "https://hooks.stripe.com")