void initAttributesManagersBindings()

in src/esp/bindings/AttributesManagersBindings.cpp [246:432]


void initAttributesManagersBindings(py::module& m) {
  // ==== PrimObjTypes enum describing types of primitives supported ====
  py::enum_<metadata::PrimObjTypes>(m, "PrimObjTypes")
      .value("CAPSULE_SOLID", metadata::PrimObjTypes::CAPSULE_SOLID)
      .value("CAPSULE_WF", metadata::PrimObjTypes::CAPSULE_WF)
      .value("CONE_SOLID", metadata::PrimObjTypes::CONE_SOLID)
      .value("CONE_WF", metadata::PrimObjTypes::CONE_WF)
      .value("CUBE_SOLID", metadata::PrimObjTypes::CUBE_SOLID)
      .value("CUBE_WF", metadata::PrimObjTypes::CUBE_WF)
      .value("CYLINDER_SOLID", metadata::PrimObjTypes::CYLINDER_SOLID)
      .value("CYLINDER_WF", metadata::PrimObjTypes::CYLINDER_WF)
      .value("ICOSPHERE_SOLID", metadata::PrimObjTypes::ICOSPHERE_SOLID)
      .value("ICOSPHERE_WF", metadata::PrimObjTypes::ICOSPHERE_WF)
      .value("UVSPHERE_SOLID", metadata::PrimObjTypes::UVSPHERE_SOLID)
      .value("UVSPHERE_WF", metadata::PrimObjTypes::UVSPHERE_WF)
      .value("END_PRIM_OBJ_TYPE", metadata::PrimObjTypes::END_PRIM_OBJ_TYPES);

  // ==== Primitive Asset Attributes Template manager ====
  declareBaseAttributesManager<AbstractPrimitiveAttributes,
                               ManagedObjectAccess::Copy>(m, "Primitive Asset",
                                                          "BaseAsset");
  py::class_<
      AssetAttributesManager,
      AttributesManager<AbstractPrimitiveAttributes, ManagedObjectAccess::Copy>,
      AssetAttributesManager::ptr>(m, "AssetAttributesManager")
      // AssetAttributesMangaer-specific bindings
      // return appropriately cast capsule templates
      .def("get_default_capsule_template",
           &AssetAttributesManager::getDefaultCapsuleTemplate,
           R"(This returns an appropriately cast copy of the default Capsule
             primitive template in the library, either solid or wireframe
             based on is_wireframe.)",
           "is_wireframe"_a)
      .def("get_capsule_template", &AssetAttributesManager::getCapsuleTemplate,
           R"(This returns an appropriately cast copy of the Capsule primitive
             template in the library that is referenced by the passed handle, or
             NULL if none exists.)",
           "handle"_a)
      // return appropriately cast cone templates
      .def("get_default_cone_template",
           &AssetAttributesManager::getDefaultConeTemplate,
           R"(This returns an appropriately cast copy of the default Cone
             primitive template in the library, either solid or wireframe
             based on is_wireframe.)",
           "is_wireframe"_a)
      .def("get_cone_template", &AssetAttributesManager::getConeTemplate,
           R"(This returns an appropriately cast copy of the Cone primitive
             template in the library that is referenced by the passed handle, or
             NULL if none exists.)",
           "handle"_a)
      // return appropriately cast cube templates
      .def("get_default_cube_template",
           &AssetAttributesManager::getDefaultCubeTemplate,
           R"(This returns an appropriately cast copy of the default Cube
             primitive template in the library, either solid or wireframe
             based on is_wireframe.)",
           "is_wireframe"_a)
      .def("get_cube_template", &AssetAttributesManager::getCubeTemplate,
           R"(This returns an appropriately cast copy of the Cube primitive
             template in the library that is referenced by the passed handle, or
             NULL if none exists.)",
           "handle"_a)
      // return appropriately cast cylinder templates
      .def("get_default_cylinder_template",
           &AssetAttributesManager::getDefaultCylinderTemplate,
           R"(This returns an appropriately cast copy of the default Cylinder
             primitive template in the library, either solid or wireframe
             based on is_wireframe.)",
           "is_wireframe"_a)
      .def("get_cylinder_template",
           &AssetAttributesManager::getCylinderTemplate,
           R"(This returns an appropriately cast copy of the Cylinder primitive
             template in the library that is referenced by the passed handle, or
             NULL if none exists.)",
           "handle"_a)
      // return appropriately cast icosphere templates
      .def("get_default_icosphere_template",
           &AssetAttributesManager::getDefaultIcosphereTemplate,
           R"(This returns an appropriately cast copy of the default Icosphere
             primitive template in the library, either solid or wireframe
             based on is_wireframe.)",
           "is_wireframe"_a)
      .def("get_icosphere_template",
           &AssetAttributesManager::getIcosphereTemplate,
           R"(This returns an appropriately cast copy of the Icosphere primitive
             template in the library that is referenced by the passed handle, or
             NULL if none exists.)",
           "handle"_a)
      // return appropriately cast UVSphere templates
      .def("get_default_UVsphere_template",
           &AssetAttributesManager::getDefaultUVSphereTemplate,
           R"(This returns an appropriately cast copy of the default UVSphere
             primitive template in the library, either solid or wireframe
             based on is_wireframe.)",
           "is_wireframe"_a)
      .def("get_UVsphere_template",
           &AssetAttributesManager::getUVSphereTemplate,
           R"(This returns an appropriately cast copy of the UVSphere primitive
             template in the library that is referenced by the passed handle, or
             NULL if none exists.)",
           "handle"_a);

  // ==== Light Layout Attributes Template manager ====
  declareBaseAttributesManager<LightLayoutAttributes,
                               ManagedObjectAccess::Copy>(m, "LightLayout",
                                                          "BaseLightLayout");
  // NOLINTNEXTLINE(bugprone-unused-raii)
  py::class_<
      LightLayoutAttributesManager,
      AttributesManager<LightLayoutAttributes, ManagedObjectAccess::Copy>,
      LightLayoutAttributesManager::ptr>(m, "LightLayoutAttributesManager");
  // ==== Object Attributes Template manager ====
  declareBaseAttributesManager<ObjectAttributes, ManagedObjectAccess::Copy>(
      m, "ObjectAttributes", "BaseObject");
  // NOLINTNEXTLINE(bugprone-unused-raii)
  py::class_<ObjectAttributesManager,
             AttributesManager<ObjectAttributes, ManagedObjectAccess::Copy>,
             ObjectAttributesManager::ptr>(m, "ObjectAttributesManager")

      // ObjectAttributesManager-specific bindings
      .def("load_object_configs",
           &ObjectAttributesManager::loadAllJSONConfigsFromPath,
           R"(DEPRECATED : use "load_configs" instead.
            Build ObjectAttributes templates for all files with ".object_config.json" extension
            that exist in the provided file or directory path. If save_as_defaults
            is true, then these ObjectAttributes templates will be unable to be deleted)",
           "path"_a, "save_as_defaults"_a = false)

      // manage file-based templates access
      .def(
          "get_num_file_templates",
          &ObjectAttributesManager::getNumFileTemplateObjects,
          R"(Returns the number of existing file-based ObjectAttributes templates being managed.)")
      .def(
          "get_file_template_handles",
          static_cast<std::vector<std::string> (ObjectAttributesManager::*)(
              const std::string&, bool, bool) const>(
              &ObjectAttributesManager::getFileTemplateHandlesBySubstring),
          R"(Returns a potentially sorted list of file-based ObjectAttributes template handles
          that either contain or explicitly do not contain the passed search_str, based on the value of
          contains.)",
          "search_str"_a = "", "contains"_a = true, "sorted"_a = true)
      .def(
          "get_random_file_template_handle",
          &ObjectAttributesManager::getRandomFileTemplateHandle,
          R"(Returns the handle for a random file-based template chosen from the
             existing ObjectAttributes templates being managed.)")

      // manage synthesized/primitive asset-based templates access
      .def("get_num_synth_templates",
           &ObjectAttributesManager::getNumSynthTemplateObjects, R"(
             Returns the number of existing synthesized(primitive asset)-based ObjectAttributes
             templates being managed.)")
      .def(
          "get_synth_template_handles",
          static_cast<std::vector<std::string> (ObjectAttributesManager::*)(
              const std::string&, bool, bool) const>(
              &ObjectAttributesManager::getSynthTemplateHandlesBySubstring),
          R"(Returns a potentially sorted list of synthesized(primitive asset)-based ObjectAttributes
            template handles that either contain or explicitly do not contain the passed search_str,
            based on the value of contains.)",
          "search_str"_a = "", "contains"_a = true, "sorted"_a = true)
      .def("get_random_synth_template_handle",
           &ObjectAttributesManager::getRandomSynthTemplateHandle,
           R"(Returns the handle for a random synthesized(primitive asset)-based
          template chosen from the existing ObjectAttributes templates being managed.)");

  // ==== Stage Attributes Template manager ====
  declareBaseAttributesManager<StageAttributes, ManagedObjectAccess::Copy>(
      m, "StageAttributes", "BaseStage");
  // NOLINTNEXTLINE(bugprone-unused-raii)
  py::class_<StageAttributesManager,
             AttributesManager<StageAttributes, ManagedObjectAccess::Copy>,
             StageAttributesManager::ptr>(m, "StageAttributesManager");

  // ==== Physics World/Manager Template manager ====

  declareBaseAttributesManager<PhysicsManagerAttributes,
                               ManagedObjectAccess::Copy>(
      m, "PhysicsAttributes", "BasePhysics");
  // NOLINTNEXTLINE(bugprone-unused-raii)
  py::class_<
      PhysicsAttributesManager,
      AttributesManager<PhysicsManagerAttributes, ManagedObjectAccess::Copy>,
      PhysicsAttributesManager::ptr>(m, "PhysicsAttributesManager");

}  // initAttributesManagersBindings