Hi,
welcome to Plugin Café.
Do you have any context?
Bye,
Andreas
Hi,
welcome to Plugin Café.
Do you have any context?
Bye,
Andreas
Hello Roger,
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.
Cheers,
Andreas
Hi,
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.
Cheers,
Andreas
I have filed a feature request in our development.
Cheers,
Andreas
Hi Roger,
what type is buffer
and how is it allocated? I'm just wondering, if it may be possible to avoid this additional copy to bufferCopy
.
Cheers,
Andreas
Hello @Polyflow,
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 GetDeformCache()
and GetCache()
. Again also the C++ docs have some more info on this: BaseDocument manual - Cache.
Cheers,
Andreas
Hi,
I unfortunately need to tell you, that your feeling is right. There's only one tooltip you can provide, when registering the "master" command via RegisterCommandPlugin()
.
Cheers,
Andreas
Hi Roger,
that's good news!
Cheers,
Andreas
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.
Hello @Polyflow,
welcome to the Plugin Café
Setting time via SetTime()
basically just sets the time value in the document. But C4D also needs to evaluate the scene at that moment in time. This is done by calling ExecutePasses()
.
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
Cheers,
Andreas