use of com.talosvfx.talos.editor.ParticleEmitterWrapper in project talos by rockbite.
the class TalosProject method initEmitter.
private ParticleEmitterWrapper initEmitter(String emitterName) {
ParticleEmitterWrapper emitterWrapper = new ParticleEmitterWrapper();
emitterWrapper.setName(emitterName);
ParticleEmitterDescriptor moduleGraph = TalosMain.Instance().TalosProject().particleEffectDescriptor.createEmitterDescriptor();
emitterWrapper.setModuleGraph(moduleGraph);
// particleEffect.addAdvancedEmitter(moduleGraph);
particleEffect.addEmitter(moduleGraph);
return emitterWrapper;
}
use of com.talosvfx.talos.editor.ParticleEmitterWrapper in project talos by rockbite.
the class TalosProject method sortEmitters.
public void sortEmitters() {
activeWrappers.sort(emitterComparator);
// fix for older projects
if (activeWrappers.size > 1 && activeWrappers.get(0).getEmitter().getSortPosition() == 0 && activeWrappers.get(1).getEmitter().getSortPosition() == 0) {
activeWrappers.reverse();
}
// re-normalize position numbers
int index = 0;
for (ParticleEmitterWrapper wrapper : activeWrappers) {
wrapper.getEmitter().setSortPosition(index++);
wrapper.setPosition(wrapper.getEmitter().getSortPosition());
}
particleEffect.sortEmitters();
}
use of com.talosvfx.talos.editor.ParticleEmitterWrapper in project talos by rockbite.
the class TalosProject method createNewEmitter.
public ParticleEmitterWrapper createNewEmitter(String emitterName, float sortPosition) {
ParticleEmitterWrapper emitterWrapper = initEmitter(emitterName);
activeWrappers.add(emitterWrapper);
currentEmitterWrapper = emitterWrapper;
emitterWrapper.setPosition(sortPosition);
sortEmitters();
TalosMain.Instance().ProjectController().setDirty();
TalosMain.Instance().NodeStage().moduleBoardWidget.setCurrentEmitter(currentEmitterWrapper);
return emitterWrapper;
}
use of com.talosvfx.talos.editor.ParticleEmitterWrapper in project talos by rockbite.
the class ProjectData method setFrom.
public void setFrom(ModuleBoardWidget moduleBoardWidget) {
final ObjectMap<ParticleEmitterWrapper, Array<ModuleWrapper>> moduleWrappers = moduleBoardWidget.moduleWrappers;
final ObjectMap<ParticleEmitterWrapper, Array<ModuleBoardWidget.NodeConnection>> nodeConnections = moduleBoardWidget.nodeConnections;
emitters.clear();
for (ParticleEmitterWrapper key : moduleWrappers.keys()) {
final EmitterData emitterData = new EmitterData();
emitterData.name = key.getName();
emitterData.sortPosition = key.getEmitter().getSortPosition();
emitterData.modules.addAll(moduleWrappers.get(key));
emitterData.isMuted = key.isMuted;
final Array<ModuleBoardWidget.NodeConnection> nodeConns = nodeConnections.get(key);
if (nodeConns != null) {
for (ModuleBoardWidget.NodeConnection nodeConn : nodeConns) {
emitterData.connections.add(new ConnectionData(nodeConn.fromModule.getId(), nodeConn.toModule.getId(), nodeConn.fromSlot, nodeConn.toSlot));
}
}
// add groups
for (ModuleWrapperGroup group : moduleBoardWidget.getGroups(key)) {
GroupData groupData = new GroupData();
groupData.text = group.getText();
groupData.modules = new Array<>();
groupData.color = group.getFrameColor().toFloatBits();
for (ModuleWrapper wrapper : group.getModuleWrappers()) {
groupData.modules.add(wrapper.getId());
}
emitterData.groups.add(groupData);
}
emitters.add(emitterData);
}
}
use of com.talosvfx.talos.editor.ParticleEmitterWrapper in project talos by rockbite.
the class TimelineWidgetLegacy method setEmitters.
public void setEmitters(Array<ParticleEmitterWrapper> emitterWrappers) {
listContent.clearChildren();
for (ParticleEmitterWrapper emitter : emitterWrappers) {
EmitterRow row = new EmitterRow(this, getSkin());
row.set(emitter);
listContent.add(row).growX();
rows.add(row);
listContent.row().padTop(0);
}
listContent.row();
listContent.add().expandY();
if (emitterWrappers.size > 0) {
selectRow(TalosMain.Instance().TalosProject().getCurrentEmitterWrapper());
}
}
Aggregations