BananaMash

Finites states for infinite people.

Banana mash is a finite state-mashine for TouchDesigner with a nice looking UI and powerfull callbacks.

Repository on GitHub

Parameters:
  • Conditions: Refference to the "Valuecomp". Changes of Pars of this comp will trigger a check.
  • States: The component holding the states. 

  • Default State: The name of the state that will be entered on init.
  • Check on Parchange: Checks all connections of the current state when one of the conditionals is adjusted. Skips timing.
  • Time Active: Checks if states should act on timing. If not set to true, states will remain static until a check is initiated, either via a parameter-adjustment, calling the Check() method or pulsing the Check parameter.
  • Auto Continue: Should a state evaluate all connections when it is entered or should it wait for an external trigger. DANGER: Recursion may appear!
  • Check: Manually trigger a check.

Callbacks:
  • OnStateEnter(prev_state:str, state:str, time:float): Gets called when we enter a state.
  • OnStateExit(state:str, next_state:str): Gets called when we leave a state. Gets called before StateEnter
  • OnStateCycle(state:str, time:float): Gets called when a state is evaluated and no connections is used.
  • State_Callbacks: You can define the same callbacks, but for specific states. For example to trigger when state Foo is entered, simply def OnFooEnter(time)

Events:
This component implements an EventEmitter. Use an EventListener to catch StateChanges remotely.

Outputs:
  1. The current active state.
  2. The state of the current time.

UI:
The UI is situated in a subcomponent of the bananMashBASE. You can move the UI outside and reffer the baseCOMP.
L-Click: Select State. Drag Network.
M-Click: Drag Network.
R-Click: Create new Connection.
Wheel: Zoom.
Del: Remove State.
Ctrl+N/Green +: New State

The right side is the edit-space. 
The top list holds all connections of the selected state.
The bottom holds a simple editor for the check() function. This function will be called during a check of this connection. Use the parameters to evaluate the current connection.
Use the editbutton to open module in exterbal editor.

Downloads: 793

Created at: 3.6.2021

Uploaded: 2.7.2024
Complete Rework to version 3 with transitions and new UI!
Download