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);
}
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);
}
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());
}
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;
}
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();
}
}
Aggregations