forked from blender/blender
BLEN-352: Move to use DNA API in engines #12
No reviewers
Labels
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: BogdanNagirniak/blender#12
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "BLEN-352"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose
There is still part of code which use RNA API instead of native DNA API.
Technical steps
Border render doesn't work + renamings
@ -16,32 +16,31 @@ using namespace pxr;
add
using namespace std;
and removestd::
@ -18,3 +18,2 @@
Engine::Engine(BL::RenderEngine &b_engine, const std::string &delegateId)
: b_engine(b_engine)
Engine::Engine(RenderEngine *bl_engine, const std::string &delegateId)
delegateId -> delegate_id
@ -20,3 +18,3 @@
namespace blender::render::hydra {
void FinalEngine::sync(BL::Depsgraph &b_depsgraph, BL::Context &b_context, HdRenderSettingsMap &renderSettings)
void FinalEngine::sync(Depsgraph *depsgraph, bContext *context, HdRenderSettingsMap &renderSettings)
renderSettings -> render_settings
@ -23,2 +20,3 @@
void FinalEngine::sync(Depsgraph *depsgraph, bContext *context, HdRenderSettingsMap &renderSettings)
{
sceneDelegate = std::make_unique<BlenderSceneDelegate>(renderIndex.get(),
scene_delegate = std::make_unique<BlenderSceneDelegate>(render_index.get(),
remove
std::
@ -53,0 +39,4 @@
RenderData &r = scene->r;
GfVec4f border(0, 0, 1, 1);
if (r.mode & R_BORDER) {
Border render doesn't work
Tested again - it works
@ -59,3 +61,3 @@
tasks.push_back(renderTaskDelegate->GetTask());
tasks.push_back(render_task_delegate->GetTask());
chrono::time_point<chrono::steady_clock> timeBegin = chrono::steady_clock::now(), timeCurrent;
timeBegin -> time_begin
timeCurrent -> time_current
@ -60,3 +61,4 @@
tasks.push_back(render_task_delegate->GetTask());
chrono::time_point<chrono::steady_clock> timeBegin = chrono::steady_clock::now(), timeCurrent;
chrono::milliseconds elapsedTime;
elapsedTime -> elapsed_time
@ -64,92 +66,108 @@ void FinalEngine::render(BL::Depsgraph &b_depsgraph)
float percentDone = 0.0;
percentDone -> percent_done
@ -64,92 +66,108 @@ void FinalEngine::render(BL::Depsgraph &b_depsgraph)
float percentDone = 0.0;
map<string, vector<float>> renderImages{
renderImages -> render_images
@ -92,2 +94,2 @@
renderTaskDelegate->GetRendererAovData(HdAovTokens->color, pixels.data());
updateRenderResult(renderImages, layerName, buffer_res[0], buffer_res[1]);
render_task_delegate->GetRendererAovData(HdAovTokens->color, pixels.data());
updateRenderResult(renderImages, layer_name, res[0], res[1]);
updateRenderResult -> update_render_result
@ -12,3 +12,3 @@
namespace blender::render::hydra {
void PreviewEngine::sync(BL::Depsgraph &b_depsgraph, BL::Context &b_context, HdRenderSettingsMap &renderSettings)
void PreviewEngine::sync(Depsgraph *depsgraph, bContext *context, HdRenderSettingsMap &renderSettings)
renderSettings -> render_settings
@ -31,2 +28,3 @@
ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph);
GfCamera gfCamera = CameraData((Object *)b_scene.camera().ptr.data, buffer_res, GfVec4f(0, 0, 1, 1)).gf_camera(GfVec4f(0, 0, 1, 1));
string layerName = view_layer->name;
layerName -> layer_name
@ -61,2 +62,2 @@
renderTaskDelegate->GetRendererAovData(HdAovTokens->color, pixels.data());
updateRenderResult(layerName, buffer_res[0], buffer_res[1], pixels);
render_task_delegate->GetRendererAovData(HdAovTokens->color, pixels.data());
updateRenderResult(layerName, res[0], res[1], pixels);
updateRenderResult -> update_render_result
@ -165,3 +135,2 @@
PyObject *pyengine;
char *engineType, *delegateId;
if (!PyArg_ParseTuple(args, "Oss", &pyengine, &engineType, &delegateId)) {
char *engineType, *render_delegate_id;
engineType -> engine_type
@ -241,3 +240,3 @@
}
void ViewportEngine::sync(BL::Depsgraph &b_depsgraph, BL::Context &b_context, HdRenderSettingsMap &renderSettings)
void ViewportEngine::sync(Depsgraph *depsgraph, bContext *context, HdRenderSettingsMap &renderSettings)
renderSettings -> render_settings
@ -245,2 +244,2 @@
if (!sceneDelegate) {
sceneDelegate = std::make_unique<BlenderSceneDelegate>(renderIndex.get(),
if (!scene_delegate) {
scene_delegate = std::make_unique<BlenderSceneDelegate>(render_index.get(),
remove
std::
@ -261,4 +260,3 @@
};
BL::Scene b_scene = b_depsgraph.scene_eval();
GfCamera gfCamera = viewSettings.gf_camera();
viewSettings -> view_settings
@ -276,3 +273,3 @@
if (getRendererPercentDone() == 0.0f) {
if (renderer_percent_done() == 0.0f) {
timeBegin = chrono::steady_clock::now();
timeBegin -> time_begin
@ -301,2 +297,4 @@
GPU_shader_unbind();
chrono::time_point<chrono::steady_clock> timeCurrent = chrono::steady_clock::now();
timeCurrent -> time_current
@ -301,3 +298,4 @@
GPU_shader_unbind();
chrono::time_point<chrono::steady_clock> timeCurrent = chrono::steady_clock::now();
chrono::milliseconds elapsedTime = chrono::duration_cast<chrono::milliseconds>(timeCurrent - timeBegin);
elapsedTime -> elapsed_time
@ -302,4 +300,4 @@
chrono::time_point<chrono::steady_clock> timeCurrent = chrono::steady_clock::now();
chrono::milliseconds elapsedTime = chrono::duration_cast<chrono::milliseconds>(timeCurrent - timeBegin);
string formattedTime = format_duration(elapsedTime);
formattedTime -> formatted_time
Let we do renamings in separate task, there will be so much changes.