import bpy
from mathutils import Vector
from math import pi,sin,cos
scene=bpy.context.scene; C={n:bpy.data.collections[n] for n in ['ARCHITECTURE','SIGNS','CART','HERO','NOODLES','FX','FRAME']}; MM=bpy.data.materials
M={'INK':MM['INK'],'BLACK':MM['BROWN_BLACK'],'INDIGO':MM['DEEP_INDIGO'],'NAVY':MM['NAVY_ROBE'],'CONCRETE':MM['MUTED_CONCRETE'],'BROWN':MM['AGED_BROWN'],'STEEL':MM['DULL_STEEL'],'PAPER':MM['DIRTY_WHITE'],'ACID':MM['ACID_GREEN'],'CHART':MM['CHARTREUSE'],'LIME':MM['LIME'],'AMBER':MM['AMBER'],'SODIUM':MM['SODIUM_YELLOW'],'GOLD':MM['BROTH_GOLD'],'RED':MM['VERMILION'],'CRIMSON':MM['CRIMSON'],'CYAN':MM['SELECTIVE_CYAN'],'TURQ':MM['TURQUOISE'],'VIOLET':MM['ULTRAVIOLET']}
def link(o,c):
 for q in list(o.users_collection):q.objects.unlink(o)
 c.objects.link(o);return o
def mesh_obj(n,v,f,m,c):
 me=bpy.data.meshes.new(n+'_mesh');me.from_pydata(v,[],f);me.update();o=bpy.data.objects.new(n,me);c.objects.link(o);o.data.materials.append(m);return o
def prism(n,p,y,d,m,c,ol=0):
 if ol:
  cx=sum(x for x,z in p)/len(p);cz=sum(z for x,z in p)/len(p);prism(n+'_INK',[(cx+(x-cx)*(1+ol),cz+(z-cz)*(1+ol)) for x,z in p],y+.06,d+.07,M['INK'],c)
 N=len(p);v=[(x,y-d/2,z) for x,z in p]+[(x,y+d/2,z) for x,z in p];f=[tuple(range(N-1,-1,-1)),tuple(range(N,2*N))]+[(i,(i+1)%N,N+(i+1)%N,N+i)for i in range(N)];return mesh_obj(n,v,f,m,c)
def cube(n,l,s,m,c):
 x,y,z=[q/2 for q in s];v=[(-x,-y,-z),(x,-y,-z),(x,y,-z),(-x,y,-z),(-x,-y,z),(x,-y,z),(x,y,z),(-x,y,z)];f=[(0,1,2,3),(4,7,6,5),(0,4,5,1),(1,5,6,2),(2,6,7,3),(4,0,3,7)];return mesh_obj(n,[(a+l[0],b+l[1],d+l[2])for a,b,d in v],f,m,c)
def tube(n,pts,r,m,c,seg=8):
 v=[];f=[]
 for i,(x,y,z) in enumerate(pts):
  t=Vector((pts[min(i+1,len(pts)-1)][0]-pts[max(i-1,0)][0],0,pts[min(i+1,len(pts)-1)][2]-pts[max(i-1,0)][2]));t=t.normalized()if t.length else Vector((1,0,0));nn=Vector((-t.z,0,t.x));b=Vector((0,1,0))
  for j in range(seg):a=2*pi*j/seg;v.append(tuple(Vector((x,y,z))+r*(cos(a)*nn+sin(a)*b)))
 for i in range(len(pts)-1):
  for j in range(seg):f.append((i*seg+j,i*seg+(j+1)%seg,(i+1)*seg+(j+1)%seg,(i+1)*seg+j))
 f += [tuple(range(seg-1,-1,-1)),tuple((len(pts)-1)*seg+j for j in range(seg))];return mesh_obj(n,v,f,m,c)
def line(n,a,b,r,m,c):
 a=Vector(a);b=Vector(b);o=cube(n,(a+b)/2,(r*2,r*2,(b-a).length),m,c);o.rotation_mode='QUATERNION';o.rotation_quaternion=(b-a).to_track_quat('Z','Y');return o
def sphere(n,l,s,m,c):
 bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=1,radius=1,location=l);o=bpy.context.object;o.name=n;o.scale=s;o.data.materials.append(m);return link(o,c)
def noodle(n,p,m,w=.1,y=-1.0,mis=False):
 pts=[(x,y,z)for x,z in p];tube(n+'_INK',pts,w*2,M['INK'],C['NOODLES']);
 if mis:tube(n+'_CYAN',[(x+.07,y+.03,z+.03)for x,y,z in pts],w*.72,M['CYAN'],C['NOODLES']);tube(n+'_RED',[(x-.06,y+.04,z-.02)for x,y,z in pts],w*.68,M['RED'],C['NOODLES'])
 return tube(n,pts,w,m,C['NOODLES'])
# hero feet robe torso
prism('HERO_BACK_FOOT',[(-2.7,.7),(-1.4,.7),(-.7,1.1),(-1,1.5),(-2.3,1.4),(-2.9,1.0)],-.4,M['CRIMSON'],C['HERO'],.06)
prism('HERO_FRONT_FOOT',[(-.2,.7),(1.2,.7),(1.8,1.1),(1.4,1.5),(.3,1.45),(-.3,1.05)],-.42,M['AMBER'],C['HERO'],.06)
robe=[(-2.3,4.4),(-1.7,5),(-.5,4.3),(.2,3.5),(1.45,1.5),(.5,1.1),(-.7,1.3),(-1.4,1),(-2.9,1.3),(-2.6,2.6),(-3.1,3.35)]
prism('HERO_ROBE',robe,-.25,.3,M['NAVY'],C['HERO'],.10);prism('HERO_ROBE_RED',[(-1.5,4.3),(-.6,4.05),(.2,3.4),(.95,1.6),(.4,1.3),(-.2,2.5),(-2,3.55)],-.45,.12,M['CRIMSON'],C['HERO'],.02);prism('HERO_ROBE_ACID',[(-2.45,3.35),(-1.6,3.8),(-1.15,3.35),(-1.5,1.3),(-2.65,1.4)],-.5,.1,M['ACID'],C['HERO'],.03)
body=[(-2.35,4.1),(-2.1,6.85),(-1.25,7.45),(-.2,7.35),(.65,6.4),(.25,4.2),(-.55,3.65)]
prism('HERO_TORSO',body,-.3,.32,M['NAVY'],C['HERO'],.10);prism('HERO_TORSO_RED',[(x-.08,z+.02)for x,z in body],-.18,.1,M['RED'],C['FX']);prism('HERO_TORSO_CYAN',[(x+.08,z-.02)for x,z in body],-.2,.08,M['CYAN'],C['FX'])
# armor plates
prism('CHEST_ARMOR',[(-1.75,6.7),(-.7,7.05),(.1,6.4),(-.2,5.4),(-1.5,5.6)],-.55,.14,M['STEEL'],C['HERO'],.06);prism('CHEST_RED',[(-1.55,6.55),(-.75,6.83),(-.15,6.35),(-.38,5.72),(-1.3,5.85)],-.64,.08,M['CRIMSON'],C['HERO'],.02)
prism('SASH',[(-2,5.85),(-1.7,6.2),(.4,4.55),(.05,4.1),(-2.2,5.35)],-.7,.1,M['AMBER'],C['HERO'],.05);cube('SASH_BUCKLE',(-.55,-.78,4.95),(.4,.1,.45),M['ACID'],C['HERO'])
prism('SHOULDER_L',[(-2.3,6.6),(-2.85,7.05),(-2.95,7.6),(-2.4,7.8),(-1.75,7.2),(-1.8,6.55)],-.5,.18,M['CRIMSON'],C['HERO'],.08);prism('SHOULDER_R',[(-.35,6.7),(.4,7.25),(1.2,7.2),(1.25,6.65),(.65,6.2),(-.1,6.2)],-.53,.18,M['ACID'],C['HERO'],.08)
# neck/head face hair
prism('NECK',[(-1.55,7.1),(-.65,7.1),(-.62,7.65),(-1.5,7.7)],-.48,.16,M['BROWN'],C['HERO'],.04)
head=[(-1.7,8.7),(-1.45,9.25),(-.72,9.4),(-.24,8.9),(-.42,7.9),(-.92,7.5),(-1.58,7.85)]
prism('HEAD_INK',head,-.4,.3,M['INK'],C['HERO'],.05);face=[(-1.5,8.68),(-1.3,9.03),(-.75,9.12),(-.42,8.78),(-.56,8.03),(-1,7.72),(-1.45,7.98)];prism('FACE',face,-.6,.1,M['PAPER'],C['HERO'],.02)
hair=[(-1.7,8.72),(-1.56,9.35),(-1.12,9.62),(-.56,9.57),(-.24,9.08),(-.62,8.86),(-1.1,9.08),(-1.43,8.66)];prism('HAIR',hair,-.72,.11,M['BLACK'],C['HERO'],.06);prism('TOPKNOT',[(-1.2,9.5),(-1.18,10.12),(-.78,10.36),(-.45,10.08),(-.58,9.6)],-.57,.15,M['BLACK'],C['HERO'],.06);prism('HAIR_RED',[(-1.44,9.32),(-1.14,9.6),(-.92,9.52),(-1.22,9.18)],-.82,.05,M['RED'],C['HERO'])
# face graphics
prism('FACE_SHADOW',[(-1.43,8.18),(-.93,7.73),(-.58,8.1),(-.66,8.47),(-1.06,8.36)],-.8,.04,M['RED'],C['HERO']);prism('BROW',[(-1.36,8.65),(-.95,8.73),(-.68,8.62),(-.88,8.53),(-1.33,8.55)],-.84,.04,M['INK'],C['HERO']);prism('EYE',[(-1.32,8.45),(-1,8.53),(-.77,8.46),(-1.04,8.37)],-.86,.05,M['PAPER'],C['HERO']);prism('PUPIL',[(-.92,8.45),(-.79,8.48),(-.82,8.36),(-.94,8.35)],-.9,.04,M['INK'],C['HERO']);prism('MOUTH',[(-1.04,7.96),(-.62,7.94),(-.8,7.87),(-1.14,7.91)],-.88,.04,M['INK'],C['HERO'])
# arms dramatic
prism('RAISED_SLEEVE',[(-.3,6.75),(.3,7.18),(1.25,7.62),(1.6,8.16),(1.12,8.43),(.38,7.95),(-.4,7.42)],-.62,.18,M['NAVY'],C['HERO'],.08);prism('RAISED_STRIPE',[(.42,7.35),(1.2,7.82),(1.45,8.13),(1.23,8.3),(.65,7.91)],-.75,.08,M['AMBER'],C['HERO'],.025);prism('RAISED_BRACER',[(1.18,7.9),(1.73,8.13),(2.08,8.42),(1.75,8.76),(1.25,8.47)],-.72,.13,M['STEEL'],C['HERO'],.05);prism('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)],-.82,.1,M['PAPER'],C['HERO'],.04)
prism('LOWER_SLEEVE',[(-2.05,6.18),(-2.55,5.88),(-2.2,5.25),(-1.05,4.86),(-.35,5.35),(-.7,5.9),(-1.42,6.38)],-.66,.18,M['CRIMSON'],C['HERO'],.08);prism('LOWER_FOLD',[(-2.2,5.62),(-1.2,5.08),(-.72,5.35),(-1.45,5.92)],-.78,.08,M['ACID'],C['HERO'],.02);prism('LOWER_HAND',[(-.38,5.18),(.1,5.16),(.42,5.43),(.18,5.7),(-.33,5.57),(-.56,5.34)],-.9,.1,M['PAPER'],C['HERO'],.03)
# chopsticks
for i,(a,b,ma) in enumerate([((2.02,-1.0,8.78),(3.9,-1.05,9.62),M['AMBER']),((2.14,-1.06,8.65),(4.05,-1.12,9.45),M['PAPER']),((-.05,-1.08,5.4),(1.25,-1.1,6.05),M['ACID']),((.2,-1.12,5.27),(1.42,-1.15,5.92),M['SODIUM'])]):
 line('CHOPSTICK_INK_%02d'%i,a,b,.075,M['INK'],C['HERO']);line('CHOPSTICK_%02d'%i,a,b,.028,ma,C['HERO'])
# secondary sheathed sword
line('SHEATH',(-2.05,-.1,4.25),(.18,-.1,2.05),.16,M['INK'],C['HERO']);line('SHEATH_RED',(-2.05,-.22,4.25),(.18,-.22,2.05),.075,M['CRIMSON'],C['HERO'])
# noodles choreography
shield=[]
for i in range(30):t=-.45+i*(2*pi+0.9)/29;shield.append((-.55+2.05*cos(t),6.15+1.62*sin(t)))
noodle('SHIELD_COIL',shield,M['CHART'],.105,-1.35,True);arc=[]
for i in range(15):t=1+i*1.55/14;arc.append((-.55+2.1*cos(t),6.15+1.68*sin(t)))
noodle('SHIELD_RED_ARC',arc,M['RED'],.07,-1.52,True)
noodle('FOREGROUND_WHIP',[(-10,1.1),(-8.2,1.3),(-6.6,2.2),(-5.1,3.6),(-3.4,5.25),(-1,6.18),(1.6,6),(4,4.65),(6.8,3.15),(10,2.85)],M['GOLD'],.30,-3.0,True);noodle('FOREGROUND_RED',[(-9,1.38),(-6.4,2.3),(-4.9,3.6),(-2.7,5.2),(0,5.95),(2.7,5.5),(5.4,3.75),(8.9,2.9)],M['RED'],.07,-3.4)
noodle('RAISED_LASH',[(2,8.78),(2.7,9.15),(3.55,9.48),(4.7,9.12),(5.8,8.2),(6.65,6.95),(7.6,7.65),(8.9,8.7),(10.4,8.55)],M['ACID'],.16,-1.55,True)
noodle('LASSO',[(.52,6),(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),(6.45,6.9),(6.1,6.2),(6.55,5.55),(7.6,5.35),(9.2,5.55)],M['LIME'],.1,-1.45,True)
# loose wrap and high loop
noodle('HIGH_LASSO',[(1.55,8.7),(.2,9.65),(-1.8,10),(-3.2,9.45),(-2.9,8.55),(-1.6,8.25),(-.8,8.8),(-1.15,9.6),(-2.25,10.25),(-4.1,10.35),(-5.5,9.55)],M['RED'],.1,-1.25,True)
noodle('CART_WRAP',[(2.55,3.7),(1.25,4.25),(.35,4.85),(-.25,4.25),(-.05,3.35),(.9,2.92),(1.7,3.25)],M['ACID'],.075,-1.25);noodle('STOOL_WRAP',[(3,4.1),(4.4,4.5),(5.15,4.15),(4.8,3.3),(4.15,2.8),(4.8,2.1),(6,1.9)],M['GOLD'],.08,-1.2,True);noodle('KNOT', [(-.35,5.32),(-.8,5),(-.4,4.65),(.3,4.82),(.1,5.3),(-.6,5.55),(-.95,5.1),(-.5,4.55),(.25,4.35),(1.2,4.45)],M['CHART'],.06,-1.6,True)
# blade caught
prism('INCOMING_BLADE',[(10,7.6),(9.4,7.35),(5.05,6.12),(5.18,6.35)],-1.0,.13,M['PAPER'],C['FX'],.05);line('BLADE_HIGHLIGHT',(9.6,-1.2,7.37),(5.3,-1.2,6.28),.03,M['PAPER'],C['FX'])
# save
bpy.ops.wm.save_as_mainfile(filepath='ramen_samurai.blend')
result={'stage':'hero_noodles','objects':len(bpy.data.objects)}


Traceback (most recent call last):
  File "<repo>\.runner\blender-mcp-v1.0.0\addon\mcp_to_blender_server.py", line 230, in _execute_code
    exec(code, namespace)
    ~~~~^^^^^^^^^^^^^^^^^
  File "<string>", line 34, in <module>
  File "<string>", line 14, in prism
TypeError: unsupported operand type(s) for /: 'Material' and 'int'