Search in sources :

Example 1 with NumericalValue

use of com.talosvfx.talos.runtime.values.NumericalValue in project talos by rockbite.

the class StaticValueModule method defineSlots.

@Override
protected void defineSlots() {
    outputValue = createOutputSlot(OUTPUT);
    staticValue = new NumericalValue();
    staticValue.set(1f);
}
Also used : NumericalValue(com.talosvfx.talos.runtime.values.NumericalValue)

Example 2 with NumericalValue

use of com.talosvfx.talos.runtime.values.NumericalValue in project talos by rockbite.

the class InputModule method processValues.

@Override
public void processValues() {
    NumericalValue value = getScope().get(scopeKey);
    outputValue.set(value);
}
Also used : NumericalValue(com.talosvfx.talos.runtime.values.NumericalValue)

Example 3 with NumericalValue

use of com.talosvfx.talos.runtime.values.NumericalValue in project talos by rockbite.

the class ModuleWrapper method attachModuleToMyOutput.

public void attachModuleToMyOutput(ModuleWrapper moduleWrapper, int mySlot, int targetSlot) {
    // find the flavour
    Slot mySlotObject = getModule().getOutputSlot(mySlot);
    Slot toSlotObject = moduleWrapper.getModule().getInputSlot(targetSlot);
    if (mySlotObject == null || toSlotObject == null)
        return;
    if (mySlotObject.getValue() instanceof NumericalValue && toSlotObject.getValue() instanceof NumericalValue) {
        NumericalValue myValue = (NumericalValue) mySlotObject.getValue();
        NumericalValue toValue = (NumericalValue) toSlotObject.getValue();
        myValue.setFlavour(toValue.getFlavour());
    }
    // change the name
    lastAttachedTargetSlot = targetSlot;
    lastAttachedWrapper = moduleWrapper;
    setTitleText(constructTitle());
}
Also used : NumericalValue(com.talosvfx.talos.runtime.values.NumericalValue) Slot(com.talosvfx.talos.runtime.Slot)

Example 4 with NumericalValue

use of com.talosvfx.talos.runtime.values.NumericalValue in project talos by rockbite.

the class AbstractModule method createOutputSlot.

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

Example 5 with NumericalValue

use of com.talosvfx.talos.runtime.values.NumericalValue in project talos by rockbite.

the class MetaData method write.

@Override
public void write(Json json) {
    json.writeArrayStart("scopeDefaults");
    for (int i = 0; i < 10; i++) {
        NumericalValue val = TalosMain.Instance().globalScope.getDynamicValue(i);
        float[] arr = new float[4];
        for (int j = 0; j < 4; j++) {
            arr[j] = val.get(j);
        }
        json.writeValue(arr);
    }
    json.writeArrayEnd();
    // now sync preview widget stuff
    float camX = TalosMain.Instance().UIStage().PreviewWidget().getCameraPosX();
    float camY = TalosMain.Instance().UIStage().PreviewWidget().getCameraPosY();
    json.writeValue("previewCamPos", new Vector2(camX, camY));
    json.writeValue("previewCamZoom", TalosMain.Instance().UIStage().PreviewWidget().getCameraZoom());
    json.writeValue("bgImagePath", TalosMain.Instance().UIStage().PreviewWidget().getBackgroundImagePath());
    json.writeValue("isGridVisible", TalosMain.Instance().UIStage().PreviewWidget().isGridVisible());
    json.writeValue("bgImageIsInBack", TalosMain.Instance().UIStage().PreviewWidget().isBackgroundImageInBack());
    json.writeValue("bgImageSize", TalosMain.Instance().UIStage().PreviewWidget().getBgImageSize());
    json.writeValue("gridSize", TalosMain.Instance().UIStage().PreviewWidget().getGridSize());
    // particle position
    ParticleEffectInstance particleEffect = TalosMain.Instance().TalosProject().getParticleEffect();
    if (particleEffect != null) {
        json.writeValue("particlePositionX", particleEffect.getPosition().x);
        json.writeValue("particlePositionY", particleEffect.getPosition().y);
    }
    final ObjectMap<FileHandle, FileTracker.FileEntry> currentTabFiles = TalosMain.Instance().FileTracker().getCurrentTabFiles();
    if (currentTabFiles != null) {
        json.writeArrayStart("resourcePaths");
        for (ObjectMap.Entry<FileHandle, FileTracker.FileEntry> currentTabFile : currentTabFiles) {
            json.writeValue(currentTabFile.key.path());
        }
        json.writeArrayEnd();
    }
}
Also used : ParticleEffectInstance(com.talosvfx.talos.runtime.ParticleEffectInstance) Vector2(com.badlogic.gdx.math.Vector2) ObjectMap(com.badlogic.gdx.utils.ObjectMap) NumericalValue(com.talosvfx.talos.runtime.values.NumericalValue) FileHandle(com.badlogic.gdx.files.FileHandle)

Aggregations

NumericalValue (com.talosvfx.talos.runtime.values.NumericalValue)12 Slot (com.talosvfx.talos.runtime.Slot)3 ParticleEffectInstance (com.talosvfx.talos.runtime.ParticleEffectInstance)2 FileHandle (com.badlogic.gdx.files.FileHandle)1 Interpolation (com.badlogic.gdx.math.Interpolation)1 Vector2 (com.badlogic.gdx.math.Vector2)1 JsonValue (com.badlogic.gdx.utils.JsonValue)1 ObjectMap (com.badlogic.gdx.utils.ObjectMap)1 DragPoint (com.talosvfx.talos.editor.widgets.ui.DragPoint)1