summaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-03-31 21:52:22 -0700
committeryum <yum.food.vr@gmail.com>2026-03-31 21:52:22 -0700
commit072fa8904087ad780ef09132e0e0717d0eecdb68 (patch)
tree9106d1a919f1e54c6895b976053b6d732651ce48 /Scripts
parent57aa53c6b1b51265839dbd71aac4eeb88e050de0 (diff)
ssfd bugfixes
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/Editor/StackTextures3D.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Scripts/Editor/StackTextures3D.cs b/Scripts/Editor/StackTextures3D.cs
index 3e88025..c3c65c2 100644
--- a/Scripts/Editor/StackTextures3D.cs
+++ b/Scripts/Editor/StackTextures3D.cs
@@ -6,6 +6,7 @@ public class StackTextures3D : EditorWindow
Texture2D[] _slices = new Texture2D[0];
SerializedObject _so;
SerializedProperty _slicesProp;
+ [SerializeField] bool reverseStackOrder = false;
[MenuItem("Tools/yum_food/Stack Textures to 3D")]
static void Open() => GetWindow<StackTextures3D>("Stack Textures to 3D");
@@ -31,6 +32,9 @@ public class StackTextures3D : EditorWindow
var prop = _so.FindProperty("slices");
EditorGUILayout.PropertyField(prop, new GUIContent("Slices"), true);
+ EditorGUILayout.PropertyField(
+ _so.FindProperty("reverseStackOrder"),
+ new GUIContent("Reverse Stack Order"));
_so.ApplyModifiedProperties();
if (slices == null || slices.Length == 0)
@@ -86,12 +90,13 @@ public class StackTextures3D : EditorWindow
}
}
- bool mipMaps = true;
+ bool mipMaps = false;
var tex = new Texture3D(width, height, depth, fmt, mipMaps);
for (int z = 0; z < depth; z++)
{
- var pixels = slices[z].GetPixels();
+ int sourceIndex = reverseStackOrder ? (depth - 1 - z) : z;
+ var pixels = slices[sourceIndex].GetPixels();
for (int y = 0; y < height; y++)
for (int x = 0; x < width; x++)
{
@@ -100,7 +105,7 @@ public class StackTextures3D : EditorWindow
}
tex.wrapMode = TextureWrapMode.Repeat;
- tex.filterMode = FilterMode.Trilinear;
+ tex.filterMode = FilterMode.Bilinear;
tex.Apply();
string dir = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(slices[0]));