この作業から始める
薄い花弁に厚みを残し、縁の表情を出したい
薄くうねった花弁を重ね、二輪のポピーを一枚の植物図版に仕立てました。
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):
def bx(name, loc, dim, m, r=0.04):
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, r)
def finish(o, name, m, r=0):
o.name = name
o.data.materials.append(m)
if r:
be = o.modifiers.new('Highlight radius', 'BEVEL')
be.width = r
be.segments = 4
be.harden_normals = True
o.modifiers.new('Planar normals', 'WEIGHTED_NORMAL')
return o
def ball(name, loc, scale, m):
bpy.ops.mesh.primitive_uv_sphere_add(segments=48, ring_count=32, location=loc)
o = bpy.context.object
o.scale = scale
for f in o.data.polygons:
f.use_smooth = True
return finish(o, name, m)
def cyl(name, loc, r, d, m, rot=(0, 0, 0), edge=0.015):
bpy.ops.mesh.primitive_cylinder_add(vertices=80, radius=r, depth=d, location=loc, rotation=rot)
o = bpy.context.object
for f in o.data.polygons:
f.use_smooth = len(f.vertices) == 4
return finish(o, name, m, edge)
def rod(name, a, b, r, m):
v = Vector(b) - Vector(a)
o = cyl(name, (Vector(a) + Vector(b)) / 2, r, v.length, m, edge=min(r / 3, 0.024))
o.rotation_euler = v.to_track_quat('Z', 'Y').to_euler()
return o
def line(name, coords, r, m):
cu = bpy.data.curves.new(name, 'CURVE')
cu.dimensions = '3D'
cu.resolution_u = 16
cu.bevel_depth = r
cu.bevel_resolution = 4
sp = cu.splines.new('BEZIER')
sp.bezier_points.add(len(coords) - 1)
for (p, c) in zip(sp.bezier_points, coords):
p.co = c
p.handle_left_type = 'AUTO'
p.handle_right_type = 'AUTO'
o = bpy.data.objects.new(name, cu)
scene.collection.objects.link(o)
cu.materials.append(m)
return o
def mesh(name, loc, verts, faces, m):
me = bpy.data.meshes.new(name)
me.from_pydata(verts, [], faces)
me.update()
o = bpy.data.objects.new(name, me)
scene.collection.objects.link(o)
o.location = loc
for f in me.polygons:
f.use_smooth = True
return finish(o, name, m)
def mat(name, c, metal=0, rough=0.4, em=0):
m = bpy.data.materials.new(name)
m.use_nodes = True
b = m.node_tree.nodes.get('Principled BSDF')
b.inputs['Base Color'].default_value = (*c, 1)
b.inputs['Roughness'].default_value = rough
b.inputs['Metallic'].default_value = metal
if em:
b.inputs['Emission Color'].default_value = (*c, 1)
b.inputs['Emission Strength'].default_value = em
return m
def aim(o, p):
o.rotation_euler = (Vector(p) - o.location).to_track_quat('-Z', 'Y').to_euler()
def light(name, pos, target, power, col, w, h=None):
d = bpy.data.lights.new(name, 'AREA')
d.energy = power
d.color = col
d.shape = 'RECTANGLE'
d.size = w
d.size_y = h or w
o = bpy.data.objects.new(name, d)
scene.collection.objects.link(o)
o.location = pos
aim(o, target)
def shoot(pos, target, scale, lens=None):
cd = bpy.data.cameras.new('Art direction')
cam = bpy.data.objects.new('Art direction', cd)
scene.collection.objects.link(cam)
scene.camera = cam
cam.location = pos
aim(cam, target)
if lens:
cd.lens = lens
else:
cd.type = 'ORTHO'
cd.ortho_scale = scale
bpy.context.view_layer.update()
cd.smart_camlight_settings.rig_target_distance = (Vector(target) - cam.location).length
assert bpy.ops.smart_camlight_suite.create_camera_rig(camera_name=cam.name) == {'FINISHED'}
assert any((c.type == 'TRACK_TO' and c.target for c in cam.constraints))
def active(o):
bpy.ops.object.select_all(action='DESELECT')
o.select_set(True)
bpy.context.view_layer.objects.active = o
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'
def cone(name, loc, r1, r2, h, m, segments=16):
bpy.ops.mesh.primitive_cone_add(vertices=segments, radius1=r1, radius2=r2, depth=h, location=loc)
return finish(bpy.context.object, name, m)
def model_line(name, points, r, m):
return line(name, points, r, m)
pass
paper = mat('Linen paper', (0.79, 0.73, 0.57))
bx('Print backing', (0, 0, -0.36), (200, 200, 0.62), paper, 0)
green = mat('Print green', (0.085, 0.22, 0.128))
sun = mat('Pollen', (0.89, 0.49, 0.06), 0.13)
ink = mat('Seed capsule', (0.03, 0.048, 0.038))
corals = [mat('Vermilion', (0.86, 0.074, 0.019)), mat('Apricot', (0.91, 0.185, 0.032)), mat('Scarlet', (0.65, 0.034, 0.012))]
flowers = [(-0.93, 0.6, 0.69, 1.13), (0.98, -0.04, 0.48, 0.83)]
petals = []
def leaf(cx, cy, cz, length, width, angle, m, petal=False, phase=0):
verts = []
faces = []
rows = 16
across = 10
for j in range(rows + 1):
u = j / rows
w = width * (0.012 + sin(pi * (0.86 * u + 0.1)) ** 0.7 * (0.37 + 0.68 * u) if petal else 0.01 + sin(pi * u) ** 0.9)
for i in range(across + 1):
v = i / across * 2 - 1
xx = u * length
yy = w * v
zz = 0.31 * u ** 2 + 0.15 * v * v - 0.1 * sin(u * pi) + 0.095 * sin(v * 9 + phase) * u ** 3 if petal else 0.075 * (1 - abs(v)) * sin(pi * u)
verts.append((cx + xx * cos(angle) - yy * sin(angle), cy + xx * sin(angle) + yy * cos(angle), cz + zz))
if j:
for i in range(across):
k = (j - 1) * (across + 1) + i
faces.append((k, k + 1, k + across + 2, k + across + 1))
o = mesh('Pressed petal' if petal else 'Lobed leaf', (0, 0, 0), verts, faces, m)
if petal:
active(o)
assert bpy.ops.object.ms_add_modifier(mod_type='SOLIDIFY') == {'FINISHED'}
shell = next((m for m in o.modifiers if m.type == 'SOLIDIFY'))
shell.thickness = 0.027
shell.offset = 1.0
shell.use_even_offset = True
shell.use_quality_normals = True
assert any((v.type == 'SOLIDIFY' and abs(v.thickness - 0.027) < 0.0001 for v in o.modifiers))
return o
for (k, (x, y, z, sc)) in enumerate(flowers):
model_line('Curved stem', [(0.3, -2.14, 0.05), (0.12 + k * 0.18, -1.5, 0.1), (x * 0.68, -0.58, z * 0.62), (x, y, z)], 0.041 * sc, green)
for j in range(7):
a = tau * j / 7 + k * 0.18
petals.append(leaf(x, y, z + 0.1 * cos(a), sc * (1 + 0.06 * sin(j)), sc * 0.68, a, corals[(j + k) % 3], True, j))
for j in range(26):
a = tau * j / 26
rr = sc * (0.24 + 0.04 * sin(j * 2.3))
rod('Stamen', (x + 0.1 * cos(a), y + 0.1 * sin(a), z + 0.06), (x + rr * cos(a), y + rr * sin(a), z + 0.265), 0.011, ink)
ball('Anther', (x + rr * cos(a), y + rr * sin(a), z + 0.27), (0.035, 0.035, 0.027), sun)
ball('Central capsule', (x, y, z + 0.22), (0.148 * sc, 0.148 * sc, 0.12), green)
yield
for i in range(7):
side = -1 if i % 2 == 0 else 1
sy = -1.77 + i * 0.145
leaf(0.16, sy, 0.13, 0.72 + 0.12 * sin(i), 0.105, 1.2 + side * 0.99, green)
yield
light('Gallery daylight', (-3, -4, 8), (0, 0, 0), 760, (1, 0.9, 0.76), 4)
light('Skylight', (5, 2, 5), (0, 0, 0), 490, (0.85, 0.94, 1), 4)
shoot((0.45, -3.0, 11), (0, -0.17, 0.3), 6.4)
for p in petals[1:]:
p.hide_render = True
for p in petals:
p.hide_render = False
yield
course_key = 'SmartTools lesson / herbarium'
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_modifier_suite']:
product_module(required)
scene = bpy.data.scenes.new('Study / herbarium')
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ファイルも保存します。
「Pressed petal」を選び、モディファイアーの「厚み付け」を開きます。厚さは0.027。横から拡大し、表示を一時オフにすると花びらの縁の厚みの差が分かります。
途中でファイルを閉じた場合は、新規ファイルで教材を最初から実行してください。
曲面の花弁に厚みを加えてから、重なりの向きと角度を花ごとに変えています。
曲げた面で花弁を作り、Smart Modifierから厚み付けを追加。各花弁の厚みは0.027シーン単位です。手前の縁と、奥の花弁に落ちる影で重なりを確認できます。
角ばった立方体に丸みとなめらかさを重ねる花びらの手前に飛び出した縁を、隣のカーブにつなげます。標準のシェイプキーとSmart Modifierの「編集ポリゴン」で、同じ4頂点を同じだけ移動しました。完成形は一致。違いは、修正がスタックのどこに残るかと、動かしている最中に厚みが見えるかです。
Blender 5.3で、作品「ポピーの立体植物図版」の同じ花びらを同じ角度から撮影しました。ディスプレイスで反らし、細分化し、最後に厚み付けを0.042 mに設定。両側とも手前に張り出した4頂点を選択し、G → Y で縁を動かして 0.14 m で確定しました。
標準側はシェイプキー「Contour」に記録。編集ポリゴン側はディスプレイスの後、細分化の前に修正を記録しています。「最終結果を表示」をオンにしたこの条件でも、編集用メッシュには後段の厚みが映りませんでした。どちらも修正だけを外して元の輪郭に戻せます。
1 つ足すごとに形が変わります。ベベルで角が面取りされ、サブディビジョンサーフェスを重ねると全体が丸くなります。どちらもモディファイアなので、元の立方体のデータはそのまま残ります。
実画面で確かめる注視点を使ってカメラを固定し、制作途中と完成画を同じ視点で撮影しました。
SmartTools CamLight の操作を見る ↗全機能と操作解説2027年1月1日発売予定。表示は税込・買い切り価格です。
薄い花弁に厚みを残し、縁の表情を出したい
掲載した単品の合計 ¥2,460
この作品で使った収録製品
SmartTools Modifier
セット外の使用製品
SmartTools CamLight
パックとセット外の掲載単品の合計 ¥6,960
掲載機能だけなら、単品の合計が¥4,500安くなります。
ほかに含まれる製品例
SmartTools Modeling · SmartTools UV