Update
This commit is contained in:
commit
2d6a8a867d
1093 files changed
+2424571
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
@@ -0,0 +1,18 @@
|
||||
import bpy,os
|
||||
from mathutils import Matrix,Vector
|
||||
OUT=r'C:\roblox\Ornament Generator RNG\shop'
|
||||
bpy.ops.wm.open_mainfile(filepath=os.path.join(OUT,'christmas_shop_v2.blend'))
|
||||
prefix=('Timber post','Red ribbon','Gold ribbon','Ribbon fishtail','Tail gold','Holly leaf','Bow berry')
|
||||
targets={o.name:o for o in bpy.context.scene.objects if o.name.startswith(prefix)}
|
||||
with bpy.data.libraries.load(os.path.join(OUT,'christmas_shop.blend'),link=False) as (src,dst):
|
||||
names=[n for n in src.objects if n in targets];dst.objects=list(names)
|
||||
for name,original in zip(names,dst.objects):
|
||||
ob=targets[name];ob.matrix_world=original.matrix_world.copy()
|
||||
if name.startswith('Timber post'):ob.scale.x*=1.15;ob.scale.y*=1.15
|
||||
else:ob.matrix_world=Matrix.Translation((0,0,6.3))@Matrix.Diagonal((1,1,.85,1))@Matrix.Translation((0,0,-6.3))@ob.matrix_world
|
||||
bpy.data.objects.remove(original,do_unlink=True)
|
||||
sc=bpy.context.scene
|
||||
sc.render.filepath=os.path.join(OUT,'christmas_shop_v2_preview.png')
|
||||
bpy.ops.wm.save_as_mainfile(filepath=os.path.join(OUT,'christmas_shop_v2.blend'))
|
||||
bpy.ops.render.render(write_still=True)
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import bpy,math,os,ast
|
||||
from mathutils import Vector
|
||||
OUT=r'C:\roblox\Ornament Generator RNG\shop'
|
||||
bpy.ops.wm.open_mainfile(filepath=os.path.join(OUT,'christmas_shop_v2.blend'))
|
||||
sc=bpy.context.scene
|
||||
for node in ast.parse(open(os.path.join(OUT,'build_shop.py'),encoding='utf-8-sig').read()).body:
|
||||
if isinstance(node,ast.FunctionDef):exec(compile(ast.Module(body=[node],type_ignores=[]),'helpers','exec'))
|
||||
wood=bpy.data.materials['Warm satin chestnut'];wood2=bpy.data.materials['Wood trim'];red=bpy.data.materials['Christmas scarlet'];gold=bpy.data.materials['Warm gold'];green=bpy.data.materials['Holly green'];snow=bpy.data.materials['Soft snow'];inner=bpy.data.materials['Ribbon lining']
|
||||
for o in list(sc.objects):
|
||||
if o.name.startswith(('Timber post','Red ribbon','Gold ribbon','Ribbon fishtail','Tail gold','Holly leaf','Bow berry','Post capital')):bpy.data.objects.remove(o,do_unlink=True)
|
||||
for x in (-4.25,4.25):
|
||||
for y in (-1.75,1.75):
|
||||
box('Structural timber post',(x,y,2.5),(.57,.57,4.25),wood,.055)
|
||||
for z in (.6,4.43):box('Post moulding',(x,y,z),(.78,.78,.3),wood2,.055)
|
||||
# Closed ribbon loop shell; front and rear are both in front of the snow.
|
||||
def bow(cx,cy,cz,s=1,prefix='Main bow'):
|
||||
for side in (-1,1):
|
||||
vs=[];N=64;W=12
|
||||
for i in range(N):
|
||||
a=i*math.tau/N;x=.08+.83*(1-math.cos(a));f=(x/1.74)**.65
|
||||
for j in range(W+1):
|
||||
u=j/W
|
||||
vs.append((cx+s*side*x*(1-.13*u),cy+s*u*(.22+.35*f),cz+s*(.10*(1-math.cos(a))+.24*math.sin(a)+.91*u*f+.08*math.sin(math.pi*u))))
|
||||
fs=[(i*(W+1)+j,((i+1)%N)*(W+1)+j,((i+1)%N)*(W+1)+j+1,i*(W+1)+j+1) for i in range(N) for j in range(W)]
|
||||
o=mesh(prefix+' loop',vs,fs,red,True);o.data.materials.append(inner);so=o.modifiers.new('Ribbon lining','SOLIDIFY');so.thickness=.045*s;so.material_offset=1
|
||||
for j in (0,W):curve(prefix+' gold hem',[vs[i*(W+1)+j] for i in range(N)]+[vs[j]],.038*s,gold)
|
||||
vs=[];T=16;K=8
|
||||
for j in range(T+1):
|
||||
t=j/T;w=.17+.19*t
|
||||
for k in range(K+1):
|
||||
u=k/K*2-1;notch=.22*(1-abs(u))*max(0,(t-.8)/.2)
|
||||
vs.append((cx+s*side*(.14+.64*t+u*w),cy-s*(.03+.08*t+.04*(1-u*u)),cz+s*(-.85*t+notch)))
|
||||
fs=[(j*(K+1)+k,j*(K+1)+k+1,(j+1)*(K+1)+k+1,(j+1)*(K+1)+k) for j in range(T) for k in range(K)]
|
||||
o=mesh(prefix+' fishtail',vs,fs,red,True);so=o.modifiers.new('Fabric thickness','SOLIDIFY');so.thickness=.04*s
|
||||
boundary=[vs[j*(K+1)] for j in range(T+1)]+[vs[T*(K+1)+k] for k in range(1,K+1)]+[vs[j*(K+1)+K] for j in range(T-1,-1,-1)]
|
||||
curve(prefix+' tail trim',boundary+[boundary[0]],.022*s,gold)
|
||||
for dx,dz in [(0,.20),(-.17,-.05),(.17,-.05)]:ball(prefix+' berry',(cx+s*dx,cy-.10*s,cz+s*dz),(.18*s,.15*s,.18*s),red)
|
||||
bow(0,-3.48,6.35)
|
||||
# Gold-backed mounting bracket joins the bow and roof ridge.
|
||||
beam('Bow mounting bracket',(0,-2.2,6.5),(0,-3.1,6.5),.16,wood)
|
||||
for side in (-1,1):bow(side*4.25,-2.34,2.5,.21,'Candy cane bow')
|
||||
# Bring the tree out from behind the stall so its full silhouette is visible.
|
||||
for o in sc.objects:
|
||||
if o.name.startswith(('Scalloped fir','Fir soft snow','Fir trunk')):o.location.x-=.40;o.location.y-=.45
|
||||
# Warm, saturated roof and timber; softly illuminated displays.
|
||||
p=next(n for n in red.node_tree.nodes if n.type=='BSDF_PRINCIPLED');p.inputs['Base Color'].default_value=(.55,.008,.018,1);p.inputs['Roughness'].default_value=.38
|
||||
for name in ('Warm satin chestnut','Wood trim'):
|
||||
m=bpy.data.materials[name];p=next(n for n in m.node_tree.nodes if n.type=='BSDF_PRINCIPLED');p.inputs['Roughness'].default_value=.48
|
||||
for o in sc.objects:
|
||||
if o.type=='LIGHT' and o.name.startswith('Interior'):o.data.energy=220
|
||||
sc.camera.location=(5.5,-25,8.7);sc.camera.rotation_euler=(Vector((-.15,0,3.6))-sc.camera.location).to_track_quat('-Z','Y').to_euler();sc.camera.data.ortho_scale=14
|
||||
sc.view_settings.look='AgX - Medium High Contrast'
|
||||
sc.cycles.samples=48;sc.render.resolution_percentage=90
|
||||
# Organize studio separately so the model can be exported cleanly.
|
||||
asset=bpy.data.collections.new('SHOP_MODEL');sc.collection.children.link(asset)
|
||||
studio=bpy.data.collections.new('STUDIO_RENDER_ONLY');sc.collection.children.link(studio)
|
||||
for o in list(sc.objects):
|
||||
target=studio if o.type in ('CAMERA','LIGHT') or o.name=='Studio ground' else asset
|
||||
for c in list(o.users_collection):c.objects.unlink(o)
|
||||
target.objects.link(o)
|
||||
sc.render.filepath=os.path.join(OUT,'christmas_shop_final_preview.png')
|
||||
bpy.ops.wm.save_as_mainfile(filepath=os.path.join(OUT,'christmas_shop_final.blend'))
|
||||
bpy.ops.render.render(write_still=True)
|
||||
@@ -0,0 +1,19 @@
|
||||
import bpy,math,os
|
||||
from mathutils import Vector
|
||||
sc=bpy.context.scene
|
||||
snow=bpy.data.materials['Soft snow']
|
||||
for o in sc.objects:
|
||||
if o.name.startswith(('Red ribbon','Gold ribbon','Ribbon fishtail','Tail gold','Holly leaf','Bow berry')):o.location.y-=.55
|
||||
for side in (-1,1):
|
||||
for back in (-1,1):
|
||||
cu=bpy.data.curves.new('Rounded snow overhang','CURVE');cu.dimensions='3D';cu.bevel_depth=.20;cu.bevel_resolution=5
|
||||
sp=cu.splines.new('POLY');sp.points.add(80)
|
||||
for i,p in enumerate(sp.points):
|
||||
t=i/80;x=side*(.02+5.08*t);y=back*(2.5+.04*math.sin(t*math.tau*4));z=7.0-abs(x)*.45-.06*math.cos(t*math.tau*4)
|
||||
p.co=(x,y,z,1);p.radius=.8+.2*math.sin(t*math.pi)+.18*math.sin(t*math.tau*4)
|
||||
o=bpy.data.objects.new('Soft snowy roof lip',cu);sc.collection.objects.link(o);cu.materials.append(snow)
|
||||
cam=sc.camera;cam.location=(7,-24,8.5);target=Vector((0,0,3.55));cam.rotation_euler=(target-cam.location).to_track_quat('-Z','Y').to_euler()
|
||||
sc.render.resolution_percentage=100;sc.cycles.samples=48
|
||||
sc.render.filepath=r'C:\roblox\Ornament Generator RNG\shop\christmas_shop_preview.png'
|
||||
bpy.ops.wm.save_as_mainfile(filepath=r'C:\roblox\Ornament Generator RNG\shop\christmas_shop.blend')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 922 KiB |
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user