CheckCache() problem



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/04/2009 at 17:08, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10 / 11 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Hi,

    in my generator I use op->CheckCache(hh) to make sure, the generator's cache is valid. If so, I just return the cache instead of calculation everything again. So far, so good.

    Now the problem:
    I have my generator in a scene in Cinema. Cache is valid, everything fine (I checked in the debugger). Now I open another scene in Cinema. OK. And now I use the Window menu to get back to the scene with my generator.
    All of a sudden, CheckCache() returns another value. Why?

    Also, the SDK documentation sais, GetCache() should return TRUE if the cache is valid. For me, it always returns FALSE if I have a cache. Only after changing the scene (as described above) it returns TRUE. Why??

    Thanks for any help!

    Greetings,
    Jack



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 19/04/2009 at 04:50, xxxxxxxx wrote:

    Ideas, anybody? Why is the Cache suddenly invalid after changing to another document?

    Cheers,
    Jack



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 19/04/2009 at 08:24, xxxxxxxx wrote:

    Yes, I would expect that the cache is invalid(freed) due to a decision from the memory management. Imagine a scene allocates half of your memory, so if you create a new document (or open a new document) this memory should be freed otherwise your memory would blow up per each document.

    Don't know if there is an option to prevent this deallocation but I wouldn't recommend that at all.


Log in to reply