この作業から始める
ウエストを止めたまま、裾だけを揺らしたい
スカートと髪を揺らす作例はSmart Cloth単体で試せます。一括セットアップなどの連携機能には、別売のSimply Cloth Studioが必要です。
布のひだに沿って赤が変わる、衣装のルックカット。腰で支えたスカートに風を当てています。
Blender 5.3.0
作品用のモデルやテクスチャのダウンロードは不要です。下の教材で、形を組むところからカメラで撮るところまでを3回に分けて進めます。各段階で手を止めて、形や材質を自分の画面で確認できます。
製品名を押すと各解説書が開きます。Blenderの「編集」→「プリファレンス」→「アドオン」で上記の製品を有効にします。
この教材にAuto-Rig ProやSimply Cloth Studioは必要ありません。
作業中のファイルを保存し、「ファイル」→「新規」→「全般」を開きます。画面上の「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')
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 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 lathe(name, loc, profile, m, scale_y=1):
verts = []
faces = []
n = 96
for (r, z) in profile:
for i in range(n):
a = tau * i / n
verts.append((r * cos(a), scale_y * r * sin(a), z))
for j in range(len(profile) - 1):
for i in range(n):
faces.append((j * n + i, j * n + (i + 1) % n, (j + 1) * n + (i + 1) % n, (j + 1) * n + i))
return mesh(name, loc, verts, faces, m)
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 shader(name, fn, c, **props):
m = bpy.data.materials.new(name)
getattr(builders, fn)(m, dict(base_color=[*c, 1], **props))
assert any((n.type == 'BSDF_PRINCIPLED' for n in m.node_tree.nodes))
return m
def brushed(name, c):
return shader(name, 'build_brushed_metal', c, roughness=0.29, anisotropy=0.48, brush_scale=145, detail_bump=0.014)
def geo_ring(name, loc, major, minor, m):
data = vars(product_module('smart_geometry_suite.max_procedural_primitives.mesh_generators'))['make_torus'](dict(radius1=major, radius2=minor, segments=112, sides=16))
return mesh(name, loc, data['verts'], data['faces'], 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 studio(bg, lightcol=(1, 0.85, 0.65)):
bx('Seamless studio floor', (0, 0, -0.24), (200, 200, 0.45), mat('Set', bg), 0)
light('Large diffusion', (-4.4, -5, 7), (0, 0, 1.6), 640, (1, 0.91, 0.8), 5)
light('Warm rim', (1.3, 3, 5), (0, 0, 1.5), 760, lightcol, 3.8)
light('Cool strip', (4, -1.2, 3.1), (0, 0, 1.4), 300, (0.6, 0.82, 1), 1.5, 4)
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))
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'
ivory = mat('Bone', (0.79, 0.72, 0.58), 0.15, 0.31)
gold = brushed('Champagne brass', (0.61, 0.36, 0.13))
skirt = product_module('smart_cloth_suite.core.skirt')
studio((0.18, 0.12, 0.17), (0.97, 0.55, 0.42))
wine = shader('Garnet velvet', 'build_velvet_sheen', (0.17, 0.009, 0.033), roughness=0.52, sheen=0.84, fiber_scale=110, fuzz_strength=0.035)
rose = shader('Rose folds', 'build_velvet_sheen', (0.32, 0.019, 0.058), roughness=0.53, sheen=0.81, fiber_scale=95, fuzz_strength=0.03)
stand = mat('Smoked plinth', (0.065, 0.037, 0.054), 0.35, 0.24)
cyl('Plinth', (0, 0, 0.095), 1.68, 0.18, stand)
geo_ring('Inlaid edge', (0, 0, 0.185), 1.62, 0.015, gold)
cyl('Display post', (0, 0, 0.48), 0.055, 0.6, gold)
ball('Dress form', (0, 0, 2.13), (0.352, 0.206, 0.54), ivory)
cyl('Neck', (0, 0, 2.67), 0.134, 0.3, ivory)
cyl('Finial', (0, 0, 2.84), 0.083, 0.07, gold)
lathe('Velvet bodice', (0, 0, 0), [(0.33, 1.6), (0.32, 1.81), (0.38, 2.02), (0.465, 2.19), (0.438, 2.3), (0.36, 2.35)], wine, 0.66)
for x in (-0.22, 0.22):
line('Dress strap', [(x, -0.21, 2.28), (x * 0.75, -0.13, 2.49), (x * 0.9, 0.13, 2.42), (x, 0.21, 2.28)], 0.034, wine)
yield
verts = []
faces = []
N = 168
rows = 18
for j in range(rows + 1):
u = j / rows
for i in range(N):
a = tau * i / N
wave = cos(18 * a + 1.35 * u)
rad = 0.32 + 0.83 * u ** 0.79 + (0.012 + 0.115 * u) * wave
verts.append((rad * cos(a) * (1 + 0.07 * u * sin(a)), rad * sin(a) * (0.66 + 0.17 * u), 1.77 - 1.38 * u + 0.085 * u * u * sin(3 * a + 0.5)))
for j in range(rows):
for i in range(N):
faces.append((j * N + i, (j + 1) * N + i, (j + 1) * N + (i + 1) % N, j * N + (i + 1) % N))
cloth = mesh('Pleated evening skirt', (0, 0, 0), verts, faces, wine)
cloth.data.materials.append(rose)
for f in cloth.data.polygons:
if f.index % N % 28 < 5:
f.material_index = 1
yield
(setup, error) = skirt.setup(cloth, band_ratio=0.19, quality=5)
assert setup and (not error), error
(res, error) = skirt.set_mode(cloth, skirt.MODE_CLOTH)
assert res and (not error) and cloth.modifiers.get(skirt.CLOTH_MODIFIER).show_render
assert cloth.vertex_groups.get(skirt.PIN_GROUP)
bpy.ops.object.effector_add(type='WIND', location=(-2.5, -1.9, 1))
wind = bpy.context.object
wind.rotation_euler = Vector((0.8, 0.4, 0.1)).to_track_quat('Z', 'Y').to_euler()
wind.field.strength = 140
scene.gravity.z = -3.3
for fr in range(1, 8):
scene.frame_set(fr)
bpy.context.view_layer.update()
cloth.evaluated_get(bpy.context.evaluated_depsgraph_get())
ring = geo_ring('Belt', (0, 0, 1.78), 0.336, 0.026, gold)
ring.scale.y = 0.67
shoot((2.15, -6.9, 2.9), (0, 0, 1.47), 4.5)
yield
course_key = 'SmartTools lesson / wardrobe'
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_cloth_suite', 'smart_geometry_suite', 'smart_shader_suite']:
product_module(required)
scene = bpy.data.scenes.new('Study / wardrobe')
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ファイルも保存します。
「Pleated evening skirt」を選び、データプロパティの頂点グループと、モディファイアーのクロスを確認します。タイムラインを1から7まで再生すると、固定された腰と自由に動く裾を見比べられます。
途中でファイルを閉じた場合は、新規ファイルで教材を最初から実行してください。
腰側にピンを設定し、横から風を当てて布を計算。シミュレーションの途中を撮影しました。
腰の頂点グループとクロスを設定し、シミュレーションに切り替えました。
腰まわりをピン留めしてクロスに切り替え、風を当てました。ベルトの位置と、20フレーム目に寄った裾のひだを比較できます。
体が右へ動いているフレーム 16 の比べです。「ボーン」では、スカートは骨のとおりに形を保ったまま体と一緒に動きます。「クロス」では、腰の所だけが付いて行き、裾は布として左に遅れます。
実画面で確かめるひだに2色のベルベットを割り当て、谷と山で光の当たり方が変わるようにしました。
SmartTools Shader の操作を見る ↗全機能と操作解説灰色だった 2 つのスザンヌが、どちらも同じ赤い材質になりました。材質は共有なので、あとで材質を直すと両方が変わります。
実画面で確かめるリング形状を生成し、腰の幅に合わせてベルトを整えています。
SmartTools Geometry の操作を見る ↗全機能と操作解説ターゲットを身頃に合わせ、首元から裾までが入る位置で撮影しました。
SmartTools CamLight の操作を見る ↗全機能と操作解説2027年1月1日発売予定。表示は税込・買い切り価格です。
ウエストを止めたまま、裾だけを揺らしたい
スカートと髪を揺らす作例はSmart Cloth単体で試せます。一括セットアップなどの連携機能には、別売のSimply Cloth Studioが必要です。
掲載した単品の合計 ¥5,420
この作品で使った収録製品
SmartTools Cloth
セット外の使用製品
SmartTools Shader · SmartTools Geometry · SmartTools CamLight
パックとセット外の掲載単品の合計 ¥8,920
掲載機能だけなら、単品の合計が¥3,500安くなります。
ほかに含まれる製品例
SmartTools Rig · SmartTools Animation
Simply Cloth Studio連携を使う場合のみ、同製品が別途必要です。スカートと髪の揺れはSmart Cloth単体で設定できます。 連携の条件