Skip to content

editor_toolset.toolsets.texture.TextureTools

Provides tools for working with Texture assets.

2 tool(s).

editor_toolset.toolsets.texture.TextureTools.get_size

Returns the dimensions of a Texture2D in pixels.

    Args:
        texture: The Texture2D to query.

    Returns:
        A vector x is the width and y is the height, both in pixels.

Input schema

{
  "properties": {
    "texture": {
      "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.Texture2D",
      "type": "object"
    }
  },
  "required": [
    "texture"
  ],
  "type": "object"
}

Output schema

{
  "properties": {
    "returnValue": {
      "properties": {
        "x": {
          "type": "integer"
        },
        "y": {
          "type": "integer"
        }
      },
      "required": [
        "x",
        "y"
      ],
      "title": "IntPoint",
      "type": "object"
    }
  },
  "required": [
    "returnValue"
  ],
  "type": "object"
}

editor_toolset.toolsets.texture.TextureTools.import_file

Imports an image file from disk as a Texture2D 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 image file on disk.

    Returns:
        The assets produced by the import (typically a single Texture2D).

Input schema

{
  "properties": {
    "asset_name": {
      "type": "string"
    },
    "folder_path": {
      "type": "string"
    },
    "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"
}