Skip to main content
Glama

remap_material_ids

Destructive

Merge or compact MaterialIDs on a DynamicMeshActor's live mesh to close ID gaps that waste material slots when baking to a static mesh.

Instructions

Renumber MaterialIDs on a DynamicMeshActor's live dynamic mesh. Two modes: pass from_material_id + to_material_id to merge one ID into another (UGeometryScriptLibrary_MeshMaterialFunctions::RemapMaterialIDs), or pass compact=true with the material list to close gaps left by deleted/merged IDs (CompactMaterialIDs) and get back the compacted list to hand to copy_dynamic_mesh_to_static_mesh. Gaps matter: MaterialIDs index into that list positionally, so an unused ID in the middle costs a wasted material slot on the baked asset. The materials list may be shorter than the IDs in use (or absent): the missing entries count as no material. When no triangle carries from_material_id, or from and to are the same ID, the mesh is left unchanged and the call succeeds with applied false, triangles_remapped 0 and a note. Otherwise applied is measured (remap: the triangles that carried from_material_id no longer do; compact: the engine reported no error) and the call fails when it is false.

Returns: { actor_name, mode: string, from_material_id: int, to_material_id: int, triangles_remapped?: int, max_material_id_after: int, distinct_material_ids_after: int, compacted_materials: [string], applied: bool, note?: string }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compactNoCompact mode: renumber IDs to be contiguous from 0 (default false).
materialsNoCompact mode: ordered UMaterialInterface content paths, one per current MaterialID. The compacted list is returned in compacted_materials, in the new ID order.
actor_nameYesLabel or name of the target DynamicMeshActor.
to_material_idNoRemap mode: the MaterialID to replace it with. Required unless compact is true.
from_material_idNoRemap mode: the MaterialID to replace. Required unless compact is true.
remove_duplicate_materialsNoCompact mode: also merge IDs that point at the SAME material asset (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare the mechanical profile (destructive, not read-only, not idempotent); the description goes well beyond, disclosing that gaps cost a wasted baked material slot, that a no-op leaves the mesh unchanged and still succeeds with applied=false/triangles_remapped=0/note, that missing material entries count as no material, and that the call fails when applied is false. This is rich, non-obvious behavioral detail with no contradiction of the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose, then modes, then the consequence of gaps, then edge-case outcomes, then the return shape – a sensible order that earns each sentence. It is dense and slightly run-on in places, but proportionate to a two-mode tool with subtle edge cases.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, yet the description inlines the full return shape including optional fields, and covers both modes' success and failure semantics. Nothing needed to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds mode-conditional meaning: how from/to interact, that compact pairs with the materials list, that the list is positional and may be shorter than the IDs in use (missing entries = no material), and that from==to is a no-op. That materially exceeds the schema's per-field text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Renumber MaterialIDs on a DynamicMeshActor's live dynamic mesh") and immediately names the two distinct operating modes, which cleanly separates it from siblings like set_mesh_material_id, set_mesh_material_id_in_region, and set_polygroup_material_id. An agent can identify what the tool does and how it differs without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly explains the condition selecting each mode (pass from/to to merge one ID; pass compact=true to close gaps) and names the downstream consumer, copy_dynamic_mesh_to_static_mesh, so the agent understands the workflow. It stops short of an explicit when-not-to-use or a named sibling alternative, so it lands just under the top.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools