diff --git a/oom_bella_engine.h b/oom_bella_engine.h index 6d48877..6c73345 100644 --- a/oom_bella_engine.h +++ b/oom_bella_engine.h @@ -9,7 +9,7 @@ namespace oom { // Function declaration /* - * MyEngineObserver Class override + * Generic MyEngineObserver Class override * This class receives callbacks from the Bella rendering engine to track rendering progress. * It implements the EngineObserver interface and provides methods to: * - Handle render start/stop events diff --git a/oom_bella_long.h b/oom_bella_long.h index a12e126..d947d3b 100644 --- a/oom_bella_long.h +++ b/oom_bella_long.h @@ -1,5 +1,4 @@ #pragma once -#include "../bella_scene_sdk/src/bella_sdk/bella_scene.h" // For creating and manipulating 3D scenes in Bella namespace oom { namespace bella { diff --git a/oom_bella_misc.h b/oom_bella_misc.h index b7d4042..269965a 100644 --- a/oom_bella_misc.h +++ b/oom_bella_misc.h @@ -25,7 +25,11 @@ namespace oom { break; } else if (strcmp(msg, "Core node implementations are not linked.") == 0) { break; + } else if (strcmp(msg, "Redefining arg with short form: 'o'") == 0) { + break; } + + DL_PRINT(OOMYELLOW "[WARN] %s" OOMRESET "\n", msg); break; case dl::LogType_Error: @@ -37,5 +41,45 @@ namespace oom { } } + + void zoomToScene(dl::bella_sdk::Engine engine, bool voxel = false) { + dl::Vec3f min, max; + engine.start(); + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + if (voxel) { + engine.instancesBoundingBoxes( min, max, {} ); // Get the bounding boxes of all instances in the scenea + } else { + dl::bella_sdk::Scene belScene = engine.scene(); + dl::ds::UInt64Vector vHashes; + dl::StringVector useTypes = dl::StringVector(); + useTypes.push_back("mesh"); + useTypes.push_back("xform"); + useTypes.push_back("instancer"); + useTypes.push_back("box"); + dl::bella_sdk::PathVector paths = belScene.world().paths(useTypes); + for (const auto& eachPath : paths) { + std::cout << eachPath.path().buf() << std::endl; + std::cout << eachPath.hash() << "\n"<< std::endl; + vHashes.push_back(eachPath.path().hash()); + } + engine.instancesBoundingBoxes( min, max, vHashes ); // Get the bounding boxes of all instances in the scenea + } + std::cout << "min: " << min << std::endl; + std::cout << "max: " << max << std::endl; + dl::Vec3f centerf = ( min + max ) * 0.5f; + float radius = norm(max - min ) * 0.5f; + dl::Vec3d center = dl::Vec3d::make( centerf.x, centerf.y, centerf.z ); + auto cameraPath = engine.scene().cameraPath(); + dl::bella_sdk::zoomExtents( cameraPath, center, radius ); + engine.stop(); + } + + void setOutputImagePath(dl::bella_sdk::Engine engine ) { + auto belScene = engine.scene(); + auto belOutputImagePath = belScene.createNode("outputImagePath","oomOutputImagePath","oomOutputImagePath"); + belOutputImagePath["ext"] = ".png"; + belOutputImagePath["dir"] = "."; + belScene.beautyPass()["overridePath"] = belOutputImagePath; + } } } \ No newline at end of file diff --git a/oom_bella_premade.h b/oom_bella_premade.h index 5236109..50f8db8 100644 --- a/oom_bella_premade.h +++ b/oom_bella_premade.h @@ -3,7 +3,7 @@ #include // Bella SDK includes - external libraries for 3D rendering -#include "../bella_engine_sdk/src/bella_sdk/bella_engine.h" // For creating and manipulating 3D scenes in Bella +//#include "../bella_engine_sdk/src/bella_sdk/bella_engine.h" // For creating and manipulating 3D scenes in Bella #include "../oom/oom_bella_long.h" // This file is very large #include "../oom/oom_misc.h" // This file is very large