removed bella include, hope we can just declare in main.cpp to allow switching between scene and engine, added more functions to misc

This commit is contained in:
Harvey Fong 2025-04-22 21:41:58 -06:00
parent a15e13f348
commit 5f35157cbb
4 changed files with 46 additions and 3 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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;
}
}
}

View File

@ -3,7 +3,7 @@
#include <tuple>
// 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