TrackViewNodeFactories.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "EditorDefs.h"
  9. #include "TrackViewNodeFactories.h"
  10. // CryCommon
  11. #include <CryCommon/Maestro/Types/AnimNodeType.h>
  12. #include <CryCommon/Maestro/Types/AnimParamType.h>
  13. // Editor
  14. #include "TrackViewEventNode.h"
  15. CTrackViewAnimNode* CTrackViewAnimNodeFactory::BuildAnimNode(IAnimSequence* pSequence, IAnimNode* pAnimNode, CTrackViewNode* pParentNode)
  16. {
  17. CTrackViewAnimNode* retNode = nullptr;
  18. if (pAnimNode->GetType() == AnimNodeType::Event)
  19. {
  20. retNode = new CTrackViewEventNode(pSequence, pAnimNode, pParentNode);
  21. }
  22. else
  23. {
  24. retNode = new CTrackViewAnimNode(pSequence, pAnimNode, pParentNode);
  25. }
  26. return retNode;
  27. }
  28. CTrackViewTrack* CTrackViewTrackFactory::BuildTrack(IAnimTrack* pTrack, CTrackViewAnimNode* pTrackAnimNode,
  29. CTrackViewNode* pParentNode, bool bIsSubTrack, unsigned int subTrackIndex)
  30. {
  31. return new CTrackViewTrack(pTrack, pTrackAnimNode, pParentNode, bIsSubTrack, subTrackIndex);
  32. }