Skip to content

Instantly share code, notes, and snippets.

# バイナリエディタ🙂
import ctypes, hashlib, math, os, random, sys
import PySide6.QtCore as C
import PySide6.QtGui as G
import PySide6.QtWidgets as W
MONOSPACE_FONT = 'MS ゴシック'
class Application(W.QApplication):
"""アプリ全体を表す抽象的なクラスです。"""
def __init__(self):
super().__init__(sys.argv)
# Blender 質感・マテリアル設定実践テクニック
# ひび割れの作り方
# 3-06-01.blend 3-06-02.blend 3-06-03.blend
import bpy
class CrackType:
"""ひび割れの種類です。"""
NOISE = 1 # 大まかなひび割れ
VORONOI = 2 # 細かいひび割れ
MUSGRAVE = 3 # 不規則性の高いひび割れ
# Blender 質感・マテリアル設定実践テクニック
# 3-05-02.blend 錆びの作り方
import bpy
NOT_MODIFIED = False
object = bpy.data.objects['export3dcoat'] # シーンに配置済みのオブジェクト
slot = object.material_slots[0] # そのマテリアルスロット
material = slot.material # に設定されているマテリアル
node_tree = material.node_tree # のノードネットワーク
nodes = node_tree.nodes # にある各ノード
def delete():
# Blender 質感・マテリアル設定実践テクニック
# 3-04-01.blend ドロドロ汚れの作り方
import bpy
NOT_MODIFIED = False
object = bpy.data.objects['export3dcoat'] # シーンに配置済みのオブジェクト
slot = object.material_slots[0] # そのマテリアルスロット
material = slot.material # に設定されているマテリアル
node_tree = material.node_tree # のノードネットワーク
nodes = node_tree.nodes # にある各ノード
def delete():
# Blender 質感・マテリアル設定実践テクニック
# 3-03-2.blend ガラスのくすみ・表面劣化
import bpy
NOT_MODIFIED = False
object = bpy.data.objects['export3dcoat'] # シーンに配置済みのオブジェクト
slot = object.material_slots[0] # そのマテリアルスロット
material = slot.material # に設定されているマテリアル
node_tree = material.node_tree # のノードネットワーク
# Blender 質感・マテリアル設定実践テクニック 3-03-1.blend
import bpy
object = bpy.data.objects['export3dcoat'] # シーンに配置済みのオブジェクト
slot = object.material_slots[0] # そのマテリアルスロット
material = slot.material # に設定されているマテリアル
node_tree = material.node_tree # のノードネットワーク
nodes = node_tree.nodes # にある各ノード
def delete():
"""過去に生成したノードを削除します。"""
for node in nodes:
# Blender 質感・マテリアル設定実践テクニック 3-03-1.blend
import bpy
object = bpy.data.objects['export3dcoat'] # シーンに配置済みのオブジェクト
slot = object.material_slots[0] # そのマテリアルスロット
material = slot.material # に設定されているマテリアル
node_tree = material.node_tree # のノードネットワーク
nodes = node_tree.nodes # にある各ノード
def delete():
"""過去に生成したノードを削除します。"""
for node in nodes:
# BlenderユーザーのためのPython入門
# 第26節 ギャグマシーンを作成する
import bpy
import math
import random
# 人体を構成する10個のオブジェクトです。
objs = []
# 身体の各部分に許容する回転角です。
rot_range = (10, 45, 90, 90, 90, 90, 90, 90, 90, 90)
def make_cube(parent, loc, scale, pivot, name):
"""Makes all objects' material metallic."""
import bpy
USE_TRANSMISSION = False
def remove():
"""Removes previously created materials."""
for material in bpy.data.materials:
if material.name == 'MyMaterial':
bpy.data.materials.remove(material)
def create_material():
"""Creates a metallic material and returns it."""
# BlenderユーザーのためのPython入門
# 第25節 ボーンを作成してボーンアニメーションさせる
import bpy
import math
import mathutils
class BoneAnimation():
def __init__(self):
"""既存のアーマチュアとメッシュを削除します。"""
for armature in bpy.data.armatures:
assert isinstance(armature, bpy.types.Armature)