BaseDocument's BaseContainer
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/05/2004 at 02:52, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.207
Platform: Windows ;
Language(s) : C++ ;---------
Hi there,For my problem the followin situation is given:
I've 2 plug-ins:-
DocumentSettings
which stores additional data in a new BaseContainer of the BaseDocument. This BaseContainer's ID corresponds to one of my unique plugin IDs.
The DocumentSettings plug-in also provides own load and save functionality because messages must be sent after doing that. -
ObjectTree
ObjectTree plug-in is a kind of tree which stores own kind of material types in a tree. Some Data of it will be stored insides the BaseContainer of BaseDocument which I mentioned in DocumentSettings.
This tree must be rebuild after loading a new BaseDocument.
For rebuilding the tree it's necessary that ObjectTree plug-in reads data from the BaseContainer I mentioned in DocumentSettings.
Now the Problem:
DocutmentSettings' Load function does only a LoadFile( ) and while doing that an exception was throwed from anywhere. I can't localize it but I'm sure it comes from LoadFile( ).From my point of view it looks that the BaseDocument's new BaseContainer will be loaded after the materials in ObjectTree which wants to have access to that BaseContainer. If the container isn't existing at this point it crashes, of course. But I'm not sure.
In which sequence the LoadFile restores BaseDocument data? How can I ensure that the new BaseContainer will be present before the materials from ObjectTree are restored?
-
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/05/2004 at 05:56, xxxxxxxx wrote:
Hm, I'm not sure if I understand what's going on. But C4D itself shouldn't throw any exceptions. It doesn't use the C++ exception system, in fact it's off by default in the SDK project. For catching the exception where it originates, though, you should be able to set MSVC to capture exceptions when they are thrown in debug mode.
I don't think the loading order of LoadFile(), or any file operation with C4D scenes, if defined. If possible, perhaps you could defer the tree building until you're sure the basecontainer is there?