Print at Dec 22, 2025, 12:27:50 PM

Posted by enkonyito at Feb 11, 2020, 8:44:12 PM
Re: Several rendering engines in the same plugin
I used a unique identifier for the background, the sun and the camera.
String backgroundName = "background";
String cameraName = "camera";
...
createBackground(backgroundName = UUID.randomUUID().toString(), params);
...
createLight(UUID.randomUUID().toString(), params);
...
createCamera(cameraName = UUID.randomUUID().toString(), params);
...
params.put("camera_name", cameraName);
params.put("background_name", backgroundName);


To be sure they are not created several times in order not to slow down the video rendering, I put the call to the YafarayRenderer constructor in the renderImageAt method of the PhotoImageGenerator class.
I did the same for the call to the SunflowRenderer constructor and I adapted the management of the variable light sources.

These modifications allow to animate the camera and simulate the movements of the sun during the day regardless of the selected rendering engine.
----------------------------------------
EnkoNyito