[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FA3RGJMSTQDPY46ASJX62Q":3,"skill-same:01M7FA3RGJMSTQDPY46ASJX62Q":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":13,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7FA3RGJMSTQDPY46ASJX62Q","blender-syntax-materials",null,"Use when creating or modifying Blender materials and shader nodes via Python. Prevents the breaking change of using old Principled BSDF input names (e.g., \"Subsurface\" renamed to \"Subsurface Weight\" in 4.0). Covers material creation, node tree setup, Principled BSDF input mapping, UV assignment, texture loading, and material slot management. Keywords: material, shader, Principled BSDF, node tree, texture, UV map, material_slot, ShaderNodeBsdfPrincipled, node links, Blender materials, assign material to object, create material from code, change color.","lagzgabrielmuller-dot\u002Fkit-ingenieria-3d","lagzgabrielmuller-dot","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F333339260?v=4","01M7F985KYC0XB2XZ97B5YWH4C","01M7F985MHK8N2NVE4VAR5WBWS",0,"MIT","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fblender\u002Fsyntax\u002Fblender-syntax-materials\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: blender-syntax-materials\ndescription: >\n  Use when creating or modifying Blender materials and shader nodes via Python. Prevents\n  the breaking change of using old Principled BSDF input names (e.g., \"Subsurface\" renamed\n  to \"Subsurface Weight\" in 4.0). Covers material creation, node tree setup, Principled BSDF\n  input mapping, UV assignment, texture loading, and material slot management.\n  Keywords: material, shader, Principled BSDF, node tree, texture, UV map, material_slot, ShaderNodeBsdfPrincipled, node links, Blender materials, assign material to object, create material from code, change color.\nlicense: MIT\ncompatibility: \"Designed for Claude Code. Requires Blender 3.x\u002F4.x\u002F5.x with Python.\"\nmetadata:\n  author: OpenAEC-Foundation\n  version: \"1.0\"\n---\n\n# blender-syntax-materials\n\n## Quick Reference\n\n### Critical Warnings\n\n**NEVER** use Blender 3.x Principled BSDF socket names in 4.0+ code. Sockets were renamed in 4.0 (e.g., `\"Subsurface\"` -> `\"Subsurface Weight\"`). Using old names raises `KeyError`.\n\n**NEVER** use `mat.blend_method` in Blender 4.2+. This property was removed. Use `mat.surface_render_method` instead.\n\n**NEVER** access UV data per-vertex. UV coordinates are stored per-loop (per face corner). Access via `uv_layers.data[loop_index]`.\n\n**NEVER** call `bpy.data.images.load()` without `check_existing=True`. Omitting it creates duplicate image data blocks on repeated loads.\n\n**NEVER** set `colorspace_settings.name` incorrectly. Use `'sRGB'` for color\u002Fdiffuse textures and `'Non-Color'` for normal maps, roughness, metallic, and other data textures.\n\n**ALWAYS** set `mat.use_nodes = True` before accessing `mat.node_tree`. Without this, `node_tree` is `None`.\n\n**ALWAYS** store the reference returned by `bpy.data.materials.new()`. Blender may append `.001` if the name already exists.\n\n### Version Decision Tree\n\n```\nCreating material code?\n├── Target Blender 4.0+ ONLY?\n│   ├── YES → Use 4.0+ Principled BSDF socket names directly\n│   └── NO → Use version-safe helper (see Pattern 3)\n│\nSetting transparency\u002Falpha blending?\n├── Blender 4.2+?\n│   ├── YES → mat.surface_render_method = 'BLENDED'\n│   └── NO (3.x \u002F 4.0-4.1) → mat.blend_method = 'BLEND'\n│\nConnecting texture to Principled BSDF?\n├── Color texture (diffuse, base color)?\n│   └── Connect to \"Base Color\" input (all versions)\n├── Normal map?\n│   └── Connect via ShaderNodeNormalMap → \"Normal\" input\n└── Data texture (roughness, metallic, AO)?\n    └── Set image colorspace to 'Non-Color'\n```\n\n---\n\n## Essential Patterns\n\n### Pattern 1: Create and Assign a Material\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: create material and assign to object\nimport bpy\n\nmat = bpy.data.materials.new(name=\"MyMaterial\")\nmat.use_nodes = True  # REQUIRED before accessing node_tree\n\nobj = bpy.context.active_object\nif obj.data.materials:\n    obj.data.materials[0] = mat   # Replace first slot\nelse:\n    obj.data.materials.append(mat)  # Add new slot\n```\n\n### Pattern 2: Build a Complete Node Tree\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: node tree from scratch\nmat = bpy.data.materials.new(\"NodeMaterial\")\nmat.use_nodes = True\ntree = mat.node_tree\n\n# Clear defaults\ntree.nodes.clear()\n\n# Create nodes\nprincipled = tree.nodes.new('ShaderNodeBsdfPrincipled')\nprincipled.location = (0, 0)\n\noutput = tree.nodes.new('ShaderNodeOutputMaterial')\noutput.location = (400, 0)\n\n# Link BSDF to output\ntree.links.new(principled.outputs[\"BSDF\"], output.inputs[\"Surface\"])\n```\n\n### Pattern 3: Version-Safe Principled BSDF Input Access\n\n```python\n# Blender 3.x\u002F4.0+: handle renamed sockets\nimport bpy\n\ndef set_principled_value(node, socket_3x, socket_4x, value):\n    \"\"\"Set Principled BSDF input with version-safe socket name.\"\"\"\n    if bpy.app.version >= (4, 0, 0):\n        socket_name = socket_4x\n    else:\n        socket_name = socket_3x\n    if socket_name in node.inputs:\n        node.inputs[socket_name].default_value = value\n\n# Usage\nset_principled_value(principled, \"Subsurface\", \"Subsurface Weight\", 0.1)\nset_principled_value(principled, \"Specular\", \"Specular IOR Level\", 0.5)\nset_principled_value(principled, \"Transmission\", \"Transmission Weight\", 1.0)\nset_principled_value(principled, \"Coat\", \"Coat Weight\", 0.3)\nset_principled_value(principled, \"Sheen\", \"Sheen Weight\", 0.1)\nset_principled_value(principled, \"Emission\", \"Emission Color\", (1, 1, 1, 1))\n```\n\n### Pattern 4: Texture Node with UV Mapping\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: image texture with UV coordinates\ntree = mat.node_tree\n\ntex_coord = tree.nodes.new('ShaderNodeTexCoord')\ntex_coord.location = (-800, 0)\n\nmapping = tree.nodes.new('ShaderNodeMapping')\nmapping.location = (-600, 0)\n\ntex_node = tree.nodes.new('ShaderNodeTexImage')\ntex_node.location = (-400, 0)\nimg = bpy.data.images.load(\"\u002Fpath\u002Fto\u002Ftexture.png\", check_existing=True)\ntex_node.image = img\n\n# Link: TexCoord → Mapping → Image Texture → Principled BSDF\ntree.links.new(tex_coord.outputs[\"UV\"], mapping.inputs[\"Vector\"])\ntree.links.new(mapping.outputs[\"Vector\"], tex_node.inputs[\"Vector\"])\ntree.links.new(tex_node.outputs[\"Color\"], principled.inputs[\"Base Color\"])\n```\n\n### Pattern 5: Alpha\u002FTransparency Setup (Version-Dependent)\n\n```python\n# Blender 4.2+: EEVEE transparency\nmat.surface_render_method = 'BLENDED'  # 4.2+ ONLY\n\n# Blender 3.x \u002F 4.0-4.1: EEVEE transparency\n# mat.blend_method = 'BLEND'  # REMOVED in 4.2\n\n# Version-safe pattern\nif bpy.app.version >= (4, 2, 0):\n    mat.surface_render_method = 'BLENDED'\nelse:\n    mat.blend_method = 'BLEND'\n```\n\n---\n\n## Principled BSDF Socket Rename Table (3.x -> 4.0+)\n\n| Blender 3.x Name | Blender 4.0+ Name | Notes |\n|---|---|---|\n| `Base Color` | `Base Color` | Unchanged |\n| `Subsurface` | `Subsurface Weight` | Renamed |\n| `Subsurface Color` | **REMOVED** | Use `Base Color` instead |\n| `Specular` | `Specular IOR Level` | Renamed |\n| `Specular Tint` | `Specular Tint` | Type changed: Float -> Color |\n| `Transmission` | `Transmission Weight` | Renamed |\n| `Coat` | `Coat Weight` | Renamed |\n| `Sheen` | `Sheen Weight` | Renamed |\n| `Emission` | `Emission Color` | Renamed |\n| `Metallic` | `Metallic` | Unchanged |\n| `Roughness` | `Roughness` | Unchanged |\n| `IOR` | `IOR` | Unchanged |\n| `Alpha` | `Alpha` | Unchanged |\n| `Normal` | `Normal` | Unchanged |\n\n---\n\n## Common Operations\n\n### Assign Material to Specific Faces\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: multi-material assignment\nimport bpy\n\nobj = bpy.context.active_object\n\n# Add two materials to object\nmat_a = bpy.data.materials.new(\"Material_A\")\nmat_b = bpy.data.materials.new(\"Material_B\")\nobj.data.materials.append(mat_a)\nobj.data.materials.append(mat_b)\n\n# Assign material index per polygon\nfor polygon in obj.data.polygons:\n    if polygon.center.z > 0:\n        polygon.material_index = 1  # Material_B\n    else:\n        polygon.material_index = 0  # Material_A\n```\n\n### Add Material Slot via Operator\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: operator-based slot management\nimport bpy\n\nobj = bpy.context.active_object\nbpy.context.view_layer.objects.active = obj\n\n# Add empty slot\nbpy.ops.object.material_slot_add()\n\n# Assign material to active slot\nobj.material_slots[obj.active_material_index].material = mat\n\n# Remove active slot\nbpy.ops.object.material_slot_remove()\n```\n\n### Access Default Principled BSDF\n\nWhen `use_nodes = True` is set on a new material, Blender creates a default Principled BSDF and Material Output automatically.\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: access default nodes without clearing\nmat = bpy.data.materials.new(\"QuickMaterial\")\nmat.use_nodes = True\nprincipled = mat.node_tree.nodes.get(\"Principled BSDF\")\n# principled is the auto-created ShaderNodeBsdfPrincipled\n```\n\n### UV Layer Management\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: UV layer access\nmesh = obj.data\n\n# List UV layers\nfor uv_layer in mesh.uv_layers:\n    print(uv_layer.name)\n\n# Get active UV layer\nactive_uv = mesh.uv_layers.active\n\n# Create new UV layer\nnew_uv = mesh.uv_layers.new(name=\"ProjectionUV\")\n\n# Read UV coordinates (per-loop, NOT per-vertex)\nfor loop_idx in range(len(mesh.loops)):\n    uv = active_uv.data[loop_idx].uv\n    # uv.x, uv.y are the coordinates\n\n# Modify UV coordinates\nfor loop_idx in range(len(mesh.loops)):\n    active_uv.data[loop_idx].uv.x *= 2.0\n    active_uv.data[loop_idx].uv.y *= 2.0\n```\n\n### Load and Configure Image Textures\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: image loading\nimport bpy\n\n# Load from file (reuse existing if already loaded)\nimg = bpy.data.images.load(\"\u002Fpath\u002Fto\u002Ftexture.png\", check_existing=True)\n\n# Create new blank image (for baking)\nimg = bpy.data.images.new(\"BakeTarget\", width=2048, height=2048)\n\n# Configure texture node\ntex_node = tree.nodes.new('ShaderNodeTexImage')\ntex_node.image = img\ntex_node.interpolation = 'Linear'   # 'Linear', 'Closest', 'Cubic', 'Smart'\ntex_node.projection = 'FLAT'        # 'FLAT', 'BOX', 'SPHERE', 'TUBE'\ntex_node.extension = 'REPEAT'       # 'REPEAT', 'EXTEND', 'CLIP'\n\n# Set color space\nimg.colorspace_settings.name = 'sRGB'       # For diffuse\u002Fcolor textures\n# img.colorspace_settings.name = 'Non-Color' # For normal, roughness, metallic\n```\n\n### Normal Map Setup\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: normal map node chain\ntree = mat.node_tree\n\nnormal_tex = tree.nodes.new('ShaderNodeTexImage')\nnormal_tex.image = bpy.data.images.load(\"\u002Fpath\u002Fto\u002Fnormal.png\", check_existing=True)\nnormal_tex.image.colorspace_settings.name = 'Non-Color'  # REQUIRED for normal maps\n\nnormal_map = tree.nodes.new('ShaderNodeNormalMap')\n\ntree.links.new(normal_tex.outputs[\"Color\"], normal_map.inputs[\"Color\"])\ntree.links.new(normal_map.outputs[\"Normal\"], principled.inputs[\"Normal\"])\n```\n\n### Remove All Materials from Object\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: clear all material slots\nobj.data.materials.clear()\n```\n\n---\n\n## Common Shader Node Types\n\n| Node Type String | Class | Purpose |\n|---|---|---|\n| `'ShaderNodeBsdfPrincipled'` | Principled BSDF | Main PBR shader |\n| `'ShaderNodeOutputMaterial'` | Material Output | Final output |\n| `'ShaderNodeTexImage'` | Image Texture | Load image files |\n| `'ShaderNodeTexCoord'` | Texture Coordinate | UV, Object, Generated coords |\n| `'ShaderNodeMapping'` | Mapping | Transform texture coordinates |\n| `'ShaderNodeNormalMap'` | Normal Map | Convert image to normal vector |\n| `'ShaderNodeMixShader'` | Mix Shader | Blend two shaders |\n| `'ShaderNodeBsdfTransparent'` | Transparent BSDF | Transparency shader |\n| `'ShaderNodeBsdfGlass'` | Glass BSDF | Glass shader |\n| `'ShaderNodeMath'` | Math | Scalar math operations |\n| `'ShaderNodeMixRGB'` | Mix (Color) | Blend colors (3.x name) |\n| `'ShaderNodeMix'` | Mix | Blend colors\u002Fvectors (4.0+) |\n| `'ShaderNodeValToRGB'` | Color Ramp | Map value to color gradient |\n| `'ShaderNodeBump'` | Bump | Generate bump from height |\n| `'ShaderNodeSeparateXYZ'` | Separate XYZ | Split vector components |\n| `'ShaderNodeCombineXYZ'` | Combine XYZ | Merge components to vector |\n| `'ShaderNodeTexNoise'` | Noise Texture | Procedural noise |\n| `'ShaderNodeTexVoronoi'` | Voronoi Texture | Procedural voronoi |\n| `'ShaderNodeGroup'` | Node Group | Reusable node group instance |\n\n---\n\n## EEVEE vs Cycles Material Differences\n\n| Property | EEVEE | Cycles | Notes |\n|---|---|---|---|\n| Transparency | Requires `surface_render_method` (4.2+) or `blend_method` (3.x-4.1) | Automatic from Alpha | EEVEE needs explicit config |\n| Screen Space Refraction | `mat.use_screen_refraction = True` | Not needed | EEVEE-specific |\n| Backface Culling | `mat.use_backface_culling` | `mat.use_backface_culling` | Same API |\n| Displacement | `mat.cycles.displacement_method` | `mat.cycles.displacement_method` | Cycles-only |\n| Shadow Mode | `mat.shadow_method` (3.x-4.1) | Automatic | EEVEE-specific |\n\n---\n\n## Version-Specific Migration Rules\n\n| Feature | Blender 3.x | Blender 4.0+ | Blender 4.2+ |\n|---|---|---|---|\n| Principled BSDF sockets | Old names | New names (see table) | Same as 4.0 |\n| Alpha blending (EEVEE) | `mat.blend_method = 'BLEND'` | `mat.blend_method = 'BLEND'` | `mat.surface_render_method = 'BLENDED'` |\n| Shadow method (EEVEE) | `mat.shadow_method` | `mat.shadow_method` | Property restructured |\n| Mix node | `'ShaderNodeMixRGB'` | `'ShaderNodeMix'` (preferred) | `'ShaderNodeMix'` |\n| Specular Tint type | Float (0.0-1.0) | Color (RGBA) | Color (RGBA) |\n\n---\n\n## Reference Links\n\n- [references\u002Fmethods.md](references\u002Fmethods.md) — Complete API signatures for Material, NodeTree, ShaderNode, UV layers, Image\n- [references\u002Fexamples.md](references\u002Fexamples.md) — Working code examples for common material workflows\n- [references\u002Fanti-patterns.md](references\u002Fanti-patterns.md) — What NOT to do with materials, with WHY explanations\n\n### Official Sources\n\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.Material.html\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.ShaderNodeBsdfPrincipled.html\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.ShaderNodeTree.html\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.UVLoopLayers.html\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.Image.html\n- https:\u002F\u002Fdeveloper.blender.org\u002Fdocs\u002Frelease_notes\u002F4.0\u002Fpython_api\u002F\n","# blender-syntax-materials\n\n## Quick Reference\n\n### Critical Warnings\n\n**NEVER** use Blender 3.x Principled BSDF socket names in 4.0+ code. Sockets were renamed in 4.0 (e.g., `\"Subsurface\"` -> `\"Subsurface Weight\"`). Using old names raises `KeyError`.\n\n**NEVER** use `mat.blend_method` in Blender 4.2+. This property was removed. Use `mat.surface_render_method` instead.\n\n**NEVER** access UV data per-vertex. UV coordinates are stored per-loop (per face corner). Access via `uv_layers.data[loop_index]`.\n\n**NEVER** call `bpy.data.images.load()` without `check_existing=True`. Omitting it creates duplicate image data blocks on repeated loads.\n\n**NEVER** set `colorspace_settings.name` incorrectly. Use `'sRGB'` for color\u002Fdiffuse textures and `'Non-Color'` for normal maps, roughness, metallic, and other data textures.\n\n**ALWAYS** set `mat.use_nodes = True` before accessing `mat.node_tree`. Without this, `node_tree` is `None`.\n\n**ALWAYS** store the reference returned by `bpy.data.materials.new()`. Blender may append `.001` if the name already exists.\n\n### Version Decision Tree\n\n```\nCreating material code?\n├── Target Blender 4.0+ ONLY?\n│   ├── YES → Use 4.0+ Principled BSDF socket names directly\n│   └── NO → Use version-safe helper (see Pattern 3)\n│\nSetting transparency\u002Falpha blending?\n├── Blender 4.2+?\n│   ├── YES → mat.surface_render_method = 'BLENDED'\n│   └── NO (3.x \u002F 4.0-4.1) → mat.blend_method = 'BLEND'\n│\nConnecting texture to Principled BSDF?\n├── Color texture (diffuse, base color)?\n│   └── Connect to \"Base Color\" input (all versions)\n├── Normal map?\n│   └── Connect via ShaderNodeNormalMap → \"Normal\" input\n└── Data texture (roughness, metallic, AO)?\n    └── Set image colorspace to 'Non-Color'\n```\n\n---\n\n## Essential Patterns\n\n### Pattern 1: Create and Assign a Material\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: create material and assign to object\nimport bpy\n\nmat = bpy.data.materials.new(name=\"MyMaterial\")\nmat.use_nodes = True  # REQUIRED before accessing node_tree\n\nobj = bpy.context.active_object\nif obj.data.materials:\n    obj.data.materials[0] = mat   # Replace first slot\nelse:\n    obj.data.materials.append(mat)  # Add new slot\n```\n\n### Pattern 2: Build a Complete Node Tree\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: node tree from scratch\nmat = bpy.data.materials.new(\"NodeMaterial\")\nmat.use_nodes = True\ntree = mat.node_tree\n\n# Clear defaults\ntree.nodes.clear()\n\n# Create nodes\nprincipled = tree.nodes.new('ShaderNodeBsdfPrincipled')\nprincipled.location = (0, 0)\n\noutput = tree.nodes.new('ShaderNodeOutputMaterial')\noutput.location = (400, 0)\n\n# Link BSDF to output\ntree.links.new(principled.outputs[\"BSDF\"], output.inputs[\"Surface\"])\n```\n\n### Pattern 3: Version-Safe Principled BSDF Input Access\n\n```python\n# Blender 3.x\u002F4.0+: handle renamed sockets\nimport bpy\n\ndef set_principled_value(node, socket_3x, socket_4x, value):\n    \"\"\"Set Principled BSDF input with version-safe socket name.\"\"\"\n    if bpy.app.version >= (4, 0, 0):\n        socket_name = socket_4x\n    else:\n        socket_name = socket_3x\n    if socket_name in node.inputs:\n        node.inputs[socket_name].default_value = value\n\n# Usage\nset_principled_value(principled, \"Subsurface\", \"Subsurface Weight\", 0.1)\nset_principled_value(principled, \"Specular\", \"Specular IOR Level\", 0.5)\nset_principled_value(principled, \"Transmission\", \"Transmission Weight\", 1.0)\nset_principled_value(principled, \"Coat\", \"Coat Weight\", 0.3)\nset_principled_value(principled, \"Sheen\", \"Sheen Weight\", 0.1)\nset_principled_value(principled, \"Emission\", \"Emission Color\", (1, 1, 1, 1))\n```\n\n### Pattern 4: Texture Node with UV Mapping\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: image texture with UV coordinates\ntree = mat.node_tree\n\ntex_coord = tree.nodes.new('ShaderNodeTexCoord')\ntex_coord.location = (-800, 0)\n\nmapping = tree.nodes.new('ShaderNodeMapping')\nmapping.location = (-600, 0)\n\ntex_node = tree.nodes.new('ShaderNodeTexImage')\ntex_node.location = (-400, 0)\nimg = bpy.data.images.load(\"\u002Fpath\u002Fto\u002Ftexture.png\", check_existing=True)\ntex_node.image = img\n\n# Link: TexCoord → Mapping → Image Texture → Principled BSDF\ntree.links.new(tex_coord.outputs[\"UV\"], mapping.inputs[\"Vector\"])\ntree.links.new(mapping.outputs[\"Vector\"], tex_node.inputs[\"Vector\"])\ntree.links.new(tex_node.outputs[\"Color\"], principled.inputs[\"Base Color\"])\n```\n\n### Pattern 5: Alpha\u002FTransparency Setup (Version-Dependent)\n\n```python\n# Blender 4.2+: EEVEE transparency\nmat.surface_render_method = 'BLENDED'  # 4.2+ ONLY\n\n# Blender 3.x \u002F 4.0-4.1: EEVEE transparency\n# mat.blend_method = 'BLEND'  # REMOVED in 4.2\n\n# Version-safe pattern\nif bpy.app.version >= (4, 2, 0):\n    mat.surface_render_method = 'BLENDED'\nelse:\n    mat.blend_method = 'BLEND'\n```\n\n---\n\n## Principled BSDF Socket Rename Table (3.x -> 4.0+)\n\n| Blender 3.x Name | Blender 4.0+ Name | Notes |\n|---|---|---|\n| `Base Color` | `Base Color` | Unchanged |\n| `Subsurface` | `Subsurface Weight` | Renamed |\n| `Subsurface Color` | **REMOVED** | Use `Base Color` instead |\n| `Specular` | `Specular IOR Level` | Renamed |\n| `Specular Tint` | `Specular Tint` | Type changed: Float -> Color |\n| `Transmission` | `Transmission Weight` | Renamed |\n| `Coat` | `Coat Weight` | Renamed |\n| `Sheen` | `Sheen Weight` | Renamed |\n| `Emission` | `Emission Color` | Renamed |\n| `Metallic` | `Metallic` | Unchanged |\n| `Roughness` | `Roughness` | Unchanged |\n| `IOR` | `IOR` | Unchanged |\n| `Alpha` | `Alpha` | Unchanged |\n| `Normal` | `Normal` | Unchanged |\n\n---\n\n## Common Operations\n\n### Assign Material to Specific Faces\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: multi-material assignment\nimport bpy\n\nobj = bpy.context.active_object\n\n# Add two materials to object\nmat_a = bpy.data.materials.new(\"Material_A\")\nmat_b = bpy.data.materials.new(\"Material_B\")\nobj.data.materials.append(mat_a)\nobj.data.materials.append(mat_b)\n\n# Assign material index per polygon\nfor polygon in obj.data.polygons:\n    if polygon.center.z > 0:\n        polygon.material_index = 1  # Material_B\n    else:\n        polygon.material_index = 0  # Material_A\n```\n\n### Add Material Slot via Operator\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: operator-based slot management\nimport bpy\n\nobj = bpy.context.active_object\nbpy.context.view_layer.objects.active = obj\n\n# Add empty slot\nbpy.ops.object.material_slot_add()\n\n# Assign material to active slot\nobj.material_slots[obj.active_material_index].material = mat\n\n# Remove active slot\nbpy.ops.object.material_slot_remove()\n```\n\n### Access Default Principled BSDF\n\nWhen `use_nodes = True` is set on a new material, Blender creates a default Principled BSDF and Material Output automatically.\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: access default nodes without clearing\nmat = bpy.data.materials.new(\"QuickMaterial\")\nmat.use_nodes = True\nprincipled = mat.node_tree.nodes.get(\"Principled BSDF\")\n# principled is the auto-created ShaderNodeBsdfPrincipled\n```\n\n### UV Layer Management\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: UV layer access\nmesh = obj.data\n\n# List UV layers\nfor uv_layer in mesh.uv_layers:\n    print(uv_layer.name)\n\n# Get active UV layer\nactive_uv = mesh.uv_layers.active\n\n# Create new UV layer\nnew_uv = mesh.uv_layers.new(name=\"ProjectionUV\")\n\n# Read UV coordinates (per-loop, NOT per-vertex)\nfor loop_idx in range(len(mesh.loops)):\n    uv = active_uv.data[loop_idx].uv\n    # uv.x, uv.y are the coordinates\n\n# Modify UV coordinates\nfor loop_idx in range(len(mesh.loops)):\n    active_uv.data[loop_idx].uv.x *= 2.0\n    active_uv.data[loop_idx].uv.y *= 2.0\n```\n\n### Load and Configure Image Textures\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: image loading\nimport bpy\n\n# Load from file (reuse existing if already loaded)\nimg = bpy.data.images.load(\"\u002Fpath\u002Fto\u002Ftexture.png\", check_existing=True)\n\n# Create new blank image (for baking)\nimg = bpy.data.images.new(\"BakeTarget\", width=2048, height=2048)\n\n# Configure texture node\ntex_node = tree.nodes.new('ShaderNodeTexImage')\ntex_node.image = img\ntex_node.interpolation = 'Linear'   # 'Linear', 'Closest', 'Cubic', 'Smart'\ntex_node.projection = 'FLAT'        # 'FLAT', 'BOX', 'SPHERE', 'TUBE'\ntex_node.extension = 'REPEAT'       # 'REPEAT', 'EXTEND', 'CLIP'\n\n# Set color space\nimg.colorspace_settings.name = 'sRGB'       # For diffuse\u002Fcolor textures\n# img.colorspace_settings.name = 'Non-Color' # For normal, roughness, metallic\n```\n\n### Normal Map Setup\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: normal map node chain\ntree = mat.node_tree\n\nnormal_tex = tree.nodes.new('ShaderNodeTexImage')\nnormal_tex.image = bpy.data.images.load(\"\u002Fpath\u002Fto\u002Fnormal.png\", check_existing=True)\nnormal_tex.image.colorspace_settings.name = 'Non-Color'  # REQUIRED for normal maps\n\nnormal_map = tree.nodes.new('ShaderNodeNormalMap')\n\ntree.links.new(normal_tex.outputs[\"Color\"], normal_map.inputs[\"Color\"])\ntree.links.new(normal_map.outputs[\"Normal\"], principled.inputs[\"Normal\"])\n```\n\n### Remove All Materials from Object\n\n```python\n# Blender 3.x\u002F4.x\u002F5.x: clear all material slots\nobj.data.materials.clear()\n```\n\n---\n\n## Common Shader Node Types\n\n| Node Type String | Class | Purpose |\n|---|---|---|\n| `'ShaderNodeBsdfPrincipled'` | Principled BSDF | Main PBR shader |\n| `'ShaderNodeOutputMaterial'` | Material Output | Final output |\n| `'ShaderNodeTexImage'` | Image Texture | Load image files |\n| `'ShaderNodeTexCoord'` | Texture Coordinate | UV, Object, Generated coords |\n| `'ShaderNodeMapping'` | Mapping | Transform texture coordinates |\n| `'ShaderNodeNormalMap'` | Normal Map | Convert image to normal vector |\n| `'ShaderNodeMixShader'` | Mix Shader | Blend two shaders |\n| `'ShaderNodeBsdfTransparent'` | Transparent BSDF | Transparency shader |\n| `'ShaderNodeBsdfGlass'` | Glass BSDF | Glass shader |\n| `'ShaderNodeMath'` | Math | Scalar math operations |\n| `'ShaderNodeMixRGB'` | Mix (Color) | Blend colors (3.x name) |\n| `'ShaderNodeMix'` | Mix | Blend colors\u002Fvectors (4.0+) |\n| `'ShaderNodeValToRGB'` | Color Ramp | Map value to color gradient |\n| `'ShaderNodeBump'` | Bump | Generate bump from height |\n| `'ShaderNodeSeparateXYZ'` | Separate XYZ | Split vector components |\n| `'ShaderNodeCombineXYZ'` | Combine XYZ | Merge components to vector |\n| `'ShaderNodeTexNoise'` | Noise Texture | Procedural noise |\n| `'ShaderNodeTexVoronoi'` | Voronoi Texture | Procedural voronoi |\n| `'ShaderNodeGroup'` | Node Group | Reusable node group instance |\n\n---\n\n## EEVEE vs Cycles Material Differences\n\n| Property | EEVEE | Cycles | Notes |\n|---|---|---|---|\n| Transparency | Requires `surface_render_method` (4.2+) or `blend_method` (3.x-4.1) | Automatic from Alpha | EEVEE needs explicit config |\n| Screen Space Refraction | `mat.use_screen_refraction = True` | Not needed | EEVEE-specific |\n| Backface Culling | `mat.use_backface_culling` | `mat.use_backface_culling` | Same API |\n| Displacement | `mat.cycles.displacement_method` | `mat.cycles.displacement_method` | Cycles-only |\n| Shadow Mode | `mat.shadow_method` (3.x-4.1) | Automatic | EEVEE-specific |\n\n---\n\n## Version-Specific Migration Rules\n\n| Feature | Blender 3.x | Blender 4.0+ | Blender 4.2+ |\n|---|---|---|---|\n| Principled BSDF sockets | Old names | New names (see table) | Same as 4.0 |\n| Alpha blending (EEVEE) | `mat.blend_method = 'BLEND'` | `mat.blend_method = 'BLEND'` | `mat.surface_render_method = 'BLENDED'` |\n| Shadow method (EEVEE) | `mat.shadow_method` | `mat.shadow_method` | Property restructured |\n| Mix node | `'ShaderNodeMixRGB'` | `'ShaderNodeMix'` (preferred) | `'ShaderNodeMix'` |\n| Specular Tint type | Float (0.0-1.0) | Color (RGBA) | Color (RGBA) |\n\n---\n\n## Reference Links\n\n- [references\u002Fmethods.md](references\u002Fmethods.md) — Complete API signatures for Material, NodeTree, ShaderNode, UV layers, Image\n- [references\u002Fexamples.md](references\u002Fexamples.md) — Working code examples for common material workflows\n- [references\u002Fanti-patterns.md](references\u002Fanti-patterns.md) — What NOT to do with materials, with WHY explanations\n\n### Official Sources\n\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.Material.html\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.ShaderNodeBsdfPrincipled.html\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.ShaderNodeTree.html\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.UVLoopLayers.html\n- https:\u002F\u002Fdocs.blender.org\u002Fapi\u002Fcurrent\u002Fbpy.types.Image.html\n- https:\u002F\u002Fdeveloper.blender.org\u002Fdocs\u002Frelease_notes\u002F4.0\u002Fpython_api\u002F\n",{"name":5,"license":14,"metadata":23,"description":26,"compatibility":27},{"author":24,"version":25},"OpenAEC-Foundation","1.0","Use when creating or modifying Blender materials and shader nodes via Python. Prevents the breaking change of using old Principled BSDF input names (e.g., \"Subsurface\" renamed to \"Subsurface Weight\" in 4.0). Covers material creation, node tree setup, Principled BSDF input mapping, UV assignment, texture loading, and material slot management. Keywords: material, shader, Principled BSDF, node tree, texture, UV map, material_slot, ShaderNodeBsdfPrincipled, node links, Blender materials, assign material to object, create material from code, change color.\n","Designed for Claude Code. Requires Blender 3.x\u002F4.x\u002F5.x with Python.","main","9bb7acf0c2ec4f44373969cb14e55af3c9a8385f","plugins\u002Fblender-bim-sverchok\u002Fskills\u002Fblender\u002Fsyntax\u002Fblender-syntax-materials","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot","2026-11-09 13:26:47",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add lagzgabrielmuller-dot\u002Fkit-ingenieria-3d --skill blender-syntax-materials",{"tool":40,"command":41},"bunx","bunx skills add lagzgabrielmuller-dot\u002Fkit-ingenieria-3d --skill blender-syntax-materials",{"tool":43,"command":44},"pnpm","pnpm dlx skills add lagzgabrielmuller-dot\u002Fkit-ingenieria-3d --skill blender-syntax-materials","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fblender\u002Fsyntax\u002Fblender-syntax-materials\u002FSKILL.md",true,[48,54,58],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Fanti-patterns.md","REFERENCE","参考文档",14203,"https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fblender\u002Fsyntax\u002Fblender-syntax-materials\u002Freferences\u002Fanti-patterns.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fexamples.md",13544,"https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fblender\u002Fsyntax\u002Fblender-syntax-materials\u002Freferences\u002Fexamples.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fmethods.md",13435,"https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fblender-bim-sverchok\u002Fskills\u002Fblender\u002Fsyntax\u002Fblender-syntax-materials\u002Freferences\u002Fmethods.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":67,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M7FBFSZ93YM463CGS91D0TZG","manimce-best-practices","Trigger when: (1) User mentions \"manim\" or \"Manim Community\" or \"ManimCE\", (2) Code contains `from manim import *`, (3) User runs `manim` CLI commands, (4) Working with Scene, MathTex, Create(), or ManimCE-specific classes.\n\nBest practices for Manim Community Edition - the community-maintained Python animation engine. Covers Scene structure, animations, LaTeX\u002FMathTex, 3D with ThreeDScene, camera control, styling, and CLI usage.\n\nNOT for ManimGL\u002F3b1b version (which uses `manimlib` imports and `manimgl` CLI).","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fmanim-animaciones\u002Fskills\u002Fmanimce-best-practices\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fmanim-animaciones\u002Fskills\u002Fmanimce-best-practices\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7FB2K59HNNXS9WKHAMWHC3C","drawio","Create, edit, replicate, import, and export draw.io diagrams with an offline YAML-first workflow: architecture, network topologies, flowcharts, UML\u002FER, org charts, Mermaid\u002FCSV conversion, existing .drawio bundles, style presets, themes, and non-publication formula diagrams. For publication figures (paper, thesis, IEEE, camera-ready) use drawio-academic-skills instead.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fdiagramas-y-documentos\u002Fskills\u002Fdrawio\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7FB2BWX7GWK9H2X8BGCYDDD","drawio-academic-skills","Publication-figure overlay for draw.io. Use instead of drawio whenever the diagram is for a paper, thesis, dissertation, journal, conference, IEEE\u002FACM submission, manuscript, camera-ready, Word\u002FLaTeX figure, or other publication. Applies venue, figure-type, color, caption\u002Flegend, formula, and paper-readability gates for architecture, workflow, roadmap, network-topology, and replicated paper figures.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fdiagramas-y-documentos\u002Fskills\u002Fdrawio-academic-skills\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7FB22JESEAV8T15DJT3D444","uncertainty-and-units","Tracks physical units and propagates measurement uncertainty in scientific calculations using pint and uncertainties. Use for unit conversion and dimensional checking, GUM uncertainty budgets, Type A and Type B evaluation, coverage factors and expanded uncertainty, Monte Carlo propagation, significant-figure and plus-minus reporting, error propagation through curve fits, CODATA constants, auditing Python code for stripped units or broken uncertainty propagation, and order-of-magnitude plausibility checks using dimensionless groups (Reynolds, Peclet, Damkohler, Knudsen, Biot, Womersley), characteristic scales such as diffusion time or Debye length, and observed magnitude ranges. Trigger on \"is this number physically reasonable\", \"sanity check these units\", \"what regime is this flow in\", or a result that looks off by orders of magnitude.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fciencia-y-calculo\u002Fskills\u002Funcertainty-and-units\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M7FB1ANRSG28R335FDY9SA3R","statistical-analysis","Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives, and APA-formatted reporting. Use whenever a user wants to compare groups, test a hypothesis, analyze experimental or survey data, check statistical assumptions, compute required sample sizes, or write up results - even if they never name a specific test. Covers t-tests, ANOVA, chi-square, correlation, regression, non-parametric and Bayesian methods. For low-level model APIs, see the statsmodels and pymc skills.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fciencia-y-calculo\u002Fskills\u002Fstatistical-analysis\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":18},"01M7FB15KRA9D7JCPH4P9T6XJY","simpy","Builds, inspects, tests, and analyzes bounded process-based discrete-event simulations with SimPy. Use for event scheduling, resource queues, interrupts, monitoring, independent replications, warm-up, and reproducible output analysis.","https:\u002F\u002Fgithub.com\u002Flagzgabrielmuller-dot\u002Fkit-ingenieria-3d\u002Fblob\u002Fmain\u002Fplugins\u002Fciencia-y-calculo\u002Fskills\u002Fsimpy\u002FSKILL.md",[],[]]