INNER CODE UNIT · Python
add_variable_to_blueprint
prajwalshettydev/UnrealGenAISupport · Content/Python/mcp_server.py:445
def add_variable_to_blueprint(blueprint_path: str, variable_name: str, variable_type: str,
default_value: str = None, category: str = "Default") -> str:
"""
Add a variable to a Blueprint
Args:
blueprint_path: Path to the Blueprint asset
variable_name: Name for the new variable
variable_type: Type of the variable (e.g., "float", "vector", "boolean")
default_value: Default value for the variable (optional)
category: Category for organizing variables in the Blueprint editor (optional)
Returns:
Message indicating success or failure
"""
# Convert default_value to string if it's a number
if default_value is not None and not isinstance(default_value, str):
default_value = str(default_value)