From caae061b0e5a2e128624ec7ac629fd7070e25f12 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 13 Sep 2025 10:14:52 -0500 Subject: [PATCH] expand TSShape::addSequence filetype filtercheck if we're going to be looking into additional file formats for animation sources, need to check all of the extensions --- Engine/source/ts/tsShape.h | 1 + Engine/source/ts/tsShapeEdit.cpp | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Engine/source/ts/tsShape.h b/Engine/source/ts/tsShape.h index c4446faa5..e5a9cad83 100644 --- a/Engine/source/ts/tsShape.h +++ b/Engine/source/ts/tsShape.h @@ -681,6 +681,7 @@ class TSShape S32 setDetailSize(S32 oldSize, S32 newSize); bool removeDetail(S32 size); + bool isShapeFileType(Torque::Path filePath); bool addSequence(const Torque::Path& path, const String& fromSeq, const String& name, S32 startFrame, S32 endFrame, bool padRotKeys, bool padTransKeys); bool removeSequence(const String& name); diff --git a/Engine/source/ts/tsShapeEdit.cpp b/Engine/source/ts/tsShapeEdit.cpp index 601b4ad87..6c7533d97 100644 --- a/Engine/source/ts/tsShapeEdit.cpp +++ b/Engine/source/ts/tsShapeEdit.cpp @@ -1356,6 +1356,25 @@ bool TSShape::removeDetail( S32 size ) return true; } +bool TSShape::isShapeFileType(Torque::Path filePath) +{ + String fileExt = filePath.getExtension(); + + if ( + fileExt.equal("dts", String::NoCase) || + fileExt.equal("dsq", String::NoCase) || + fileExt.equal("dae", String::NoCase) || + fileExt.equal("fbx", String::NoCase) || + fileExt.equal("blend", String::NoCase) || + fileExt.equal("obj", String::NoCase) || + fileExt.equal("gltf", String::NoCase) || + fileExt.equal("glb", String::NoCase) + ) + return true; + + return false; +} + //----------------------------------------------------------------------------- bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, const String& name, S32 startFrame, S32 endFrame, @@ -1439,8 +1458,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, Resource hSrcShape; TSShape* srcShape = this; // Assume we are copying an existing sequence - if (path.getExtension().equal("dts", String::NoCase) || - path.getExtension().equal("dae", String::NoCase)) + if (isShapeFileType(path)) { // DTS or DAE source file char filenameBuf[1024];