Logo de Bake High To Low

Bake High To Low

Comunidade
TMHSDigital
bake-high-to-low

Cage-bake high-poly surface detail onto a low-poly target as a tangent-space normal map with bpy.ops.object.bake (Cycles, selected-to-active, active Image Texture node, UV layer, save_render). Use when the user wants a normal map from a dense mesh onto a game-resolution or decimated LOD, mentions cage_extrusion or use_selected_to_active, or gets a bake that returns CANCELLED, comes out black or flat, or fails with 'No active UV layer found'. Targets 5.2 LTS with 4.5 LTS fallback.

Visão geral

Publicado porTMHSDigital
RepositórioBlender-Developer-Tools
Nome da habilidadebake-high-to-low
Estrelas
20
Forks
5
Arquivos incluídos
Somente instruções
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Sem arquivos extras

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por TMHSDigital no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Bake High To Low no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/bake-high-to-low
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/TMHSDigital/Blender-Developer-Tools.git /tmp/Blender-Developer-Tools
mkdir -p .claude/skills
cp -r /tmp/Blender-Developer-Tools/skills/bake-high-to-low .claude/skills/bake-high-to-low
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Bake High To Low em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Bake High To Low automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Bake High To Low não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Bake High to Low

Trigger

Use this skill when the user:

  • Wants a tangent-space normal map from a dense source onto a game-resolution mesh
  • Mentions cage bake, use_selected_to_active, cage_extrusion, or bpy.ops.object.bake
  • Has an LOD from DECIMATE COLLAPSE (or a retopo) and needs the missing surface detail in a map
  • Is about to call bake from EEVEE, on GPU in CI, or with bake_type=

This skill is the bake step. It composes ai-mesh-cleanup (identity scale, applied transforms, a UV layer that already exists) and the LOD contract in examples/lod-decimate-chain/ / snippets/decimate_to_budget.py (collapse onto a budget; UVs survive well enough to bake). It does not unwrap, transfer UVs, or pack an atlas — those are a later phase. It does not generate meshes.

The core misunderstanding

Baking is not a render. EEVEE has no bake path. The operator writes into an Image Texture node in the active object's material, not into a file and not into "the selected image datablock." The node it picks is the material's active texture node, and on 5.x that node must also be selected. The active-texture node is the Image Texture node most recently made nodes.active, or the first one created if none ever was. Making a non-texture node (Principled, Output) active later does not move it.

The safe pattern sets both: nodes.active = tex and tex.select = True. The failure modes are not equally loud. Measured on 4.5.11 LTS and 5.2.1 LTS (the selection rows also on 5.0.1 and 5.1.2):

Setup mistakeWhat bpy.ops.object.bake does
Target mesh has no UV layerRaises RuntimeError: No active UV layer found in the object "Low"
Target material has no Image Texture nodeReturns {'CANCELLED'}, raises nothing, writes nothing
Image Texture node is active but tex.select = False5.0 and later: {'CANCELLED'}, Info No active and selected image texture node found in material ..., pixels untouched. 4.5 LTS: {'FINISHED'}, bakes into it anyway
Two Image Texture nodes, the one you mean is selected but the other is the active texture5.0 and later: {'CANCELLED'}, same Info. 4.5 LTS: bakes into the active texture node, not the selected one
The only Image Texture node is selected but nodes.active is PrincipledBakes into it ({'FINISHED'}); it is still the active texture node

So a headless job must check the returned set: {'CANCELLED'} is the silent one. Do not "clean up" a tex.select = True line that looks redundant: on 5.x it is what lets the bake find its target. With several Image Texture nodes, make the one you mean nodes.active and selected.

The pass type RNA is type, not bake_type. bake_type is not on bpy.ops.object.bake. Passing it is a TypeError.

Cycles bake is stochastic. Pixel buffers are not byte-identical across 4.5 / 5.1 / 5.2, even at one sample on CPU. Assert with tolerances and a flat-source control, not a hash.

RNA (verified)

Live dump of bpy.ops.object.bake.get_rna_type() on 4.5.11 LTS, 5.1.2, and 5.2.1 LTS: 22 properties, identical identifiers and enums. No version shim. The kwargs below are the contract.

Docs:

cage_object is a string name, never an Object pointer.

The canonical pattern

Every step is a silent-failure point. Do them in this order.

1. Engine and device

python
scene = bpy.context.scene
scene.render.engine = "CYCLES"
scene.cycles.device = "CPU"
scene.cycles.samples = 1
scene.cycles.use_denoising = False

Do not rely on the default device. Headless CI has no GPU. samples = 1 is enough for a statistical check; raise it for production maps, not for smoke.

2. Target: UV layer, image, active Image Texture node

The low-poly object needs a UV layer (mesh.uv_layers). Confirm it; do not unwrap here.

python
img = bpy.data.images.new("BakeNrm", 128, 128, alpha=True, float_buffer=False)
img.colorspace_settings.name = "Non-Color"

mat = bpy.data.materials.new("BakeTarget")
if bpy.app.version < (5, 0, 0):
    mat.use_nodes = True  # 4.5 LTS only; the tree exists and use_nodes is deprecated on 5.x
nodes = mat.node_tree.nodes
tex = nodes.new("ShaderNodeTexImage")
tex.image = img
nodes.active = tex
tex.select = True

if obj.data.materials:
    obj.data.materials[0] = mat
else:
    obj.data.materials.append(mat)

The Image Texture does not need to be linked into Principled for the bake to land. It must be the active texture node (nodes.active = tex) and, on 5.x, selected (tex.select = True). A new node is created selected, but code that deselects nodes or edits the tree afterwards can clear that. After the bake, wire ShaderNodeNormalMap for display or export; do not plug Image Texture Color into Principled Normal.

Snippet: snippets/setup_bake_target_image.py.

3. Selection: high selected, low active

python
high.select_set(True)
low.select_set(True)
bpy.context.view_layer.objects.active = low

use_selected_to_active=True bakes selected sources onto the active target. Reverse that and the map is empty or self-bakes the low.

4. Cage normal bake

python
result = bpy.ops.object.bake(
    type="NORMAL",
    use_selected_to_active=True,
    cage_extrusion=0.20,
    use_cage=False,
    normal_space="TANGENT",
    margin=4,
    margin_type="ADJACENT_FACES",
    use_clear=True,
    target="IMAGE_TEXTURES",
)
if result != {'FINISHED'}:
    # {'CANCELLED'} raises nothing: e.g. no Image Texture node in the material.
    raise RuntimeError(f"bake did not finish: {result}")

cage_extrusion inflates the active object along its normals so rays hit the high mesh. It must clear the high-frequency amplitude (ribs at 0.10 need extrusion > 0.10; 0.20 is the worked value). If extrusion alone skims past concavities, set use_cage=True and cage_object="CageName" (the object's .name). Do not pass the Object.

margin_type is ADJACENT_FACES or EXTEND. Prefer ADJACENT_FACES at UV seams.

Snippet: snippets/bake_normal_high_to_low.py.

5. Save the datablock

The bake writes the image in memory. Image.save() on a GENERATED image flips source to 'FILE' and drops the buffer — the trap examples/image-pixels-testcard/ witnesses. Use save_render().

save_render() writes in the format of the scene's render.image_settings, not img.file_format: setting img.file_format = "OPEN_EXR" and calling save_render still writes a PNG on a default scene. Set the scene's format for the call and restore it:

python
settings = scene.render.image_settings
previous = settings.file_format
settings.file_format = "OPEN_EXR"  # or "PNG"
try:
    img.save_render(filepath, scene=scene)
finally:
    settings.file_format = previous

Snippet: snippets/save_baked_image.py. Folded save is the wrong size: the trap is its own contract.

Common mistakes

WrongRight
bake_type='NORMAL'type='NORMAL'
scene.render.engine = 'BLENDER_EEVEE' then bakeCYCLES only
GPU / default device in CIscene.cycles.device = 'CPU'
Low selected, high activeHigh selected, low active
Image Texture present but not nodes.activeSet nodes.active = tex
Image Texture active but deselected (5.x CANCELLED)Also set tex.select = True
No UV layerConfirm mesh.uv_layers before bake
Image.save() after bakeImage.save_render(path)
Hash / byte-compare maps across versionsFraction / MAD vs (0.5, 0.5, 1.0) plus a flat-source control

Version notes

Bake operator RNA is identical on 4.5 LTS, 5.1, and 5.2 LTS. Branch on bpy.app.version only for unrelated neighbors (EEVEE engine id for a gallery still, NodesModifier inputs). Do not invent a bake shim.

Witness: examples/bake-normal-high-to-low/. --flat-source feeds an undisplaced high into the same detail assertion and must exit non-zero.

Runnable examples

Each example runs headless, asserts the contract, and exits non-zero when it breaks. Run one with blender --background --python <script> --; pass a falsifier flag to watch the check fail.

  • bake-normal-high-to-low: A collapse-decimated hatch plate receiving a Cycles cage-baked tangent normal map from a ribbed high-poly source Falsify: --flat-source (exit 5).

Snippets

Short standalone patterns to copy. Each one runs in CI on 5.2 and 4.5 with a check and a falsifier.

Perguntas frequentes

O que a habilidade de IA Bake High To Low faz?

Cage-bake high-poly surface detail onto a low-poly target as a tangent-space normal map with bpy.ops.object.bake (Cycles, selected-to-active, active Image Texture node, UV layer, save_render). Use when the user wants a normal map from a dense mesh onto a game-resolution or decimated LOD, mentions cage_extrusion or use_selected_to_active, or gets a bake that returns CANCELLED, comes out black or flat, or fails with 'No active UV layer found'. Targets 5.2 LTS with 4.5 LTS fallback.

Por que usar Bake High To Low no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Bake High To Low é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Bake High To Low no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/bake-high-to-low. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Bake High To Low?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Bake High To Low?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Bake High To Low com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Bake High To Low é gratuita?

A habilidade é publicada no GitHub por TMHSDigital. Consulte os termos de licenciamento no repositório. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇