MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / add_camera_group

Method add_camera_group

src/python/lfs/py_scene.cpp:516–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514 }
515
516 int32_t PyScene::add_camera_group(const std::string& name, const int32_t parent, const size_t camera_count) {
517 std::optional<vis::op::SceneGraphStateSnapshot> history_before;
518 if (auto* const scene_manager = get_scene_manager()) {
519 history_before = vis::op::SceneGraphPatchEntry::captureState(*scene_manager, {name});
520 }
521
522 const int32_t node_id = scene_->addCameraGroup(name, parent, camera_count);
523 if (node_id == core::NULL_NODE) {
524 return core::NULL_NODE;
525 }
526 const auto* const added = scene_->getNodeById(node_id);
527 const std::string added_name = added ? added->name : name;
528
529 if (auto* const scene_manager = get_scene_manager()) {
530 ensure_scene_manager_content_type(*scene_manager, vis::SceneManager::ContentType::Dataset);
531 vis::op::undoHistory().push(std::make_unique<vis::op::SceneGraphPatchEntry>(
532 *scene_manager,
533 "Add Camera Group",
534 std::move(*history_before),
535 vis::op::SceneGraphPatchEntry::captureState(*scene_manager, {added_name})));
536 }
537 return node_id;
538 }
539
540 int32_t PyScene::add_camera(const std::string& name,
541 const int32_t parent,

Callers

nothing calls this directly

Calls 6

get_scene_managerFunction · 0.85
moveFunction · 0.85
addCameraGroupMethod · 0.80
getNodeByIdMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected