Know why GetVirtualObjects() is called [SOLVED]

On 28/04/2017 at 04:01, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   18 
Platform:   Windows  ; Mac  ;  
Language(s) :     C++  ;

Hi everyone,

in ObjectData::GetVirtualObjects() I can use the BUILDFLAGS from the passed HierarchyHelp object to find out if the function was called because an internal or external rendering is going on. Nice.

But how can I find out if GetVirtualObjects() is called because the generator is being made editable (either by the user pressing "c" or a modeling command, et cetera)?

Thanks in advance!


On 28/04/2017 at 04:54, xxxxxxxx wrote:

Is there maybe a message being sent to a generator before MCOMMMAND_MAKEEDITABLE ?
Or anything else that tells me I'm being made editable?

I see I'm getting MSG_EDITABLE_END, but that message comes in after  the call to GetVirtualObjects() has already occurred, so it doesn't help at all.

On 02/05/2017 at 09:54, xxxxxxxx wrote:

Hi Frank, thanks for writing us.

Although I confirm that the private message MSG_EDITABLE_END is called after GetVirtualObjects being called, unfortunately there's no similar message sent in advance to the GVO call. 
That said, although it could be only marginally helpful, consider that HierarchyHelp::GetBuildFlags() is still returning BUILDFLAGS_EXTERNALRENDERER when an object is made editable via SendModellingCommand().
Coupling this information with the fact that a rendering has not been invoked could provide you with some (weak) means to get advised of a BaseObject::GetVirtualObjects() being called from a SendModellingCommand().

Best, Riccardo

On 03/05/2017 at 04:36, xxxxxxxx wrote:

Hi Riccardo,

thanks for the reply! Combining it with the result from CheckIsRunning() is the thing I was missing.