Page MenuHome

Bake-API: reduce memory footprint when baking more than one object (Fix T41092)
ClosedPublic

Authored by Dalai Felinto (dfelinto) on Sep 1 2014, 10:04 AM.

Diff Detail

Repository
rB Blender

Event Timeline

Dalai Felinto (dfelinto) retitled this revision from to Bake-API: reduce memory footprint when baking more than one object (Fix T41092).Sep 1 2014, 10:04 AM
Dalai Felinto (dfelinto) updated this object.
Dalai Felinto (dfelinto) updated this revision to Diff 2518.

For the records, a final solution via this approach should use R instead of G to store baking_object_id

Sergey Sharybin (sergey) requested changes to this revision.

The biggest thing i don't like about is the usage of Global for such a task. I wouldn't want this G to become worrying about some specific jobs.

source/blender/blenkernel/BKE_global.h
100 ↗(On Diff #2518)

Don't do this. It's not what G is intended to handle.

This revision now requires changes to proceed.Feb 4 2015, 7:26 PM
Dalai Felinto (dfelinto) updated this revision to Diff 3449.
  • Merge remote-tracking branch 'origin/master' into arcpatch-D772

only updating the patch, I may resume working on it soon

Dalai Felinto (dfelinto) updated this revision to Diff 3455.
  • Different approach, no longer using G (using Render though)

@Sergey Sharybin (sergey) how about now?

This revision was automatically updated to reflect the committed changes.

aff, Phabricator and its automatic closing of tasks

Ok, question: is it possible to pass the object_id via python API rather than requesting it from the Cycles side?

Ok, question: is it possible to pass the object_id via python API rather than requesting it from the Cycles side?

I always assumed the object id is not consistent between Blender and Cycles, but I can look at it. I can see how that would be beneficial here.
An option is to have a RE_engine_object_id_get(re, object). Wouldn't that be more safe-proof?

Just an update against latest master, still waiting to hear from @Sergey Sharybin (sergey) (or @Campbell Barton (campbellbarton) perhaps?)

  • Merge remote-tracking branch 'origin/master' into fix-bake-dupli

Tested this patch for the last day,
works fine and reduces memory usage drastically in many cases, thus avoids many crashes with baking.

@Dalai Felinto (dfelinto), i'm still not sure why it's a function of RenderEngine instead and not an argument of bake() function.

  • Passing object_id (id of the lookup table) to the renderer (cycles)

@Sergey Sharybin (sergey) you were right, there was no reason not to pass the id for the renderer.

intern/cycles/blender/blender_session.cpp
514

Is b_engine still needed here?

source/blender/editors/object/object_bake_api.c
686

Is it correct that both hi and lo poly arrays are the same size?

  • From review: b_engine() is no longer necessary
  • Update bake API doc
This revision is now accepted and ready to land.Apr 17 2015, 5:17 PM
This revision was automatically updated to reflect the committed changes.