27int main(
int argc,
char** argv)
29 Console::println(
string(
"copyanimationsetups ") + Version::getVersion());
30 Console::println(Version::getCopyright());
33 Console::println(
"Usage: copyanimationsetups sourcefile targetfile.tm");
36 string sourceFileName = string(argv[1]);
37 string targetFileName = string(argv[2]);
39 Console::println(
"Loading source model: " + sourceFileName);
40 auto srcModel = ModelReader::read(
41 FileSystem::getInstance()->getPathName(sourceFileName),
42 FileSystem::getInstance()->getFileName(sourceFileName)
44 Console::println(
"Loading target model: " + targetFileName);
45 auto targetModel = ModelReader::read(
46 FileSystem::getInstance()->getPathName(targetFileName),
47 FileSystem::getInstance()->getFileName(targetFileName)
49 Console::println(
"Clearing target animation setups");
50 targetModel->getAnimationSetups().clear();
51 for (
auto& animationSetupIt: srcModel->getAnimationSetups()) {
52 auto srcAnimationSetup = animationSetupIt.second;
53 Console::println(
"Adding target animation setup: " + srcAnimationSetup->getId());
54 if (srcAnimationSetup->getOverlayFromNodeId().length() == 0) {
55 targetModel->addAnimationSetup(
56 srcAnimationSetup->getId(),
57 srcAnimationSetup->getStartFrame(),
58 srcAnimationSetup->getEndFrame(),
59 srcAnimationSetup->isLoop(),
60 srcAnimationSetup->getSpeed()
63 targetModel->addOverlayAnimationSetup(
64 srcAnimationSetup->getId(),
65 srcAnimationSetup->getOverlayFromNodeId(),
66 srcAnimationSetup->getStartFrame(),
67 srcAnimationSetup->getEndFrame(),
68 srcAnimationSetup->isLoop(),
69 srcAnimationSetup->getSpeed()
73 Console::println(
"Saving target model: " + targetFileName);
76 FileSystem::getInstance()->getPathName(targetFileName),
77 FileSystem::getInstance()->getFileName(targetFileName)
80 Console::println(
"An error occurred: " +
string(exception.what()));
Application base class, please make sure to allocate application on heap to have correct application ...
Representation of a 3d model.
File system singleton class.
int main(int argc, char **argv)
std::exception Exception
Exception base class.