examples/CommandSequence.cpp dnacalib/DNACalib.h iostream vector const char * const char* usage usage = "Usage: commandsequence.exe <path-to-dna-file-to-edit>\n" main int int main (int argc, char **argv) main int argc char ** argv dnac::CommandSequence::add dna::DefinitionReader::getJointCount dnac::Interpolate sc::Status::isOk dnac::makeConditional dnac::CommandSequence::remove dnac::CommandSequence::run dnac::RenameJointCommand::setName usage //CopyrightEpicGames,Inc.AllRightsReserved. #include"dnacalib/DNACalib.h" #include<iostream> #include<vector> staticconstchar*usage="Usage:commandsequence.exe<path-to-dna-file-to-edit>\n"; intmain(intargc,char**argv){ if(argc<2){ std::cout<<"Provideinputdnafile!"<<std::endl; std::cout<<usage<<std::endl; return-1; } constchar*inputDNA=argv[1]; autoinStream=dnac::makeScoped<dnac::FileStream>(inputDNA, dnac::FileStream::AccessMode::Read, dnac::FileStream::OpenMode::Binary); autoreader=dnac::makeScoped<dnac::BinaryStreamReader>(inStream.get()); reader->read(); if(!dnac::Status::isOk()){ std::cout<<"CouldnotreadinputDNAfile!\n"; return-1; } autodnaReader=dnac::makeScoped<dnac::DNACalibDNAReader>(reader.get()); //Createcommandsequenceinstance dnac::CommandSequencecmdSeq; //Prepareabunchofcommands std::vector<dnac::Vector3>positions; std::vector<float>masks; dnac::SetVertexPositionsCommandsetMeshAPos{2,dnac::ConstArrayView<dnac::Vector3>{positions}, dnac::ConstArrayView<float>{masks}, dnac::VectorOperation::Interpolate}; dnac::RenameJointCommandrenameJointA("clavicle_l","cubicle_l"); dnac::RenameJointCommandrenameJointB(10,"upperarm_corrosiveRoot_l"); //Addcommandstothecommandsequence cmdSeq.add(&setMeshAPos,&renameJointA); cmdSeq.add(&renameJointB); //Executecommandsequence cmdSeq.run(dnaReader.get()); //Reconfigureindividualcommandsthatarealreadyinthecommandsequence renameJointB.setName("FACIAL_L_12IPV_NeckBackB2","FACIAL_L_12IPTV_NickelBackB52"); //Modifycommandsequence(turnanunconditionalcommandintoaconditionalcommand) cmdSeq.remove(&renameJointA); autoguardedRenameJointA= dnac::makeConditional(&renameJointA,[](dnac::RenameJointCommand*command,dnac::DNACalibDNAReader*output){ return(output->getJointCount()>6); }); cmdSeq.add(&guardedRenameJointA); //Executemodifiedcommandsequence cmdSeq.run(dnaReader.get()); return0; }