Compare commits

...

2 Commits

Author SHA1 Message Date
b4fc8e2890 resolution args 2026-03-14 17:24:21 -04:00
58f79c021c width and height resolution args 2026-03-14 17:22:25 -04:00
2 changed files with 45 additions and 0 deletions

View File

@ -10,6 +10,12 @@ Watch folder for images and flip them
joomer-efsw-bsz-monitoring joomer-efsw-bsz-monitoring
- drag and drop bszs into the current directory (same folder as exe file) - drag and drop bszs into the current directory (same folder as exe file)
- rendered image will be saved in the current directory as well - rendered image will be saved in the current directory as well
joomer-efsw-bsz-monitoring.exe
optional arguments
--watchdir:path
--width: resolution width
--height: resolution height
``` ```
# TODO # TODO

View File

@ -24,6 +24,8 @@ bool STOP = false;
dl::bella_sdk::Engine engine; dl::bella_sdk::Engine engine;
std::string fileToRender = ""; std::string fileToRender = "";
bool pendingRender = false; bool pendingRender = false;
int width = 800;
int height = 600;
//void flip_image_horizontally(unsigned char* data, int width, int height, int channels); //void flip_image_horizontally(unsigned char* data, int width, int height, int channels);
void flip_image_vertically(unsigned char* data, int width, int height, int channels); void flip_image_vertically(unsigned char* data, int width, int height, int channels);
@ -179,7 +181,35 @@ void do_sync_render(std::string fileToRender)
pathNode["name"] = dl::String("render_result"); pathNode["name"] = dl::String("render_result");
pathNode["ext"] = dl::String(".png"); pathNode["ext"] = dl::String(".png");
// Get the global settings node instead of the beautyPass node
dl::bella_sdk::Node settings = engine.scene().settings();
dl::bella_sdk::Node cam = settings["camera"].asNode();
auto inputs = settings.inputs(); // This gets all valid attribute names
for (const auto& input : inputs) {
std::cout << "Valid attribute: " << input.name() << std::endl;
}
if (cam) {
auto inputs = cam.inputs();
for (const auto& input : inputs) {
// This will print every valid attribute name for YOUR camera
std::cout << "Camera Attribute: " << input.name() << std::endl;
}
if (cam) {
std::cout << ">>> Set resolution to " << width <<"x" << height << " on camera : " << cam.name() << std::endl;
float fWidth = static_cast<float>(width);
float fHeight = static_cast<float>(height);
cam["resolution"] = dl::Vec2{ fWidth, fHeight };
}
}
else {
std::cout << ">>> ERROR: No camera found in settings!" << std::endl;
}
dl::bella_sdk::Node bPass = engine.scene().beautyPass(); dl::bella_sdk::Node bPass = engine.scene().beautyPass();
bPass["overridePath"] = pathNode; bPass["overridePath"] = pathNode;
std::cout << ">>> STARTING BELLA ENGINE..." << std::endl; std::cout << ">>> STARTING BELLA ENGINE..." << std::endl;
@ -333,6 +363,8 @@ int DL_main(dl::Args& args) {
std::string path; std::string path;
args.add("wd", "watchdir", "", "mode file watch"); args.add("wd", "watchdir", "", "mode file watch");
args.add("w", "width", "800", "render width");
args.add("h", "height", "600", "render height");
/*if (argc >= 2) { /*if (argc >= 2) {
path = std::string( argv[1] ); path = std::string( argv[1] );
@ -357,6 +389,13 @@ int DL_main(dl::Args& args) {
} }
} }
if (args.have("--width")) {
width = std::stoi(args.value("--width").buf());
}
if (args.have("--height")) {
height = std::stoi(args.value("--height").buf());
}
UpdateListener* ul = new UpdateListener(); UpdateListener* ul = new UpdateListener();
/// create the file watcher object /// create the file watcher object