welcome to Plugin Café.
Do you have any context?
my thought was, if you allocated
buffer properly via
NewMem (or one of its siblings), then you should be able to use it directly. But as Cinema 4D will do an internal copy and destroy the passed buffer, you'd need to do something like this (pseudocode):
SetMemory(buffer) buffer = GetMemory() // to get the pointer to the buffer owned by Cinema // ... and then in the end, if you need to free the memory yourself and can't rely on the memory being destroyed on destruction of the BaseContainer buffer = GetMemoryAndRelease() Free(buffer)
Just thinking and probably you have thought of this option anyway.
go ahead. Either way is ok.
Please note, that we will check from time to time and would remove the links, if there's anything going on, which might not be in sync with current (and especially German jurisdiction). But as you plan to discuss plugins, I see really no issues.
we thought a bit more about your request. Unfortunately I had no time, yet, to do some tests here.
In general we think, my last answer should at least be part of a solution of the problem.
In regards to "polygonizing" or "baking", this should actually be just a matter of correctly retrieving the cache of an object in the executed document. Please take a look at
GetCache(). Again also the C++ docs have some more info on this: BaseDocument manual - Cache.
I'm afraid I need to apologize, my answer was actually by some discussion we had internally and I was too confused to read properly again. Sorry. Maybe @mikeudin's answer can already help. We'll look into this tomorrow again.
welcome to the Plugin Café
DrawViews() can indeed do the same (and more) for you, but in your case it should not be needed,
ExecutePasses() should be fine. See for example this thread for some discussion on this topic: python plugin for every frame
So, in your code, you probably also need to "execute" the temporary document.
There's some more information on this in our C++ SDK manuals. I know, we are talking Python here, but maybe it's interesting anyway: BaseDocument manual - Time