Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
51 changes: 0 additions & 51 deletions CMakeLists.txt

This file was deleted.

51 changes: 51 additions & 0 deletions CharacterExporter.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Exporter", "Exporter\Exporter.vcproj", "{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config-files", "config-files", "{4BAB174C-F023-41B0-8FA8-58B4367FE064}"
ProjectSection(SolutionItems) = preProject
data\anim.conf = data\anim.conf
data\boy3.conf = data\boy3.conf
data\character.conf = data\character.conf
data\middle.conf = data\middle.conf
data\multi-materials.conf = data\multi-materials.conf
data\simple-all.conf = data\simple-all.conf
data\simple-anims.conf = data\simple-anims.conf
data\simplest.conf = data\simplest.conf
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "batch-files", "batch-files", "{AEF5804C-E6C4-4DD5-A878-26A57E6A879F}"
ProjectSection(SolutionItems) = preProject
data\test.bat = data\test.bat
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "camera-files", "camera-files", "{AE99190D-5D6D-4407-9BEB-CE23ECB57B6E}"
ProjectSection(SolutionItems) = preProject
data\anim.camera = data\anim.camera
data\character.camera = data\character.camera
data\middle.camera = data\middle.camera
data\simple-all.camera = data\simple-all.camera
data\simple-anims.camera = data\simple-anims.camera
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}.Debug|Win32.ActiveCfg = Debug|Win32
{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}.Debug|Win32.Build.0 = Debug|Win32
{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}.Debug|x64.ActiveCfg = Debug|x64
{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}.Debug|x64.Build.0 = Debug|x64
{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}.Release|Win32.ActiveCfg = Release|Win32
{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}.Release|Win32.Build.0 = Release|Win32
{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}.Release|x64.ActiveCfg = Release|x64
{F33CEE79-45EF-49A5-8A33-770D9A53FEE9}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
39 changes: 39 additions & 0 deletions CharacterLoader.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Loader", "Loader\Loader.vcproj", "{C58DCF80-BE58-4080-A798-28F6DD577066}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Viewer", "Viewer\Viewer.vcproj", "{66B70A84-B92A-4AB4-9EF2-657AE42066CB}"
ProjectSection(ProjectDependencies) = postProject
{C58DCF80-BE58-4080-A798-28F6DD577066} = {C58DCF80-BE58-4080-A798-28F6DD577066}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C58DCF80-BE58-4080-A798-28F6DD577066}.Debug|Win32.ActiveCfg = Debug|Win32
{C58DCF80-BE58-4080-A798-28F6DD577066}.Debug|Win32.Build.0 = Debug|Win32
{C58DCF80-BE58-4080-A798-28F6DD577066}.Debug|x64.ActiveCfg = Debug|x64
{C58DCF80-BE58-4080-A798-28F6DD577066}.Debug|x64.Build.0 = Debug|x64
{C58DCF80-BE58-4080-A798-28F6DD577066}.Release|Win32.ActiveCfg = Release|Win32
{C58DCF80-BE58-4080-A798-28F6DD577066}.Release|Win32.Build.0 = Release|Win32
{C58DCF80-BE58-4080-A798-28F6DD577066}.Release|x64.ActiveCfg = Release|x64
{C58DCF80-BE58-4080-A798-28F6DD577066}.Release|x64.Build.0 = Release|x64
{66B70A84-B92A-4AB4-9EF2-657AE42066CB}.Debug|Win32.ActiveCfg = Debug|Win32
{66B70A84-B92A-4AB4-9EF2-657AE42066CB}.Debug|Win32.Build.0 = Debug|Win32
{66B70A84-B92A-4AB4-9EF2-657AE42066CB}.Debug|x64.ActiveCfg = Debug|x64
{66B70A84-B92A-4AB4-9EF2-657AE42066CB}.Debug|x64.Build.0 = Debug|x64
{66B70A84-B92A-4AB4-9EF2-657AE42066CB}.Release|Win32.ActiveCfg = Release|Win32
{66B70A84-B92A-4AB4-9EF2-657AE42066CB}.Release|Win32.Build.0 = Release|Win32
{66B70A84-B92A-4AB4-9EF2-657AE42066CB}.Release|x64.ActiveCfg = Release|x64
{66B70A84-B92A-4AB4-9EF2-657AE42066CB}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
67 changes: 67 additions & 0 deletions Exporter/Animation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
Maya Character Exporter
Copyright (c) 2009 Jun Murakawa

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/

#include "Animation.h"

#include <assert.h>

#include <maya/MAnimControl.h>
#include <maya/MFileIO.h>

Animation::Animation(void)
{
}

Animation::~Animation(void)
{
}

void OutputAnimation(std::ostream &ofs, BlendShapeList &blendShapes, SAnimation* anim, SkeletonWriter& skel)
{
// get file name
std::string filePath( MFileIO::currentFile().asChar() );
std::string key("/");
size_t found = filePath.rfind(key);
assert(found != std::string::npos);
std::string fileName = filePath.substr( found+1 );

ofs << "ANIMATION "
<< fileName
<< "\n";
strcpy_s( anim->name, fileName.c_str() );

// get start and end times
int startFrame = static_cast<int>(MAnimControl::minTime().as(MTime::kNTSCField));
int endFrame = static_cast<int>(MAnimControl::maxTime().as(MTime::kNTSCField));
float startTime = static_cast<float>(MAnimControl::minTime().as(MTime::kSeconds));
float endTime = static_cast<float>(MAnimControl::maxTime().as(MTime::kSeconds));

ofs << "\t" << "StartTime " << (float)startTime << std::endl;
ofs << "\t" << "EndTime " << (float)endTime << std::endl;
ofs << "\t" << "NumFrames " << (endFrame-startFrame+1) << std::endl;
ofs << "\t" << "NumBlendShapes " << blendShapes.m_NumBlendShapes << std::endl;

anim->startTime = (float)startTime;
anim->endTime = (float)endTime;
anim->numFrames = (endFrame-startFrame+1);
anim->numBlendAnims = blendShapes.m_NumBlendShapes;

if ( anim->numBlendAnims > 0 )
blendShapes.outputBlendShapeAnims(ofs, startFrame, endFrame, anim);

skel.writeJointAnimation( ofs, startFrame, endFrame );

}
36 changes: 36 additions & 0 deletions Exporter/Animation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Maya Character Exporter
Copyright (c) 2009 Jun Murakawa

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/

#pragma once

#include <string>
#include <vector>
#include <fstream>

#include "BlendShapeList.h"
#include "SkeletonWriter.h"

#include "../SharedStructures.h"

class Animation
{
public:
Animation(void);
~Animation(void);

};

void OutputAnimation(std::ostream &ofs, BlendShapeList &blendShapes, SAnimation* anim, SkeletonWriter& skel);
Loading