THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/06/2004 at 02:56, xxxxxxxx wrote:
Cinema 4D Version: 8.207
Platform: Windows ;
Language(s) : C++ ;
I dont know if I can use Cinema Class or function libs for what I want to do.
At the moment I have a class which parses a very large file, allocs a big list with the informations in the file, and provides a function to get access to the data. This is used by one of my shaders. The problem is, that for each shader the list has to be initialized, which takes time and memory. It would be good if I could do that initialization only once, and get access to it from my shaders.
Any idea how something like this could be done in cinema?
On 08/06/2004 at 04:19, xxxxxxxx wrote:
Is there one list per C4D session, one list per document or something else? If it's the first then you could just load it in a global variable at the same time as your plugin and access it from all instances. If it's the latter, I'd still try to store the data globally, basically as a cache. I guess the details also depend on if the data ever needs to be reloaded.
On 08/06/2004 at 04:28, xxxxxxxx wrote:
I need one per session, the data has never to be reloaded. I will try to add it as a global variable to my plugin.
Would it also be possible to put that global variable in a function lib, with one function to initialize the list which i directly load after registering the lib, and one function to get access to the data? Maybe I will need the information not only in one plugin...
On 08/06/2004 at 04:33, xxxxxxxx wrote:
Yes, a library would be a possible solution. Please see the library tutorial in the SDK docs. ("Creating a function library")