I have a FILENAME in my res file for the generator that I reference similar to so:
Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTYFLAGS::DATA);
// if the frame changed since last time the object should be dirty
if (_frame != doc->GetTime().GetFrame(doc->GetFps()))
dirty = true;
// if user changed fps since the last time the object should be dirty, and we should recalculate our frame ranges
if (_frame != doc->GetTime().GetFrame(doc->GetFps())) {
dirty = true;
_loader.SetFrameTimes(doc->GetFps());
}
_frame = doc->GetTime().GetFrame(doc->GetFps());
if (!dirty)
return op->GetCache(hh);
else {
// always pass c4d back a null, otherwise the system will keep polling this function and get real annoying
lumiCache = BaseObject::Alloc(Onull);
lumiCache->SetName(op->GetName());
maxon::String file = bc->GetFilename(CACHEFILE).GetString();
if (file.IsPopulated()) {
_loader.GetCacheManager()->Load(file, doc);
BaseObject* node = _loader.GetRoot()
while (node) {
node->InsertUnder(lumiCache);
}
lumiCache->Message(MSG_UPDATE);
return lumiCache;
The objects it inserts could be cameras, lights, meshes, splines, etc.