# Blueprint Workflow Skill You are executing a Blueprint workflow command for Unreal Engine. This skill helps with analyzing, converting, and transforming Blueprints. ## Command: {{command}} ## Arguments: {{args}} --- ## Instructions by Command ### If command is `analyze` 1. Use `read_blueprint` tool to parse the Blueprint 2. Use `profile_blueprint` tool if editor is connected 3. Analyze for common issues: - Heavy Event Tick usage (operations per frame) - Blueprint casts (expensive operations) - Tick-dependent logic that could be event-driven - Large Blueprint graphs that should be split - Missing async loading for assets - Component lookups that should be cached 4. Report findings in this format: ``` ## Performance Analysis: ### Issues Found 🔴 HIGH: → Suggestion: 🟡 MEDIUM: → Suggestion: 🟢 LOW: → Suggestion: ### Metrics - Estimated Tick Cost: operations/frame - Complexity Score: - Optimization Potential: % ### Recommendations 1. 2. ``` --- ### If command is `bp-to-cpp` 1. Use `read_blueprint` tool to parse the Blueprint structure 2. Extract: - Variables (types, defaults, replication) - Functions (parameters, return types) - Events (delegates, dispatchers) - Components 3. Generate C++ code following Epic standards: - Proper UCLASS, UPROPERTY, UFUNCTION macros - Blueprint-friendly specifiers (BlueprintCallable, BlueprintReadWrite) - Network replication if needed (Replicated, ReplicatedUsing) - Categories for organization 4. Output format: ```cpp // .h #pragma once #include "CoreMinimal.h" #include ".h" #include ".generated.h" UCLASS(Blueprintable) class MYPROJECT_API : public { GENERATED_BODY() public: (); // Properties UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "...") ; // Functions UFUNCTION(BlueprintCallable, Category = "...") (); protected: virtual void BeginPlay() override; }; ``` ```cpp // .cpp #include ".h" ::() { // Set defaults } void ::BeginPlay() { Super::BeginPlay(); } ::() { // Implementation } ``` 5. Note any Blueprint-specific logic that cannot be directly converted --- ### If command is `cpp-to-bp` 1. Use `scan_cpp_classes` to find the C++ class 2. Extract exposed properties and functions (UPROPERTY, UFUNCTION with Blueprint specifiers) 3. Use `create_blueprint_from_cpp` tool to create the Blueprint 4. If editor not connected, generate a Python script: ```python import unreal # Create Blueprint from factory = unreal.BlueprintFactory() factory.set_editor_property('parent_class', unreal.find_class('')) asset_tools = unreal.AssetToolsHelpers.get_asset_tools() blueprint = asset_tools.create_asset( '', '', unreal.Blueprint, factory ) if blueprint: unreal.EditorAssetLibrary.save_asset('/') unreal.log('Created: /') ``` 5. Report what was created: ``` ## Blueprint Created: ### Parent Class ### Exposed Properties (tweakable in Blueprint) - : = - ... ### Callable Functions - () → - ... ### Events - - ... ### Location / ``` --- ### If command is `transform` 1. Use `read_blueprint` to get current Blueprint structure 2. Understand the modification request: "{{args}}" 3. Design the changes needed: - New variables - New functions - Modified logic - New components 4. Generate the transformation: - If simple: Generate Python script to modify Blueprint - If complex: Generate new C++ base class + new Blueprint 5. Report the transformation: ``` ## Blueprint Transformation: ### Requested Change "" ### Changes Made 1. Added variable: () 2. Added function: () 3. Modified: ### New Features - ### Generated Files - - ### Next Steps 1. ``` --- ### If command is `optimize` 1. First run `analyze` workflow internally 2. Identify optimization opportunities: - Event Tick → Events + Timers - Blueprint casts → Interfaces - Heavy logic → C++ conversion candidates - Repeated operations → Caching 3. For each HIGH impact issue: - Generate optimized C++ code - Or generate Python script to refactor Blueprint 4. Report: ``` ## Optimization Report: ### Before - Tick Cost: ops/frame - Complexity: ### After (Estimated) - Tick Cost: ops/frame - Complexity: - **Performance Gain: +%** ### Optimizations Applied 1. - Before: - After: - Gain: +% ### Generated Files - - - - ### Manual Steps Required 1. 2. ``` --- ## Important Notes - Always use MCP tools when available (`read_blueprint`, `create_blueprint_from_cpp`, etc.) - If editor not connected, generate scripts for manual execution - Follow Epic Coding Standards for all C++ code - Preserve Blueprint functionality when converting - Add comments explaining complex conversions - Warn about any functionality that cannot be preserved