GraphUtil.cpp 582 B

123456789101112131415161718
  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 <AtomToolsFramework/Graph/GraphUtil.h>
  9. namespace AtomToolsFramework
  10. {
  11. AZStd::string GetStringValueFromSlot(GraphModel::ConstSlotPtr slot, const AZStd::string& defaultValue)
  12. {
  13. const auto& value = slot ? slot->GetValue<AZStd::string>() : "";
  14. return !value.empty() ? value : defaultValue;
  15. }
  16. } // namespace AtomToolsFramework