Skip to main content

Command-line Interface (CLI) responsible for returning the list of the assets of an Unreal Engine project into a JSON structure

Project description

Unreal Engine Assets Dump

Command-line Interface (CLI) responsible for returning the list of the assets of an Unreal Engine project into a JSON structure.

Development

Poetry

Unreal Engine Assets Dump project used Poetry to declare all its dependencies. Poetry is a python dependency management tool to manage dependencies, packages, and libraries in your python project.

We need to create the Python virtual environment using Poetry:

poetry env use /Users/Shared/Epic\ Games/UE_5.2/Engine/Binaries/ThirdParty/Python3/Mac/bin/python3

We can enter this virtual environment and install all the required dependencies:

poetry shell
poetry update

Publication

To publish a new version of the Unreal Engine Assets Dump library to Pypi, we need to execute the following command:

poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD

Where the environment variables:

  • $PYPI_USERNAME: The value __token__
  • $PYPI_PASSWORD: The API token used to authenticate when uploading packages to PyPI (e.g., pypi-...)

We generally defined a .env file and add these environment variables:

# Copyright (C) 2023 Bootloader.  All rights reserved.
#
# This software is the confidential and proprietary information of
# Bootloader or one of its subsidiaries.  You shall not disclose this
# confidential information and shall use it only in accordance with the
# terms of the license agreement or other applicable agreement you
# entered into with Bootloader.
#
# BOOTLOADER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
# SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
# NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
# A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.  BOOTLOADER SHALL NOT BE
# LIABLE FOR ANY LOSSES OR DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
# USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.

# The Python Package Index (PyPI) API token to authenticate when
# uploading this package to PyPI.
PYPI_USERNAME=__token__
PYPI_PASSWORD=pypi-(...)

Installation

To install Unreal Engine Assets Dump library to Unreal Engine, execute the following command.

/Users/Shared/Epic\ Games/UE_5.1/Engine/Binaries/ThirdParty/Python3/Mac/bin/python3 -m pip install --upgrade uasset-dump
/Users/Shared/Epic\ Games/UE_5.2/Engine/Binaries/ThirdParty/Python3/Mac/bin/python3 -m pip install --upgrade uasset-dump

/Users/admin/Library/JenkinsAgent/workspace/client-app/scooby-app-build/main/Scooby/Content

Execution

Then we can load our Unreal Engine project in Unreal Engine Editor and execute the following Python instructions in the Output Log drawer:

from bootloader.ue.utils import uasset_dump
uasset_dump.dump_assets('/Users/dcaune/Devel/Bootloader/bootloader-human-trainer-ar5/Content')

This prints long JSON data. For instance:

[
  {
    "asset_name": "A_d2_ChangeOutfit_01",
    "asset_class_path": "/Script/Engine/AnimSequence",
    "package_name": "/Game/ArtAssets/Pets/QuadrupedDog/Animations/A_d2_ChangeOutfit_01",
    "dependencies": [
      "/Game/ArtAssets/Pets/QuadrupedDog/Mesh/S_d2"
    ]
  },
  {
    "asset_name": "A_d2_ChangeOutfit_02",
    "asset_class_path": "/Script/Engine/AnimSequence",
    "package_name": "/Game/ArtAssets/Pets/QuadrupedDog/Animations/A_d2_ChangeOutfit_02",
    "dependencies": [
      "/Game/ArtAssets/Pets/QuadrupedDog/Mesh/S_d2"
    ]
  },
  (...)
]
export UNREAL_ENGINE_PROJECT_PATH=/Users/admin/Library/JenkinsAgent/workspace/client-app/scooby-app-build/main/Scooby/Scooby.uproject

export UNREAL_ENGINE_ASSET_DUMP_FILE_PATH=/Users/admin/bootloader-scooby-uassets.dump.json

"`find "/Users/Shared/Epic Games/UE_5.2" -name UnrealEditor-Cmd`" \
    "$UNREAL_ENGINE_PROJECT_PATH" \
    -run=pythonscript \
    -stdout \
    -Unattended \
    -script="/Users/admin/Downloads/run.py"

echo $?;

Command Line Execution



          

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uasset_dump-0.0.17.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

uasset_dump-0.0.17-py3-none-any.whl (15.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page