Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Converter messes particles/ribbons up #3

Description

@EgoSumThan

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;
         }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions