On 12/12/2017 at 11:14, xxxxxxxx wrote:
Hello plugincafe! :)
I'm trying to create object plug that will take its child and perform some manipulations with its clone.
This is how the code looks like:
** _ def GetVirtualObjects(self, op, hh) :**
** _ first = op.GetDown()**
** _ if not first: return_**
** _ dic = op.GetAndCheckHierarchyClone(hh, first, c4d.HIERARCHYCLONEFLAGS_ASPOLY, False)**
** _ if not dic["dirty"] and not op.IsDirty(c4d.DIRTY_DATA) and op.GetCache() :**
** _ return op.GetCache().GetClone()_**
** _ obj = dic["clone"]**
** _ **
** _ #Modeling commands with obj...**
I read in docs that GetAndCheckHierarchyClone will generate new cache if something is changed but it constantly generates new cache even if nothing is changed in object plugin or in its child object.
I want to generate new cache only if plugin object or if its child is changed.
Is it possible to optimize this code or I need to use something else?