Re: Several rendering engines in the same plugin

by enkonyito » Tue Feb 11, 2020 8:44 pm

I used a unique identifier for the background, the sun and the camera.

Code: Select all

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 [font=courier new]YafarayRenderer[/font] constructor in the [font=courier new]renderImageAt[/font] method of the [font=courier new]PhotoImageGenerator[/font] class.
I did the same for the call to the [font=courier new]SunflowRenderer[/font] 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.