MultiConverter icon indicating copy to clipboard operation
MultiConverter copied to clipboard

Converter messes particles/ribbons up

Open EgoSumThan opened this issue 5 years ago • 0 comments

image

Heya, see picture. Converter, for some reason messes particle/ribbon emitter count up. Effectively has the file error.

nRibbonEmitters pre-conversion: 0 nRibbonEmitters post-conversion: 1 nParticleEmitters pre-conversion: 1 nParticleEmitters post-conversion: 2

Base file from 7.3.5 Example file: world\expansion05\doodads\torch2.m2

Additional note: I added a TXID check. Attaching it in diff.

diff --git a/Backup/MultiConverterLib/ModelConverter.cs b/Backup/MultiConverterLib/ModelConverter.cs
index 1d971d1..1042c5c 100644
--- a/Backup/MultiConverterLib/ModelConverter.cs
+++ b/Backup/MultiConverterLib/ModelConverter.cs
@@ -126,7 +126,8 @@ namespace MultiConverterLib
 
             RemoveLegionChunks();
 
-            FixTXID();
+            if (LocateTXIDChunk() > 0)
+                FixTXID();
             FixCamera();
             FixAnimations();
             FixSkins();
@@ -656,6 +657,18 @@ namespace MultiConverterLib
                 if (Data[i] == 0x4D && Data[i + 1] == 0x44 && Data[i + 2] == 0x32 && Data[i + 3] == 0x30)
                     return i;
 
+            // todo : add error log
+            return 0;
+        }
+
+        // Rienix
+        // Hackfix
+        private int LocateTXIDChunk()
+        {
+            for (int i = 0; i < Size() - 3; i++)
+                if (Data[i] == 0x54 && Data[i + 1] == 0x58 && Data[i + 2] == 0x49 && Data[i + 3] == 0x44)
+                    return i;
+
             // todo : add error log
             return 0;
         }

EgoSumThan avatar Mar 08 '20 23:03 EgoSumThan