SmartTools
← 制作例の一覧
商品撮影

ヘアライン仕上げのカメラの商品写真

天板のヘアラインからレンズの映り込みまで、素材の違いが伝わる一枚です。

用意するもの

Blender 5.3.0

この完成画をBlenderで作る

作品用のモデルやテクスチャのダウンロードは不要です。下の教材で、形を組むところからカメラで撮るところまでを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')
    def aim(o, p):
        o.rotation_euler = (Vector(p) - o.location).to_track_quat('-Z', 'Y').to_euler()
    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'


    def material(name, color, metal=0, rough=0.38):
        m = bpy.data.materials.new(name)
        m.diffuse_color = (*color, 1)
        m.use_nodes = True
        bs = m.node_tree.nodes.get('Principled BSDF')
        for (k, val) in [('Base Color', (*color, 1)), ('Roughness', rough), ('Metallic', metal)]:
            bs.inputs[k].default_value = val
        return m
    def brushed(name, c, rough=0.26):
        m = bpy.data.materials.new(name)
        builders.build_brushed_metal(m, dict(base_color=[*c, 1], roughness=rough, anisotropy=0.55, brush_scale=165.0, detail_bump=0.012))
        assert m.node_tree.nodes.get('Principled BSDF') or any((n.type == 'BSDF_PRINCIPLED' for n in m.node_tree.nodes))
        return m
    silver = brushed('Smart Shader · champagne silver', (0.54, 0.58, 0.57))
    champ = brushed('Smart Shader · amber anodized', (0.72, 0.238, 0.047), 0.31)
    black = material('Charcoal anodized', (0.021, 0.029, 0.034), 0.78, 0.27)
    rubber = material('Milled grip', (0.017, 0.025, 0.027), 0.04, 0.49)
    tex = rubber.node_tree.nodes.new('ShaderNodeTexNoise')
    tex.inputs['Scale'].default_value = 210.0
    tex.inputs['Detail'].default_value = 3
    bump = rubber.node_tree.nodes.new('ShaderNodeBump')
    bump.inputs['Strength'].default_value = 0.26
    bump.inputs['Distance'].default_value = 0.018
    rubber.node_tree.links.new(tex.outputs['Fac'], bump.inputs['Height'])
    rubber.node_tree.links.new(bump.outputs[0], rubber.node_tree.nodes.get('Principled BSDF').inputs['Normal'])
    ink = material('Engraved inlay', (0.84, 0.86, 0.78), 0.1, 0.38)
    dark = material('Deep shadow', (0.007, 0.009, 0.013), 0.1, 0.24)
    aqua = material('Optical coating', (0.012, 0.06, 0.085), 0.78, 0.1)
    copper = material('Coated front element', (0.032, 0.022, 0.075), 0.85, 0.095)
    ceramic = material('Warm gray clay', (0.47, 0.49, 0.48), 0, 0.39)
    def bevel(o, width=0.02):
        if width:
            b = o.modifiers.new('Machined edge', 'BEVEL')
            b.width = width
            b.segments = 4
            b.harden_normals = True
        n = o.modifiers.new('Face normals', 'WEIGHTED_NORMAL')
        n.keep_sharp = True
        return o
    def finish(o, name, m):
        o.name = name
        o.data.materials.append(m)
        return o
    def box(name, loc, scale, mat, r=0.04):
        bpy.ops.mesh.primitive_cube_add(size=1, location=loc)
        o = bpy.context.object
        o.dimensions = scale
        bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
        return bevel(finish(o, name, mat), r)
    def cylinder(name, loc, rad, depth, mat, front=False, vertices=96, edge=0.012):
        bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, radius=rad, depth=depth, location=loc, rotation=(pi / 2 if front else 0, 0, 0))
        o = bpy.context.object
        for f in o.data.polygons:
            f.use_smooth = len(f.vertices) == 4
        return bevel(finish(o, name, mat), edge)
    def lathe(name, x, z, profile, mat):
        pts = []
        faces = []
        n = 144
        for (rad, y) in profile:
            for i in range(n):
                a = i * 2 * pi / n
                pts.append((x + rad * cos(a), y, z + rad * sin(a)))
        for j in range(len(profile) - 1):
            for i in range(n):
                k = (i + 1) % n
                f = j * n
                faces.append((f + i, f + k, f + n + k, f + n + i))
        mesh = bpy.data.meshes.new(name)
        mesh.from_pydata(pts, [], faces)
        mesh.update()
        o = bpy.data.objects.new(name, mesh)
        scene.collection.objects.link(o)
        finish(o, name, mat)
        for p in mesh.polygons:
            p.use_smooth = True
        return o
    def marks(name, center, radius, count, mat, front=False, w=0.014, length=0.045, height=0.013):
        (x, y, z) = center
        vs = []
        fs = []
        for i in range(count):
            a = 2 * pi * i / count
            u = Vector((cos(a), 0, sin(a))) if front else Vector((cos(a), sin(a), 0))
            v = Vector((-sin(a), 0, cos(a))) if front else Vector((-sin(a), cos(a), 0))
            axis = Vector((0, 1, 0)) if front else Vector((0, 0, 1))
            cc = Vector((x, y, z)) + radius * u
            start = len(vs)
            for (a1, b, c) in [(-1, -1, -1), (1, -1, -1), (1, 1, -1), (-1, 1, -1), (-1, -1, 1), (1, -1, 1), (1, 1, 1), (-1, 1, 1)]:
                vs.append(cc + a1 * u * w / 2 + b * v * height / 2 + c * axis * length / 2)
            fs.extend((tuple((start + j for j in f)) for f in [(0, 3, 2, 1), (4, 5, 6, 7), (0, 1, 5, 4), (3, 7, 6, 2), (1, 2, 6, 5), (0, 4, 7, 3)]))
        mesh = bpy.data.meshes.new(name)
        mesh.from_pydata(vs, [], fs)
        mesh.update()
        o = bpy.data.objects.new(name, mesh)
        scene.collection.objects.link(o)
        finish(o, name, mat)
        return o
    def typeface(txt, loc, size, mat, rot=(pi / 2, 0, 0), align='CENTER'):
        cu = bpy.data.curves.new('Engraving', 'FONT')
        cu.body = txt
        cu.size = size
        cu.align_x = align
        cu.align_y = 'CENTER'
        cu.space_character = 1.15
        ob = bpy.data.objects.new('Engraving ' + txt, cu)
        scene.collection.objects.link(ob)
        ob.location = loc
        ob.rotation_euler = rot
        ob.data.materials.append(mat)
        return ob
    box('Chassis', (0, 0, 1.09), (3.65, 1.0, 2.14), black, 0.18)
    box('Wrapping', (0, -0.032, 0.96), (3.68, 1.035, 1.69), rubber, 0.18)
    box('Base casting', (0, 0, 0.128), (3.67, 1.05, 0.22), silver, 0.083)
    box('Top casting', (0, 0, 1.98), (3.69, 1.08, 0.48), silver, 0.12)
    box('Top gasket', (0, -0.015, 1.757), (3.59, 1.036, 0.035), black, 0.015)
    box('Grip', (1.4, -0.491, 1.0), (0.61, 0.32, 1.33), rubber, 0.16)
    for (x, z, w, h) in [(-1.27, 1.992, 0.67, 0.289), (-0.62, 1.993, 0.232, 0.235)]:
        box('Finder recess', (x, -0.544, z), (w, 0.044, h), black, 0.037)
        box('Finder face', (x, -0.57, z), (w - 0.067, 0.026, h - 0.057), aqua, 0.025)
        box('Finder reflection', (x - 0.07 * w, -0.587, z + 0.023), (w * 0.56, 0.008, h * 0.27), copper, 0.012)
    typeface('S / 35', (0.85, -0.548, 1.988), 0.142, black)
    for (x, y, r, h, m) in [(-1.23, 0.02, 0.31, 0.096, black), (0.79, 0.07, 0.45, 0.19, black), (1.43, -0.17, 0.197, 0.082, silver)]:
        cylinder('Top dial', (x, y, 2.22 + h / 2), r, h, m)
        marks('Dial fluting', (x, y, 2.22 + h / 2), r, 54, silver, w=0.012, length=h * 0.7, height=0.012)
        cylinder('Dial face', (x, y, 2.225 + h), r * 0.94, 0.025, m if x < 1.3 else champ)
    for i in range(9):
        a = i / 9 * 2 * pi
        typeface(['A', '2', '4', '8', '15', '30', '60', '125', '250'][i], (0.79 + 0.325 * cos(a), 0.07 + 0.325 * sin(a), 2.429), 0.091, ink, (0, 0, a - pi / 2))
    typeface('ISO', (0.79, 0.07, 2.429), 0.089, ink, (0, 0, 0))
    box('Shoe', (0, 0.15, 2.245), (0.54, 0.43, 0.058), black, 0.02)
    for xx in [-0.225, 0.225]:
        box('Shoe track', (xx, 0.15, 2.292), (0.09, 0.48, 0.07), silver, 0.016)

    yield
    (x, z) = (-0.29, 0.993)
    for (y, r, depth, m) in [(-0.567, 0.877, 0.15, silver), (-0.69, 0.82, 0.13, black), (-0.775, 0.805, 0.05, champ), (-0.92, 0.785, 0.255, black), (-1.12, 0.79, 0.17, rubber), (-1.26, 0.767, 0.16, black)]:
        cylinder('Lens barrel', (x, y, z), r, depth, m, True)
    marks('Focus grip', (x, -1.118, z), 0.79, 116, black, True, w=0.016, length=0.15, height=0.018)
    for (y, rad, mat) in [(-0.845, 0.789, silver), (-0.99, 0.787, black), (-1.216, 0.785, champ), (-1.335, 0.758, silver)]:
        lathe('Bezel', x, z, [(rad - 0.013, y + 0.005), (rad, y), (rad - 0.01, y - 0.006)], mat)
    lathe('Front rim', x, z, [(0.767, -1.338), (0.756, -1.365), (0.561, -1.365), (0.537, -1.32), (0.51, -1.314)], black)
    for i in range(5):
        r = 0.537 - 0.016 * i
        y = -1.337 - 0.007 * i
        lathe('Optical baffle', x, z, [(r, y + 0.009), (r, y), (r - 0.014, y - 0.005)], aqua if i == 3 else black)
    lathe('Front optic', x, z, [(0.472, -1.372), (0.461, -1.397), (0.405, -1.413), (0.33, -1.425), (0.24, -1.43), (0.1, -1.436), (0.0001, -1.437)], copper)
    for (radius, y, m) in [(0.297, -1.438, aqua), (0.221, -1.451, dark), (0.114, -1.46, aqua)]:
        lathe('Internal optical group', x, z, [(radius, y + 0.007), (radius * 0.91, y - 0.002), (radius * 0.66, y - 0.006), (0.0001, y - 0.007)], m)
    for (txt, middle) in [('ASPHERICAL', 1.58), ('1:2  /  35 mm', 4.72)]:
        step = 0.105
        for (i, ch) in enumerate(txt):
            a = middle + (len(txt) / 2 - i) * step
            typeface(ch, (x + 0.645 * cos(a), -1.369, z + 0.645 * sin(a)), 0.091, ink, (pi / 2, pi / 2 - a, 0))
    for xh in (-1.55, 1.56):
        cylinder('Case screw', (xh, -0.525, 0.2), 0.046, 0.014, black, True, 32, 0.002)
        box('Screw slot', (xh, -0.535, 0.2), (0.055, 0.004, 0.008), silver, 0.002)

    yield
    floor = material('Studio cyclorama', (0.032, 0.056, 0.066), 0.14, 0.47)
    box('Studio floor', (0, 0, -0.12), (200, 200, 0.21), floor, 0.0)
    world = bpy.data.worlds.new('Studio world')
    scene.world = world
    world.use_nodes = True
    world.node_tree.nodes['Background'].inputs[0].default_value = (0.18, 0.23, 0.28, 1)
    world.node_tree.nodes['Background'].inputs[1].default_value = 0.24
    def point(obj, to):
        obj.rotation_euler = (Vector(to) - obj.location).to_track_quat('-Z', 'Y').to_euler()
    def light(name, pos, power, color, siz, sy, to=(0, 0, 0.95)):
        data = bpy.data.lights.new(name, 'AREA')
        data.energy = power
        data.color = color
        data.shape = 'RECTANGLE'
        data.size = siz
        data.size_y = sy
        ob = bpy.data.objects.new(name, data)
        scene.collection.objects.link(ob)
        ob.location = pos
        point(ob, to)
    light('Softbox', (-4, -3.8, 6.4), 610, (0.9, 0.96, 1), 5, 3.1)
    light('Front strip', (3.8, -4, 3.2), 230, (0.78, 0.91, 1), 1.2, 4)
    light('Warm edge', (1.6, 2.2, 5.4), 740, (1, 0.73, 0.48), 3.2, 3.5)
    light('Rim strip', (-3, 2.3, 2.8), 410, (0.4, 0.81, 1), 1.4, 3.3)
    light('Optic highlight', (-0.85, -4.9, 2.0), 25, (0.74, 0.83, 1), 0.47, 1.06, (0, -1, 1))
    camdata = bpy.data.cameras.new('Product study')
    cam = bpy.data.objects.new('Product study', camdata)
    scene.collection.objects.link(cam)
    scene.camera = cam
    def shot(pos, target, scale):
        cam.location = pos
        point(cam, target)
        camdata.type = 'ORTHO'
        camdata.ortho_scale = scale
    scene.render.engine = 'CYCLES'
    scene.cycles.samples = 28
    scene.cycles.use_denoising = True
    scene.render.threads_mode = 'FIXED'
    scene.render.threads = 5
    scene.render.resolution_x = 1430
    scene.render.resolution_y = 900
    scene.render.resolution_percentage = 100
    scene.render.image_settings.file_format = 'PNG'
    scene.render.image_settings.color_mode = 'RGB'
    shoot((3.7, -9, 3.98), (0, -0.25, 1.08), 5.2)
    scene.render.resolution_x = 1120
    scene.render.resolution_y = 730
    scene.cycles.samples = 24

    yield


course_key = 'SmartTools lesson / camera'
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_shader_suite']:
        product_module(required)
    scene = bpy.data.scenes.new('Study / camera')
    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」で全体を表示できます。

  1. ボディと上面ダイヤルを作る
  2. レンズ筒と前玉を重ねる
  3. スタジオの光と画角を合わせる
2回目の実行後の形状:ヘアライン仕上げのカメラの商品写真
2回目の実行後。照明と材質を外したソリッド表示で、形と配置を確認できます。

完成画を確認して保存する

「ビュー」→「カメラ」→「アクティブカメラ」で上の掲載画像と構図を見比べます。「レンダー」→「画像をレンダリング」(F12)を選び、表示された画像の「画像」→「名前を付けて保存」でPNGを保存します。教材シーンを後から編集するには、.blendファイルも保存します。

自分で1か所変えてみる

アウトライナーで「Front optic」を選び、テンキーの「.」で前玉に寄ります。周囲のリングは別メッシュです。カメラビューに戻すと、リングの反射が重なって見えます。

途中でファイルを閉じた場合は、新規ファイルで教材を最初から実行してください。

こんなときに

金属と黒いグリップが同じ質感に見えてしまう

斜めから入る大きな光を金属の面に映し、グリップには細かな凹凸を残しています。

完成画の部分拡大
レンズまわりで金属とグリップを見分ける完成画の部分拡大

レンズまわりで金属とグリップを見分ける

上蓋には磨いた金属、ボディには細かな凹凸のある黒いグリップを割り当てました。上蓋に走る長い光と、グリップで細かく散る光を見比べてください。

金属の質感「ヘアラインメタル」を貼る

この作品のどこに使ったか

  1. 01

    金属の天板

    ヘアラインメタルの材質を使い、磨き方向に沿う反射を出しました。

    SmartTools Shader の操作を見る ↗全機能と操作解説
    同じ形で、6つの材質を見比べる
    1. 3Dビューで色を変えたいメッシュを選び、表示を「マテリアルプレビュー」にします。
    2. Nキー → Smart Shader →「PBRマテリアル生成」で、カテゴリ「PBR」、プリセット「ヘアラインメタル」を選びます。
    3. 「プリセットルックマテリアル作成」を押します。シェーダーエディターで作成された材質を開くと、金属の度合いを表す Metallic は 1.0 です。
  2. 02

    レンズを見せる視点

    カメラ本体の前方にターゲットを置き、天板と正面のレンズを一緒に見せています。

    レンズに狙いを置いたまま、撮影位置を回す

    被写体の前面に注視点を固定し、リグの撮影位置を48度回しました。レンズを狙ったまま、ボディの厚みと天板が見える方向へ移れます。

    レンズと天板を見せる正面寄りの構図
    レンズと天板を見せる正面寄りの構図
    横から見た撮影リグ。カメラから被写体に注視線が伸びる
    横から見た撮影リグ。カメラから被写体に注視線が伸びる
    同じ注視点を追う横寄りの構図
    同じ注視点を追う横寄りの構図
    SmartTools CamLight の操作を見る ↗全機能と操作解説
    カメラリグを作成
    1. リグを作り、ターゲットを選んだ状態にします。ターゲットを動かすと、カメラがそちらを向きます。このカメラの前のリグの目印と拘束は、新しい物に置き換わります。

この制作例から製品を選ぶ

2027年1月1日発売予定。表示は税込・買い切り価格です。

同じ分野で用途を広げる

この作品で使った収録製品
SmartTools Shader · SmartTools CamLight

セットで掲載機能を揃える場合 ¥4,980
掲載機能だけなら、単品の合計が¥2,020安くなります。

ほかに含まれる製品例
SmartTools Paint · SmartTools Node

4セットと全22本版を比較する →
← ほかの制作例を見る