Kemena3D
Loading...
Searching...
No Matches
kscriptgraph.h File Reference

Visual-scripting node graph: data model, JSON serialisation, and AngelScript code generation. More...

#include "kexport.h"
#include <vector>
#include <string>
#include <nlohmann/json.hpp>
#include "kdatatype.h"
Include dependency graph for kscriptgraph.h:

Go to the source code of this file.

Classes

struct  kemena::kScriptGraphPin
 A connection point on a node. More...
struct  kemena::kScriptGraphNode
 A single graph node with its input/output pins and payload. More...
 A directed wire from an output pin to an input pin. More...
struct  kemena::kScriptGraphVar
 A graph-scope variable, emitted as an AngelScript global. More...
struct  kemena::kScriptGraph
 The complete editable node graph for one script. More...
struct  kemena::kScriptGraphResult
 Result of compiling a graph to AngelScript text. More...

Namespaces

namespace  kemena
 Top-level Kemena3D engine namespace.
namespace  kemena::kScriptGraphCompiler
 Compiles a node graph into AngelScript source text.

Typedefs

using kemena::kJson = nlohmann::json

Enumerations

enum class  kemena::kScriptPinType {
  kemena::Exec = 0 , kemena::Float , kemena::Bool , kemena::String ,
  kemena::Vec3 , kemena::Object
}
 Kind/type of a node pin. Exec pins carry control flow; the rest carry typed data values. More...
enum class  kemena::kScriptNodeType {
  kemena::EventAwake = 0 , kemena::EventStart , kemena::EventUpdate , kemena::EventFixedUpdate ,
  kemena::EventLateUpdate , kemena::EventOnDestroy , kemena::Branch , kemena::Print ,
  kemena::SetPosition , kemena::SetRotation , kemena::SetScale , kemena::Translate ,
  kemena::Rotate , kemena::SetActive , kemena::SetVariable , kemena::GetSelf ,
  kemena::GetPosition , kemena::GetRotation , kemena::GetScale , kemena::GetForward ,
  kemena::GetRight , kemena::GetUp , kemena::GetDeltaTime , kemena::GetVariable ,
  kemena::LiteralFloat , kemena::LiteralBool , kemena::LiteralString , kemena::LiteralVec3 ,
  kemena::Add , kemena::Subtract , kemena::Multiply , kemena::Divide ,
  kemena::MakeVec3 , kemena::BreakVec3 , kemena::ScaleVec3 , kemena::Greater ,
  kemena::Less , kemena::Equal , kemena::And , kemena::Or ,
  kemena::Not , kemena::Count
}
 Every node kind the visual scripting graph supports. More...

Functions

KEMENA3D_API const char * kemena::kScriptNodeTypeName (kScriptNodeType type)
 Human-readable label for a node type (used by the editor menu).
KEMENA3D_API kScriptGraphResult kemena::kScriptGraphCompiler::compile (const kScriptGraph &graph)
 Compiles a node graph into AngelScript source text.

Detailed Description

Visual-scripting node graph: data model, JSON serialisation, and AngelScript code generation.

A kScriptGraph is the editable form of a node-graph script. The editor saves it as a .logic JSON file; kScriptGraphCompiler::compile() turns it into AngelScript .as text that flows through the normal script pipeline (kScriptManager compiles that text to bytecode).

The graph mixes two wire kinds, Unreal-Blueprint style:

  • Execution wires (kScriptPinType::Exec) sequence the statements.
  • Data wires (Float/Bool/String/Vec3/Object) feed values into pins.