Search in sources :

Example 11 with Slot

use of com.talosvfx.talos.runtime.Slot in project talos by rockbite.

the class AbstractModule method fetchInputSlotValue.

/**
 * Fetch value from the input of this module
 * @param slotId
 */
public void fetchInputSlotValue(int slotId) {
    // find what it is connected to
    Slot inputSlot = inputSlots.get(slotId);
    if (inputSlot == null) {
        return;
    }
    if (inputSlot.getTargetSlot() == null) {
        if (inputSlot.getValue() == null)
            return;
        inputSlot.getValue().setEmpty(true);
    } else {
        // ask it's module give it's output value
        Value result = inputSlot.getTargetModule().fetchOutputSlotValue(inputSlot.getTargetSlot().getIndex());
        if (result != null) {
            inputSlot.getValue().set(result);
            inputSlot.getValue().setEmpty(false);
        }
    }
}
Also used : JsonValue(com.badlogic.gdx.utils.JsonValue) NumericalValue(com.talosvfx.talos.runtime.values.NumericalValue) Value(com.talosvfx.talos.runtime.values.Value) Slot(com.talosvfx.talos.runtime.Slot)

Example 12 with Slot

use of com.talosvfx.talos.runtime.Slot in project talos by rockbite.

the class AbstractModule method createInputSlot.

public NumericalValue createInputSlot(int slotId) {
    inputSlots.put(slotId, new Slot(this, slotId, true));
    NumericalValue value = new NumericalValue();
    inputSlots.get(slotId).setValue(value);
    return value;
}
Also used : NumericalValue(com.talosvfx.talos.runtime.values.NumericalValue) Slot(com.talosvfx.talos.runtime.Slot)

Example 13 with Slot

use of com.talosvfx.talos.runtime.Slot in project talos by rockbite.

the class AbstractModule method detach.

public void detach(AbstractModule module) {
    for (Slot slot : inputSlots.values()) {
        if (slot.getTargetModule() == module) {
            slot.getTargetSlot().detach();
            slot.detach();
        }
    }
}
Also used : Slot(com.talosvfx.talos.runtime.Slot)

Aggregations

Slot (com.talosvfx.talos.runtime.Slot)13 NumericalValue (com.talosvfx.talos.runtime.values.NumericalValue)4 JsonValue (com.badlogic.gdx.utils.JsonValue)1 ReflectionException (com.badlogic.gdx.utils.reflect.ReflectionException)1 RibbonRenderer (com.talosvfx.talos.runtime.render.drawables.RibbonRenderer)1 Value (com.talosvfx.talos.runtime.values.Value)1