この作業から始める
階段や窓の反復を手作業で組むのに時間がかかる
水盤の向こうに立ち上がる階段と、連窓から落ちる光で見せる建築ビジュアルです。
Blender 5.3.0
作品用のモデルやテクスチャのダウンロードは不要です。下の教材で、形を組むところからカメラで撮るところまでを3回に分けて進めます。各段階で手を止めて、形や材質を自分の画面で確認できます。
製品名を押すと各解説書が開きます。Blenderの「編集」→「プリファレンス」→「アドオン」で上記の製品を有効にします。
作業中のファイルを保存し、「ファイル」→「新規」→「全般」を開きます。画面上の「Scripting」を開き、テキストエディターの「新規」を押します。下の「教材コード」を開いて全文をコピーし、テキストエディターに貼り付けます。
import bpy
import importlib
import math
import random
from math import cos, sin, pi, tau
from mathutils import Vector, Quaternion
def product_module(path):
base, _, sub = path.partition('.')
actual = next((a.module for a in bpy.context.preferences.addons if a.module.rsplit('.', 1)[-1] == base), None)
if actual is None:
raise RuntimeError('Enable the required SmartTools extension in Preferences: ' + base)
return importlib.import_module(actual + ('.' + sub if sub else ''))
def product_symbol(path, name):
module = product_module(path)
if hasattr(module, name):
return getattr(module, name)
return importlib.import_module(module.__name__ + '.' + name)
def drawing(scene):
builders=product_module('smart_shader_suite.builders')
world = bpy.data.worlds.new('Ambient')
scene.world = world
world.use_nodes = True
world.node_tree.nodes['Background'].inputs[0].default_value = (0.26, 0.34, 0.44, 1)
world.node_tree.nodes['Background'].inputs[1].default_value = 0.27
scene.render.engine = 'CYCLES'
scene.cycles.samples = 24
scene.cycles.use_denoising = True
scene.render.threads_mode = 'FIXED'
scene.render.threads = 5
scene.render.resolution_x = 1120
scene.render.resolution_y = 730
scene.render.resolution_percentage = 100
scene.render.image_settings.color_mode = 'RGB'
geometry = vars(product_module('smart_geometry_suite.max_procedural_primitives.mesh_generators'))
def mat(name, color, rough=0.5, metal=0):
m = bpy.data.materials.new(name)
m.use_nodes = True
b = m.node_tree.nodes.get('Principled BSDF')
for (k, v) in [('Base Color', (*color, 1)), ('Roughness', rough), ('Metallic', metal)]:
b.inputs[k].default_value = v
return m
def stone(name, c):
m = mat(name, c)
nt = m.node_tree
n = nt.nodes.new('ShaderNodeTexNoise')
n.inputs['Scale'].default_value = 65
n.inputs['Detail'].default_value = 3.5
ramp = nt.nodes.new('ShaderNodeValToRGB')
ramp.color_ramp.elements[0].color = (*[x * 0.82 for x in c], 1)
ramp.color_ramp.elements[1].color = (*[min(1, x * 1.1) for x in c], 1)
bs = nt.nodes.get('Principled BSDF')
nt.links.new(n.outputs['Fac'], ramp.inputs[0])
nt.links.new(ramp.outputs[0], bs.inputs['Base Color'])
bm = nt.nodes.new('ShaderNodeBump')
bm.inputs['Strength'].default_value = 0.12
bm.inputs['Distance'].default_value = 0.022
nt.links.new(n.outputs['Fac'], bm.inputs['Height'])
nt.links.new(bm.outputs[0], bs.inputs['Normal'])
return m
def brushed(name, c):
m = bpy.data.materials.new(name)
builders.build_brushed_metal(m, dict(base_color=[*c, 1], roughness=0.32, anisotropy=0.5, brush_scale=155, detail_bump=0.012))
assert any((n.type == 'BSDF_PRINCIPLED' for n in m.node_tree.nodes))
return m
def finish(o, name, m, bev=0):
o.name = name
o.data.materials.append(m)
if bev:
b = o.modifiers.new('Edge highlights', 'BEVEL')
b.width = bev
b.segments = 3
b.harden_normals = True
o.modifiers.new('Normals', 'WEIGHTED_NORMAL')
return o
def box(name, loc, dim, m, bevel=0.025):
bpy.ops.mesh.primitive_cube_add(size=1, location=loc)
o = bpy.context.object
o.dimensions = dim
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
return finish(o, name, m, bevel)
def cylinder(name, loc, radius, height, m):
bpy.ops.mesh.primitive_cylinder_add(vertices=96, radius=radius, depth=height, location=loc)
o = bpy.context.object
for f in o.data.polygons:
f.use_smooth = len(f.vertices) == 4
return finish(o, name, m, 0.012)
def mesh(name, data, m, loc, bevel):
me = bpy.data.meshes.new(name)
me.from_pydata(data['verts'], [], data['faces'])
me.update()
ob = bpy.data.objects.new(name, me)
scene.collection.objects.link(ob)
ob.location = loc
return finish(ob, name, m, bevel)
limestone = stone('Limestone', (0.76, 0.62, 0.45))
terracotta = stone('Fired oxide', (0.59, 0.185, 0.081))
plaster = stone('Plaster', (0.88, 0.79, 0.63))
iron = brushed('Smart Shader | iron', (0.19, 0.125, 0.087))
brass = brushed('Smart Shader | brass', (0.63, 0.37, 0.12))
water = mat('Pool glaze', (0.035, 0.27, 0.27), 0.21, 0.55)
dark = mat('Reveals', (0.088, 0.066, 0.052), 0.58)
box('Terrain', (0, 0, -0.32), (200, 200, 0.5), limestone, 0.0)
box('Courtyard', (0, 0.2, 0.01), (9.8, 6.2, 0.18), plaster, 0.05)
box('Pool surround', (2.18, -1.41, 0.16), (4.8, 2.4, 0.2), limestone, 0.07)
box('Reflecting pool', (2.18, -1.41, 0.265), (4.52, 2.13, 0.018), water, 0.02)
wall = geometry['make_wall_v2'](dict(length=8.7, width=0.32, height=3.16, openings=4, opening_width=1.29, opening_height=2.34, opening_sill=0.13))
assert len(wall['faces']) > 24
ob = mesh('Smart Geometry | gallery wall', wall, terracotta, (0, 0, 0), 0.035)
xx = [v[0] for v in wall['verts']]
yy = [v[1] for v in wall['verts']]
ob.location = (-0.5 * (min(xx) + max(xx)), 1.88 - 0.5 * (min(yy) + max(yy)), 0.11)
box('Gallery roof', (0.05, 1.76, 3.39), (9.18, 1.16, 0.2), plaster, 0.042)
box('Left wall', (-4.04, 0.62, 1.69), (0.28, 2.4, 3.15), terracotta, 0.04)
for k in range(18):
box('Brise soleil', (1.0 + k * 0.192, 0.94, 2.11), (0.05, 0.28, 2.33), brass, 0.011)
yield
(x, y) = (-1.07, -0.47)
steps = geometry['make_spiral_stair_v2'](dict(radius=1.61, inner_radius=0.29, height=3.2, turns=1.12, steps=31, center_pole=False, railings=False))
assert len(steps['faces']) == 31 * 6
shaft = mesh('Smart Geometry | helical stair', steps, limestone, (x, y, 0.15), 0.024)
cylinder('Inner bronze drum', (x, y, 1.7), 0.286, 3.13, iron)
def helix(name, r, width, height, mat, lift=0):
vs = []
fs = []
for i in range(193):
a = math.tau * 1.12 * i / 192
z = 0.15 + 3.2 * i / 192 + 0.11 + lift
for (rr, zz) in [(r - width / 2, 0), (r + width / 2, 0), (r + width / 2, height), (r - width / 2, height)]:
vs.append((x + rr * math.cos(a), y + rr * math.sin(a), z + zz))
if i:
for j in range(4):
j2 = (j + 1) % 4
fs.append(((i - 1) * 4 + j, i * 4 + j, i * 4 + j2, (i - 1) * 4 + j2))
fs.extend([(3, 2, 1, 0), (768, 769, 770, 771)])
ob = mesh(name, {'verts': vs, 'faces': fs}, mat, (0, 0, 0), 0.008)
for f in ob.data.polygons:
f.use_smooth = True
helix('Folded parapet', 1.62, 0.075, 0.46, terracotta)
helix('Bronze coping', 1.62, 0.082, 0.035, brass, 0.46)
box('Gallery landing', (-0.34, 1.12, 3.275), (1.46, 1.63, 0.18), limestone, 0.026)
box('Walkway along the gallery', (0.1, 1.85, 3.28), (8.68, 0.86, 0.15), limestone, 0.025)
box('Landing beam', (-0.34, 1.56, 3.11), (1.45, 0.14, 0.22), iron, 0.016)
for j in range(7):
box('Stone joint', (-4.1 + j * 0.54, -2.52, 0.106), (0.01, 0.61, 0.005), dark, 0.0)
yield
world = bpy.data.worlds.new('Courtyard daylight')
scene.world = world
world.use_nodes = True
bg = world.node_tree.nodes.get('Background')
bg.inputs[0].default_value = (0.73, 0.78, 0.85, 1)
bg.inputs[1].default_value = 0.4
def aim(ob, to):
ob.rotation_euler = (Vector(to) - ob.location).to_track_quat('-Z', 'Y').to_euler()
def light(name, pos, power, col, size):
d = bpy.data.lights.new(name, 'AREA')
d.energy = power
d.color = col
d.shape = 'DISK'
d.size = size
ob = bpy.data.objects.new(name, d)
scene.collection.objects.link(ob)
ob.location = pos
aim(ob, (0, 0, 0.2))
light('Sky bounce', (-4, -4, 9), 600, (0.84, 0.91, 1), 7)
light('Warm skylight', (4, 0, 7), 470, (1, 0.8, 0.63), 4)
sun = bpy.data.lights.new('Afternoon sun', 'SUN')
sun.energy = 3.2
sun.angle = 0.055
sun.color = (1, 0.83, 0.65)
ob = bpy.data.objects.new('Afternoon sun', sun)
scene.collection.objects.link(ob)
ob.location = (-6, -5, 9)
aim(ob, (0, 0, 0))
camdat = bpy.data.cameras.new('Architectural study')
cam = bpy.data.objects.new('Courtyard camera', camdat)
scene.collection.objects.link(cam)
scene.camera = cam
cam.location = (6.7, -10.5, 7.0)
target = Vector((-0.38, 0.22, 1.45))
aim(cam, target)
camdat.type = 'ORTHO'
camdat.ortho_scale = 7.08
bpy.context.view_layer.update()
camdat.smart_camlight_settings.rig_target_distance = (target - cam.location).length
result = bpy.ops.smart_camlight_suite.create_camera_rig(camera_name=cam.name)
assert result == {'FINISHED'} and any((c.type == 'TRACK_TO' and c.target for c in cam.constraints)), result
scene.render.engine = 'CYCLES'
scene.cycles.samples = 24
scene.cycles.use_denoising = True
scene.render.threads_mode = 'FIXED'
scene.render.threads = 5
scene.render.resolution_x = 1280
scene.render.resolution_y = 850
scene.render.resolution_percentage = 100
scene.render.image_settings.color_mode = 'RGB'
yield
course_key = 'SmartTools lesson / courtyard'
session = bpy.app.driver_namespace
current = session.get(course_key)
if not current or current[0] != bpy.context.scene:
for required in ['smart_camlight_suite', 'smart_geometry_suite', 'smart_shader_suite']:
product_module(required)
scene = bpy.data.scenes.new('Study / courtyard')
bpy.context.window.scene = scene
current = [scene, drawing(scene), 0]
session[course_key] = current
if current[2] < 3:
next(current[1])
current[2] += 1
current[0]['Lesson step'] = current[2]
bpy.context.view_layer.update()
テキストエディター上部の ▶「スクリプト実行」を1回ずつ、合計3回押します。1回目で教材専用シーンに切り替わります。各回の間に、3Dビューにカーソルを置き「Home」で全体を表示できます。

「ビュー」→「カメラ」→「アクティブカメラ」で上の掲載画像と構図を見比べます。「レンダー」→「画像をレンダリング」(F12)を選び、表示された画像の「画像」→「名前を付けて保存」でPNGを保存します。教材シーンを後から編集するには、.blendファイルも保存します。
カメラビューで光の境目を見ながら、アウトライナーの「Afternoon sun」を選びます。R、Z、15、Enterで日差しを15度回し、柱の影を比べてください。Ctrl+Zで掲載時の向きに戻せます。
途中でファイルを閉じた場合は、新規ファイルで教材を最初から実行してください。
階段と窓のある壁を寸法から生成し、手すりの素材と水面越しの視点を詰めました。
らせん階段の段板と、四つの開口を持つ壁を生成しました。
SmartTools Geometry の操作を見る ↗全機能と操作解説磨き方向のある金属を割り当て、側面の細い反射を出しています。
SmartTools Shader の操作を見る ↗全機能と操作解説階段の近くにターゲットを置き、前景に水面が入る位置から撮影しました。
SmartTools CamLight の操作を見る ↗全機能と操作解説2027年1月1日発売予定。表示は税込・買い切り価格です。
階段や窓の反復を手作業で組むのに時間がかかる
掲載した単品の合計 ¥4,440
この作品で使った収録製品
SmartTools Geometry
セット外の使用製品
SmartTools Shader · SmartTools CamLight
パックとセット外の掲載単品の合計 ¥8,940
掲載機能だけなら、単品の合計が¥4,500安くなります。
ほかに含まれる製品例
SmartTools Modeling · SmartTools UV