Add Asset Export to JSON feature for LLM combat balance analysis
Features: - Export DataTable, Blueprint, AnimMontage, CurveTable to JSON - INI-based configuration via UDeveloperSettings - Comprehensive Blueprint EventGraph extraction - Enhanced AnimMontage with CustomProperties from Notifies - Project Settings integration (Edit -> Project Settings -> Plugins) - Tools menu integration (Tools -> WorldStalker -> Export Assets to JSON) Files added: - AssetExportSettings.h/cpp - UDeveloperSettings configuration class - AssetExporterToJSON.h/cpp - Core export implementation - README.md - Comprehensive feature documentation - MERGE_INSTRUCTIONS.md - Integration guide for existing files Unreal Engine 5.5.4 compatible
This commit is contained in:
99
AssetExporterToJSON.h
Normal file
99
AssetExporterToJSON.h
Normal file
@ -0,0 +1,99 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
/**
|
||||
* Utility class for exporting various asset types to JSON format
|
||||
* Supports: DataTable, Blueprint, AnimMontage, CurveTable
|
||||
* Purpose: Extract asset data for LLM-based combat balance analysis
|
||||
*/
|
||||
class WORLDSTALKEREDITOR_API FAssetExporterToJSON
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Main entry point for JSON export
|
||||
* Opens folder picker dialog and exports all supported assets from selected folder
|
||||
*/
|
||||
static void ExportAssetsToJSON();
|
||||
|
||||
private:
|
||||
/**
|
||||
* Export all DataTables from the specified path to JSON
|
||||
* @param FolderPath - Root folder path to search (recursively)
|
||||
* @param OutJsonArray - Output array to store exported data
|
||||
* @return Number of assets exported
|
||||
*/
|
||||
static int32 ExportDataTables(const FString& FolderPath, TArray<TSharedPtr<FJsonValue>>& OutJsonArray);
|
||||
|
||||
/**
|
||||
* Export all Blueprints from the specified path to JSON
|
||||
* Extracts: Variables, Functions, Components, Parent Class
|
||||
* @param FolderPath - Root folder path to search (recursively)
|
||||
* @param OutJsonArray - Output array to store exported data
|
||||
* @return Number of assets exported
|
||||
*/
|
||||
static int32 ExportBlueprints(const FString& FolderPath, TArray<TSharedPtr<FJsonValue>>& OutJsonArray);
|
||||
|
||||
/**
|
||||
* Export all AnimMontages from the specified path to JSON
|
||||
* @param FolderPath - Root folder path to search (recursively)
|
||||
* @param OutJsonArray - Output array to store exported data
|
||||
* @return Number of assets exported
|
||||
*/
|
||||
static int32 ExportAnimMontages(const FString& FolderPath, TArray<TSharedPtr<FJsonValue>>& OutJsonArray);
|
||||
|
||||
/**
|
||||
* Export all CurveTables from the specified path to JSON
|
||||
* @param FolderPath - Root folder path to search (recursively)
|
||||
* @param OutJsonArray - Output array to store exported data
|
||||
* @return Number of assets exported
|
||||
*/
|
||||
static int32 ExportCurveTables(const FString& FolderPath, TArray<TSharedPtr<FJsonValue>>& OutJsonArray);
|
||||
|
||||
/**
|
||||
* Helper: Extract detailed Blueprint information
|
||||
* @param Blueprint - Blueprint asset to extract from
|
||||
* @return JSON object containing blueprint data
|
||||
*/
|
||||
static TSharedPtr<FJsonObject> ExtractBlueprintDetails(class UBlueprint* Blueprint);
|
||||
|
||||
/**
|
||||
* Helper: Extract Blueprint variables
|
||||
* @param Blueprint - Blueprint asset
|
||||
* @return JSON array of variables with name, type, default value
|
||||
*/
|
||||
static TArray<TSharedPtr<FJsonValue>> ExtractBlueprintVariables(class UBlueprint* Blueprint);
|
||||
|
||||
/**
|
||||
* Helper: Extract Blueprint functions
|
||||
* @param Blueprint - Blueprint asset
|
||||
* @return JSON array of functions with name, inputs, outputs
|
||||
*/
|
||||
static TArray<TSharedPtr<FJsonValue>> ExtractBlueprintFunctions(class UBlueprint* Blueprint);
|
||||
|
||||
/**
|
||||
* Helper: Extract Blueprint component hierarchy
|
||||
* @param Blueprint - Blueprint asset
|
||||
* @return JSON array of components
|
||||
*/
|
||||
static TArray<TSharedPtr<FJsonValue>> ExtractBlueprintComponents(class UBlueprint* Blueprint);
|
||||
|
||||
/**
|
||||
* Helper: Extract Blueprint event graphs
|
||||
* @param Blueprint - Blueprint asset
|
||||
* @return JSON array of event graphs with nodes and connections
|
||||
*/
|
||||
static TArray<TSharedPtr<FJsonValue>> ExtractBlueprintEventGraphs(class UBlueprint* Blueprint);
|
||||
|
||||
/**
|
||||
* Helper: Save JSON array to file
|
||||
* @param JsonArray - Array of JSON values to save
|
||||
* @param FileName - Name of output file (e.g., "DataTable.json")
|
||||
* @param OutputPath - Directory to save the file
|
||||
* @return true if successful
|
||||
*/
|
||||
static bool SaveJsonToFile(const TArray<TSharedPtr<FJsonValue>>& JsonArray, const FString& FileName, const FString& OutputPath);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user