mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
dsqs area subset of dts data
ensure if an input file contains mesh data *and* an animation, thats a dts, if it's *just* an armature, that's dsq also fix shapeanimation tooltip display and for furutere utility, TSShape::isShapeFileType(Torque::Path filePath); is now static since it only requires a path, not an object instance per-se
This commit is contained in:
parent
50815c1a5a
commit
cd5f897e55
4 changed files with 36 additions and 40 deletions
|
|
@ -993,21 +993,24 @@ TSShape* assimpLoadShape(const Torque::Path &path)
|
||||||
tss->write(&dtsStream);
|
tss->write(&dtsStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
Torque::Path dsqPath(cachedPath);
|
if (tss->meshes.empty())
|
||||||
dsqPath.setExtension("dsq");
|
|
||||||
FileStream animOutStream;
|
|
||||||
for (S32 i = 0; i < tss->sequences.size(); i++)
|
|
||||||
{
|
{
|
||||||
const String& seqName = tss->getName(tss->sequences[i].nameIndex);
|
Torque::Path dsqPath(cachedPath);
|
||||||
Con::printf("Writing DSQ Animation File for sequence '%s'", seqName.c_str());
|
dsqPath.setExtension("dsq");
|
||||||
|
FileStream animOutStream;
|
||||||
dsqPath.setFileName(cachedPath.getFileName() + "_" + seqName);
|
for (S32 i = 0; i < tss->sequences.size(); i++)
|
||||||
if (animOutStream.open(dsqPath.getFullPath(), Torque::FS::File::Write))
|
|
||||||
{
|
{
|
||||||
tss->exportSequence(&animOutStream, tss->sequences[i], false);
|
const String& seqName = tss->getName(tss->sequences[i].nameIndex);
|
||||||
animOutStream.close();
|
Con::printf("Writing DSQ Animation File for sequence '%s'", seqName.c_str());
|
||||||
}
|
|
||||||
|
|
||||||
|
dsqPath.setFileName(cachedPath.getFileName() + "_" + seqName);
|
||||||
|
if (animOutStream.open(dsqPath.getFullPath(), Torque::FS::File::Write))
|
||||||
|
{
|
||||||
|
tss->exportSequence(&animOutStream, tss->sequences[i], false);
|
||||||
|
animOutStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loader.updateMaterialsScript(path);
|
loader.updateMaterialsScript(path);
|
||||||
|
|
|
||||||
|
|
@ -737,23 +737,25 @@ TSShape* loadColladaShape(const Torque::Path &path)
|
||||||
tss->write(&dtsStream);
|
tss->write(&dtsStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
Torque::Path dsqPath(cachedPath);
|
if (tss->meshes.empty())
|
||||||
dsqPath.setExtension("dsq");
|
|
||||||
FileStream animOutStream;
|
|
||||||
for (S32 i = 0; i < tss->sequences.size(); i++)
|
|
||||||
{
|
{
|
||||||
const String& seqName = tss->getName(tss->sequences[i].nameIndex);
|
Torque::Path dsqPath(cachedPath);
|
||||||
Con::printf("Writing DSQ Animation File for sequence '%s'", seqName.c_str());
|
dsqPath.setExtension("dsq");
|
||||||
|
FileStream animOutStream;
|
||||||
dsqPath.setFileName(cachedPath.getFileName() + "_" + seqName);
|
for (S32 i = 0; i < tss->sequences.size(); i++)
|
||||||
if (animOutStream.open(dsqPath.getFullPath(), Torque::FS::File::Write))
|
|
||||||
{
|
{
|
||||||
tss->exportSequence(&animOutStream, tss->sequences[i], false);
|
const String& seqName = tss->getName(tss->sequences[i].nameIndex);
|
||||||
animOutStream.close();
|
Con::printf("Writing DSQ Animation File for sequence '%s'", seqName.c_str());
|
||||||
|
|
||||||
|
dsqPath.setFileName(cachedPath.getFileName() + "_" + seqName);
|
||||||
|
if (animOutStream.open(dsqPath.getFullPath(), Torque::FS::File::Write))
|
||||||
|
{
|
||||||
|
tss->exportSequence(&animOutStream, tss->sequences[i], false);
|
||||||
|
animOutStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DAE2DTS_TOOL
|
#endif // DAE2DTS_TOOL
|
||||||
|
|
||||||
// Add collada materials to materials.tscript
|
// Add collada materials to materials.tscript
|
||||||
|
|
|
||||||
|
|
@ -681,7 +681,7 @@ class TSShape
|
||||||
S32 setDetailSize(S32 oldSize, S32 newSize);
|
S32 setDetailSize(S32 oldSize, S32 newSize);
|
||||||
bool removeDetail(S32 size);
|
bool removeDetail(S32 size);
|
||||||
|
|
||||||
bool isShapeFileType(Torque::Path filePath);
|
static 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 addSequence(const Torque::Path& path, const String& fromSeq, const String& name, S32 startFrame, S32 endFrame, bool padRotKeys, bool padTransKeys);
|
||||||
bool removeSequence(const String& name);
|
bool removeSequence(const String& name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,23 +11,14 @@ function ShapeAnimationAsset::buildBrowserElement(%this, %previewData)
|
||||||
{
|
{
|
||||||
%previewData.assetName = %this.animationName;
|
%previewData.assetName = %this.animationName;
|
||||||
%previewData.assetPath = %this.scriptFile;
|
%previewData.assetPath = %this.scriptFile;
|
||||||
|
|
||||||
//Lotta prepwork
|
|
||||||
/*%previewData.doubleClickCommand = %assetDef@".materialDefinitionName.reload(); "
|
|
||||||
@ "$Tools::materialEditorList = \"\";"
|
|
||||||
@ "EWorldEditor.clearSelection();"
|
|
||||||
@ "MaterialEditorGui.currentObject = 0;"
|
|
||||||
@ "MaterialEditorGui.currentMode = \"asset\";"
|
|
||||||
@ "MaterialEditorGui.currentMaterial = "@%assetDef@".materialDefinitionName;"
|
|
||||||
@ "MaterialEditorGui.setActiveMaterial( "@%assetDef@".materialDefinitionName );"
|
|
||||||
@ "EditorGui.setEditor(MaterialEditorPlugin); "
|
|
||||||
@ "AssetBrowser.hideDialog();";*/
|
|
||||||
|
|
||||||
%previewData.previewImage = "ToolsModule:animationIcon_image";
|
%previewData.previewImage = "ToolsModule:animationIcon_image";
|
||||||
|
|
||||||
%previewData.assetFriendlyName = %this.assetName;
|
%previewData.assetFriendlyName = %this.assetName;
|
||||||
%previewData.assetDesc = %this.description;
|
%previewData.assetDesc = %this.description;
|
||||||
%previewData.tooltip = %this.friendlyName @ "\n"
|
|
||||||
@ %this @ "\nShape File path: "
|
%previewData.tooltip = "Asset Name: " @ %this.assetName @ "\n" @
|
||||||
@ %this.getShapePath();
|
"Asset Type: Animation Asset\n" @
|
||||||
|
"Asset Definition ID: " @ %this @ "\n" @
|
||||||
|
"Animation File path: " @ %this.getAnimationPath();
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue