@@ -30,7 +30,7 @@ export setupGuiFrames :: () {
3030 guiState.separator!({ thick=true }),
3131
3232 guiState.vbox!({ name="projectSettings",
33- guiState.section!({ label="Custom data",
33+ guiState.section!({ --[[name="customDataProjectSection",]] label="Custom data",
3434 guiState.inputText!({ name="customDataProject" }),
3535 }),
3636
@@ -91,7 +91,7 @@ export setupGuiFrames :: () {
9191 guiState.tabs!({ name="systems", specialLastTab=true }),
9292
9393 guiState.scrollable!({
94- guiState.section!({ label="Custom data",
94+ guiState.section!({ --[[name="customDataSystemSection",]] label="Custom data",
9595 guiState.inputText!({ name="customDataSystem" }),
9696 }),
9797
@@ -2717,7 +2717,7 @@ export setupGuiCallbacks :: () {
27172717 local ^ok, basePath = resolveBaseOuputPath(project)
27182718 if ok {
27192719 local ^ok, texturePathObj = Path.getRelativeTo(texturePath, basePath)
2720- if ok texturePath = texturePathObj.toString!()
2720+ if ok and texturePathObj.path[1] ~= ".." texturePath = texturePathObj.toString!()
27212721 }
27222722 } else {
27232723 texturePath = ""
@@ -2726,23 +2726,45 @@ export setupGuiCallbacks :: () {
27262726 publicParticleSystem.texturePath = texturePath
27272727 }
27282728
2729+ do {
2730+ local shaderPath = ""
2731+ local shaderFilename = ""
2732+
2733+ local ^ok, shaderPathFull = getShaderFullPath(project, system)
2734+ if ok {
2735+ ok, shaderFilename = Path(system.shaderPath).getFilename!()
2736+ if not ok shaderFilename = ""
2737+
2738+ shaderPath = shaderFilename
2739+
2740+ local ^ok, basePath = resolveBaseOuputPath(project)
2741+ if ok {
2742+ local ^ok, shaderPathObj = Path.getRelativeTo(shaderPathFull, basePath)
2743+ if ok and shaderPathObj.path[1] ~= ".." shaderPath = shaderPathObj.toString!()
2744+ }
2745+ }
2746+
2747+ publicParticleSystem.shaderPath = shaderPath
2748+ publicParticleSystem.shaderFilename = shaderFilename
2749+ }
2750+
27292751 publicParticleSystem.blendMode = system.blendMode
27302752 publicParticleSystem.bufferSize = getOptimalBufferSize(system)
2753+ publicParticleSystem.customData = system.customData
27312754 publicParticleSystem.direction = ps.getDirection!()
27322755 publicParticleSystem.emissionRate = ps.getEmissionRate!()
27332756 publicParticleSystem.emitAtStart = system.kickStartEmit
27342757 publicParticleSystem.emitterLifetime = ps.getEmitterLifetime!()
27352758 publicParticleSystem.insertMode = ps.getInsertMode!()
2736- publicParticleSystem.kickStartSteps = system.kickStartSteps
27372759 publicParticleSystem.kickStartDt = getKickStartDt(system)
2760+ publicParticleSystem.kickStartSteps = system.kickStartSteps
27382761 publicParticleSystem.relativeRotation = ps.hasRelativeRotation!()
27392762 publicParticleSystem.sizes = cast([]float) { ps.getSizesAsVararg!() }
27402763 publicParticleSystem.sizeVariation = ps.getSizeVariation!()
27412764 publicParticleSystem.spinVariation = ps.getSpinVariation!()
27422765 publicParticleSystem.spread = ps.getSpread!()
27432766 publicParticleSystem.texturePreset = system.textureName
27442767 publicParticleSystem.title = system.title
2745- publicParticleSystem.customData = system.customData
27462768
27472769 do { local min,max = ps.getLinearDamping!() ; publicParticleSystem.linearDamping = cast(table) {min,max, min=min,max=max} }
27482770 do { local min,max = ps.getParticleLifetime!() ; publicParticleSystem.particleLifetime = cast(table) {min,max, min=min,max=max} }
0 commit comments