AGENT SKILL

3d-blender-python-procedural-modeling

Automate 3D geometry generation, UV unwrapping, PBR material assignment, and glTF asset export using the Blender Python (bpy) API.

License 许可
MIT
最近更新
2026-11-09
Stars
★ 0
Forks
0

01 前言 Front Matter

name
3d-blender-python-procedural-modeling
risk
low
tags
[ "3d", "blender", "python", "bpy", "procedural", "gltf" ]
author
AAS Platform
source
authoring
version
1.0.0
category
3d
description
Automate 3D geometry generation, UV unwrapping, PBR material assignment, and glTF asset export using the Blender Python (bpy) API.
disable-model-invocation
false

03 SKILL.md 正文

Blender Python (bpy) Procedural Modeling and Asset Pipeline

Overview & Core Principles

Automate 3D geometry generation, UV unwrapping, PBR material assignment, and glTF asset export using the Blender Python (bpy) API.

Procedural Pipeline Invariants

  1. Context Management in Headless Mode:
    • Run via CLI: blender -b --python script.py.
    • Ensure active object context is explicitly assigned (bpy.context.view_layer.objects.active = obj) before operator invocation.
  2. Mesh Topology Generation:
import bpy
import bmesh

def create_parametric_gear(teeth=16, radius=2.0):
    mesh = bpy.data.meshes.new("ParametricGear")
    obj = bpy.data.objects.new("ParametricGear", mesh)
    bpy.context.collection.objects.link(obj)
    
    bm = bmesh.new()
    bmesh.ops.create_circle(bm, cap_ends=True, radius=radius, segments=teeth*2)
    bm.to_mesh(mesh)
    bm.free()
    return obj
  1. Export Standards:
    • glTF 2.0 binary (.glb) format with Draco mesh compression.
    • PBR roughness/metallic packed into green/blue channels of metallicRoughness map.

04 同仓库更多 Skills