Skip to content

editor_toolset.toolsets.static_mesh.StaticMeshTools

Provides tools for inspecting and modifying static mesh assets.

16 tool(s).

editor_toolset.toolsets.static_mesh.StaticMeshTools.generate_convex_collisions

Generates convex hull collision shapes for a static mesh.

    Convex hulls provide accurate collision for physics simulation. More hulls
    improve accuracy but increase runtime cost. Replaces any existing collision.

    Args:
        mesh: The static mesh asset to modify.
        hull_count: The number of convex hulls to generate.
        max_hull_verts: The maximum number of vertices per hull.
        hull_precision: Controls the voxel precision of the decomposition.

    Returns:
        True if convex collision was generated successfully.

Input schema

{
  "properties": {
    "hull_count": {
      "default": 4,
      "type": "integer"
    },
    "hull_precision": {
      "default": 100000,
      "type": "integer"
    },
    "max_hull_verts": {
      "default": 16,
      "type": "integer"
    },
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "boolean"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.generate_lods

Auto-generates LODs for a static mesh using triangle reduction.

    Each entry in triangle_percents creates one additional LOD. The value is the
    fraction of triangles to keep relative to LOD 0, from just above 0.0 (nearly
    empty) to 1.0 (full detail). For example, [0.5, 0.25] creates LOD1 with 50%
    of the original triangles and LOD2 with 25%.

    Args:
        mesh: The static mesh asset to modify.
        triangle_percents: Triangle retention fraction for each generated LOD.

    Returns:
        The total number of LODs after the operation, including LOD 0.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    },
    "triangle_percents": {
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "required": [
    "mesh",
    "triangle_percents"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "integer"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.get_bounds

Returns the local-space bounding box of a static mesh.

    Args:
        mesh: The static mesh asset to query.

    Returns:
        The local-space axis-aligned bounding box.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "properties": {
        "isValid": {
          "type": "boolean"
        },
        "max": {
          "properties": {
            "x": {
              "type": "number"
            },
            "y": {
              "type": "number"
            },
            "z": {
              "type": "number"
            }
          },
          "required": [
            "x",
            "y",
            "z"
          ],
          "title": "Vector",
          "type": "object"
        },
        "min": {
          "properties": {
            "x": {
              "type": "number"
            },
            "y": {
              "type": "number"
            },
            "z": {
              "type": "number"
            }
          },
          "required": [
            "x",
            "y",
            "z"
          ],
          "title": "Vector",
          "type": "object"
        }
      },
      "required": [
        "min",
        "max",
        "isValid"
      ],
      "title": "Box",
      "type": "object"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.get_lod_count

Returns the number of LODs in a static mesh asset.

    Args:
        mesh: The static mesh asset to query.

    Returns:
        The number of LODs.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "integer"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.get_lod_thresholds

Returns the screen-size thresholds at which each LOD becomes active.

    Screen size is a ratio of the mesh's screen height to the viewport height. A value
    of 1.0 means the mesh fills the full viewport height; values above 1.0 are valid and
    mean the mesh must appear larger than the viewport before the next LOD activates.
    Each LOD activates when the mesh appears smaller than its threshold.

    Args:
        mesh: The static mesh asset to query.

    Returns:
        A list of screen-size threshold values, one per LOD.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.get_material

Returns the material assigned to a named slot on a static mesh.

    Args:
        mesh: The static mesh asset to query.
        slot_name: The name of the material slot to query.

    Returns:
        The material assigned to the slot.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    },
    "slot_name": {
      "type": "string"
    }
  },
  "required": [
    "mesh",
    "slot_name"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.MaterialInterface",
      "type": "object"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.get_material_slots

Returns the names of all material slots in a static mesh.

    Material slot names are used when assigning materials to specific parts of
    the mesh. Use these names with get_material and set_material.

    Args:
        mesh: The static mesh asset to query.

    Returns:
        A list of material slot names.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.get_triangle_count

Returns the number of triangles in a specific LOD of a static mesh.

    Args:
        mesh: The static mesh asset to query.
        lod_index: The LOD index to query. Defaults to 0 (highest quality).

    Returns:
        The number of triangles in the specified LOD.

Input schema

{
  "properties": {
    "lod_index": {
      "default": 0,
      "type": "integer"
    },
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "integer"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.get_vertex_count

Returns the number of vertices in a specific LOD of a static mesh.

    Args:
        mesh: The static mesh asset to query.
        lod_index: The LOD index to query. Defaults to 0 (highest quality).

    Returns:
        The number of vertices in the specified LOD.

Input schema

{
  "properties": {
    "lod_index": {
      "default": 0,
      "type": "integer"
    },
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "integer"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.import_file

Imports a mesh file from disk as a StaticMesh asset.

    Args:
        folder_path: The content-browser folder to create the asset in.
        asset_name: The name of the new asset.
        source_file: The absolute path to the source mesh file on disk.
        import_materials: When True, create Material assets for any materials
            referenced in the file. When False, the imported meshes have no
            materials assigned.
        import_textures: When True, create Texture2D assets for any textures
            referenced by the imported materials. Only effective when
            import_materials is True.
        combine_meshes: When True, all meshes in the file are merged into a
            single StaticMesh. When False, each mesh in the file produces
            its own StaticMesh asset.

    Returns:
        The assets produced by the import. The first entry is the primary
        StaticMesh; additional entries may include extra StaticMeshes (when
        combine_meshes is False) and Material/Texture assets (when the
        corresponding import flags are True).

Input schema

{
  "properties": {
    "asset_name": {
      "type": "string"
    },
    "combine_meshes": {
      "default": true,
      "type": "boolean"
    },
    "folder_path": {
      "type": "string"
    },
    "import_materials": {
      "default": false,
      "type": "boolean"
    },
    "import_textures": {
      "default": false,
      "type": "boolean"
    },
    "source_file": {
      "type": "string"
    }
  },
  "required": [
    "folder_path",
    "asset_name",
    "source_file"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "items": {
        "properties": {
          "refPath": {
            "description": "The reference stored as a soft path string.",
            "type": "string"
          }
        },
        "required": [
          "refPath"
        ],
        "title": "/Script/CoreUObject.Object",
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.is_nanite_enabled

Returns whether Nanite is enabled for a static mesh.

    Nanite is Unreal's virtualized geometry system that renders highly detailed
    meshes efficiently. It is most beneficial for meshes with many triangles.

    Args:
        mesh: The static mesh asset to query.

    Returns:
        True if Nanite is enabled for this mesh.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "boolean"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.remove_collisions

Removes all collision shapes from a static mesh.

    Args:
        mesh: The static mesh asset to modify.

    Returns:
        True if all collision shapes were removed.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "boolean"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.remove_lods

Removes all auto-generated LODs from a static mesh, keeping only LOD 0.

    Args:
        mesh: The static mesh asset to modify.

    Returns:
        True if LODs were removed successfully.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "boolean"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.set_lod_thresholds

Sets the screen-size thresholds at which each LOD becomes active.

    Screen size is a ratio of the mesh's screen height to the viewport height. A value
    of 1.0 means the mesh fills the full viewport height; values above 1.0 are valid and
    mean the mesh must appear larger than the viewport before the next LOD activates.
    Thresholds must be in strictly descending order (LOD 0 has the largest threshold),
    and there must be exactly one threshold per LOD.

    Args:
        mesh: The static mesh asset to modify.
        thresholds: Screen-size threshold values, one per LOD, in descending order.

    Returns:
        True if the thresholds were applied successfully.

Input schema

{
  "properties": {
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    },
    "thresholds": {
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "required": [
    "mesh",
    "thresholds"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "boolean"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.set_material

Assigns a material to a named slot on a static mesh asset.

    This affects all instances of the mesh that do not override the slot material.
    Use set_component_material_override to change materials on a single instance.

    Args:
        mesh: The static mesh asset to modify.
        slot_name: The name of the material slot to assign to.
        material: The material to assign.

    Returns:
        True if the material was assigned successfully.

Input schema

{
  "properties": {
    "material": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.MaterialInterface",
      "type": "object"
    },
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    },
    "slot_name": {
      "type": "string"
    }
  },
  "required": [
    "mesh",
    "slot_name",
    "material"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "type": "boolean"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.static_mesh.StaticMeshTools.set_nanite_enabled

Enables or disables Nanite for a static mesh.

    Changing this setting triggers a mesh rebuild. Nanite is most beneficial for
    high-polygon meshes. Low-polygon meshes may not benefit from Nanite.

    Args:
        mesh: The static mesh asset to modify.
        enabled: True to enable Nanite, False to disable it.

Input schema

{
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "mesh": {
      "description": "Represents a reference to a UObject or UClass.",
      "properties": {
        "refPath": {
          "description": "The reference stored as a soft path string.",
          "type": "string"
        }
      },
      "required": [
        "refPath"
      ],
      "title": "/Script/Engine.StaticMesh",
      "type": "object"
    }
  },
  "required": [
    "mesh",
    "enabled"
  ],
  "type": "object"
}