Fix review comments 2 #31

Merged
Bogdan Nagirniak merged 8 commits from BLEN-397 into hydra-render 2023-04-27 09:05:38 +02:00
2 changed files with 7 additions and 13 deletions
Showing only changes of commit ce7bf9f4c2 - Show all commits

View File

@ -72,17 +72,6 @@ void FinalEngine::render(Depsgraph *depsgraph)
update_render_result(); update_render_result();
} }
pxr::GfVec4f FinalEngine::get_render_border(const Scene *scene)
{
const RenderData &r = scene->r;
float border_w = 1.0, border_h = 1.0;
if (r.mode & R_BORDER) {
border_w = r.border.xmax - r.border.xmin;
border_h = r.border.ymax - r.border.ymin;
}
return pxr::GfVec4f(r.border.xmin, r.border.ymin, border_w, border_h);
}
void FinalEngine::update_render_result() void FinalEngine::update_render_result()
{ {
RenderResult *result = RE_engine_begin_result( RenderResult *result = RE_engine_begin_result(
@ -118,7 +107,13 @@ void FinalEngine::prepare_for_render(Depsgraph *depsgraph)
layer_name_ = view_layer->name; layer_name_ = view_layer->name;
const RenderData &r = scene->r; const RenderData &r = scene->r;
pxr::GfVec4f border = get_render_border(scene); pxr::GfVec4f border(0, 0, 1, 1);
if (r.mode & R_BORDER) {
border.Set(r.border.xmin,
r.border.ymin,
r.border.xmax - r.border.xmin,
r.border.ymax - r.border.ymin);
}
pxr::GfVec2i image_res(r.xsch * r.size / 100, r.ysch * r.size / 100); pxr::GfVec2i image_res(r.xsch * r.size / 100, r.ysch * r.size / 100);
resolution_ = pxr::GfVec2i(int(image_res[0] * border[2]), int(image_res[1] * border[3])); resolution_ = pxr::GfVec2i(int(image_res[0] * border[2]), int(image_res[1] * border[3]));
pxr::GfCamera camera = pxr::GfCamera camera =

View File

@ -17,7 +17,6 @@ class FinalEngine : public Engine {
virtual void render(Depsgraph *b_depsgraph) override; virtual void render(Depsgraph *b_depsgraph) override;
protected: protected:
pxr::GfVec4f get_render_border(const Scene *scene);
void update_render_result(); void update_render_result();
void notify_status(float progress, const std::string &title, const std::string &info); void notify_status(float progress, const std::string &title, const std::string &info);
void prepare_for_render(Depsgraph *depsgraph); void prepare_for_render(Depsgraph *depsgraph);