This is the GVO from another plugin which works flawless. The only difference is that i didn't use an input object.
def GetVirtualObjects(self, op, hh):
if not op[c4d.ID_BASEOBJECT_GENERATOR_FLAG]: return None
if op[res.GRIDDER_OUTPUT] == 0:
if self.CacheCheck(op, op.GetDocument()) is True:
preReturn = op[res.GRIDDER_CACHE].GetData(1005)
meshCache = op.GetClone()
bc = c4d.BaseContainer()
bc.SetData(1002, self.CacheShader(op, doc))
bc.SetData(1003, self.CacheField(op, doc))
if doc != None:
op[res.GRIDDER_CACHE] = bc
On the other hand: I have no idea how to serialize a polygon object with uvs, vertex maps and phongtag. Also seems HyperFile a little bit over the top to store something temporary. MemoryFileStruct() could work but I need to store the byteseq as well...
GetAndCheckHierarchyClone works but it has the disadvantage of refreshing during viewport changes, so I need to use my own dirtycheck.
I think I am doing something fundamental wrong there