Detect a read from Content Browser

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

On 22/09/2009 at 02:42, xxxxxxxx wrote:

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

---------
Hi,

In my shader's ::Read(GeListNode *, HyperFile *, LONG) method, I'd like to detect that I'm being called in the context of a Content Browser.

I only allow one instance of the shader in the whole C4D session, so I'm displaying a message telling so when the user loads a new scene which also contains my shader.
When the user browses with the Content Browser, the browser parses all the files and will therefore display this message box for all files that contain my shader, which is really annoying to the user.

So, is there a way to detect that?

Thanks!

Best,
Ben

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

On 29/09/2009 at 00:56, xxxxxxxx wrote:

It is not possible to detect a Content browser load. What you can do is to check for MSG_DOCUMENTINFO/MSG_DOCUMENTINFO_TYPE_LOAD messages. If the loaded document contains your shader you can react to it.

cheers,
Matthias

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

On 01/10/2009 at 02:37, xxxxxxxx wrote:

Thanks!

I found another way to do what I wanted, but I'll take a look at what you said.

Right now, I only display the warning message once the scene is really loaded. I know that the scene is really opened by calling the HyperFile::GetDocument() method during the read, to get the document in which the scene will be loaded. If this document is then displayed or whatever, I can display the message. So, for scenes that are just read but never really opened, there is no warning.

Ben