1
This commit is contained in:
commit
a85391509d
211 files changed
+28903
No files matched your search
@@ -0,0 +1,83 @@
|
||||
import bpy, math
|
||||
from mathutils import Vector
|
||||
scene=bpy.context.scene
|
||||
old=scene.collection.children.get("Atmosphere | colored halogen fixtures")
|
||||
if old:
|
||||
for ob in list(old.objects):bpy.data.objects.remove(ob,do_unlink=True)
|
||||
bpy.data.collections.remove(old)
|
||||
lights=bpy.data.collections.new("Atmosphere | colored halogen fixtures");scene.collection.children.link(lights)
|
||||
def material(name,color,glow=0):
|
||||
m=bpy.data.materials.new(name);m.diffuse_color=(*color,1);m.use_nodes=True
|
||||
p=next(n for n in m.node_tree.nodes if n.type=="BSDF_PRINCIPLED")
|
||||
p.inputs["Base Color"].default_value=(*color,1);p.inputs["Roughness"].default_value=.4
|
||||
if glow:
|
||||
p.inputs["Emission Color"].default_value=(*color,1);p.inputs["Emission Strength"].default_value=glow
|
||||
return m
|
||||
housing=material("Halogen | graphite housing",(.055,.075,.11))
|
||||
colors={"cyan":(.04,.75,1),"amber":(1,.48,.09),"violet":(.48,.12,1),"mint":(.08,1,.52)}
|
||||
lenses={k:material("Halogen | "+k,c,4) for k,c in colors.items()}
|
||||
def solid(name,loc,size,mat):
|
||||
assert min(size)>=2
|
||||
bpy.ops.mesh.primitive_cube_add(size=1,location=loc)
|
||||
ob=bpy.context.object;ob.name=name;ob.dimensions=size
|
||||
bpy.ops.object.transform_apply(location=False,rotation=False,scale=True)
|
||||
for c in list(ob.users_collection):c.objects.unlink(ob)
|
||||
lights.objects.link(ob);ob.data.materials.append(mat)
|
||||
b=ob.modifiers.new("Housing corner","BEVEL");b.width=.18;b.segments=2
|
||||
return ob
|
||||
def area(name,pos,target,color,energy=9000,size=7):
|
||||
d=bpy.data.lights.new(name,"AREA");d.energy=energy;d.color=colors[color];d.shape="DISK";d.size=size
|
||||
o=bpy.data.objects.new(name,d);lights.objects.link(o);o.location=pos
|
||||
o.rotation_euler=(Vector(target)-o.location).to_track_quat("-Z","Y").to_euler()
|
||||
return o
|
||||
def ceiling(x,y,color,elevation=0):
|
||||
solid("Recessed "+color+" ceiling housing",(x,y,24+elevation),(12,6,4),housing)
|
||||
solid("Halogen "+color+" diffuser",(x,y,22+elevation),(8,4,2),lenses[color])
|
||||
area("Underpass "+color+" wash",(x,y,20.8+elevation),(x,y,elevation),color,12000,8)
|
||||
# Each district has a color identity; the central cross remains easy to read.
|
||||
for x,y,c in [(0,0,"cyan"),(-32,0,"cyan"),(32,0,"cyan"),(0,-32,"amber"),(0,32,"amber"),
|
||||
(-144,0,"violet"),(144,0,"mint"),
|
||||
(0,320,"cyan"),(0,-320,"amber"),(-320,0,"violet"),(320,0,"mint"),
|
||||
(-304,-304,"violet"),(-304,304,"cyan"),(304,-304,"amber"),(304,304,"mint")]:
|
||||
ceiling(x,y,c)
|
||||
for x in (-32,0,32):
|
||||
ceiling(x,0,"violet",48)
|
||||
def sconce(x,y,z,sign,color):
|
||||
solid("Wall light "+color+" housing",(x,y+sign*2,z),(8,4,8),housing)
|
||||
solid("Wall light "+color+" lens",(x,y+sign*4.8,z),(4,2,4),lenses[color])
|
||||
area("Wall "+color+" pool",(x,y+sign*6,z),(x,y+sign*24,4),color,10000,5)
|
||||
for x in (-32,32):
|
||||
sconce(x,-48,18,-1,"amber")
|
||||
sconce(x,48,18,1,"cyan")
|
||||
for sx in (-1,1):
|
||||
for sy in (-1,1):
|
||||
sconce(304*sx+32,304*sy+48*sy,18,sy,"violet" if sx<0 else "mint")
|
||||
# Substantial route markers stand outside the ramp footprint.
|
||||
for x in (-144,144):
|
||||
for y in (-160,160):
|
||||
for side in (-1,1):
|
||||
xx=x+side*24
|
||||
solid("Ramp marker | plinth",(xx,y,4),(4,4,8),housing)
|
||||
solid("Ramp marker | lamp",(xx,y,9),(4,4,2),lenses["violet" if x<0 else "mint"])
|
||||
# Balanced dusk lighting keeps walking routes visible while colored pools read.
|
||||
world=bpy.data.worlds.new("Arena | blue dusk");world.use_nodes=True
|
||||
bg=next(n for n in world.node_tree.nodes if n.type=="BACKGROUND")
|
||||
bg.inputs["Color"].default_value=(.24,.32,.46,1);bg.inputs["Strength"].default_value=.50
|
||||
scene.world=world
|
||||
d=bpy.data.lights.new("Dusk | soft key","SUN");d.energy=1.8;d.angle=math.radians(18);d.color=(.78,.85,1)
|
||||
sun=bpy.data.objects.new("Dusk | soft key",d);lights.objects.link(sun)
|
||||
sun.rotation_euler=(math.radians(28),math.radians(-22),math.radians(-25))
|
||||
d=bpy.data.lights.new("Dusk | soft fill","SUN");d.energy=.65;d.angle=math.radians(30);d.color=(.74,.83,1)
|
||||
fill=bpy.data.objects.new("Dusk | soft fill",d);lights.objects.link(fill)
|
||||
fill.rotation_euler=(math.radians(55),math.radians(20),math.radians(155))
|
||||
scene["lighting"]="Cyan north/center, amber south, violet west/middle gallery, mint east; 26 local area lights."
|
||||
for a in bpy.context.window.screen.areas:
|
||||
if a.type=="VIEW_3D":
|
||||
a.spaces.active.shading.type="MATERIAL"
|
||||
a.spaces.active.shading.use_scene_lights=True
|
||||
a.spaces.active.shading.use_scene_world=True
|
||||
a.spaces.active.overlay.show_overlays=False
|
||||
bpy.ops.object.select_all(action="DESELECT")
|
||||
bpy.ops.wm.save_as_mainfile(filepath=r"C:\roblox\hunter\3D models\game_zone\Hunter_Monolith_Arena.blend")
|
||||
result={"fixtures":42,"colored_area_lights":26,"colors":list(colors),"rendered":False}
|
||||
|
||||
Reference in new issue
Block a user