THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/08/2009 at 15:52, xxxxxxxx wrote:
Cinema 4D Version: R10-R11
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
I'm having a bit of a rough time keeping the Texture tags' Materials on objects returned through GetVirtualObjects(). There is way too much code to post an example, so I'll explain as best as possible.
My Generator plugin uses a library of objects which exist in the same document. If I simply clone the library objects and insert them into a Null object which is part of what is returned by GetVirtualObjects(), they retain their Texture tag material links. But then the user gets the joy of hundreds of objects (thousands, millions - literally, I'm doing a multi-threaded generator!) when they make it editable (or as part of the cache for rendering and such). In order to 'organize' that I've been connecting them into one conglomerate polygon object using SendModelingCommand(MCOMMAND_JOIN) with a temporary document containing a Null object under which they are all childed.
Now, this retains the Texture tags (etc.) but the Material links are broken thereafter. Since this conglomerate can be a mix of many different library objects it would be impossible for me to reconnect them without explicit information (which is lost after the connect obviously).
It seems that doing the connect in this temporary document is enough to break the links. Would it be advisable to copy the Materials (temporarily for the connect call) into this document in hopes that the links will remain? Or will the Texturetag<->Material links need to be temporarily stored so as to be reestablished after the connect?