On 18/12/2017 at 11:40, xxxxxxxx wrote:
I have an objectdata plugin.
In GetVirtualObjects() I create a vertex map.
This vertex map is the then used in a Smoothing deformer.
The hierarchy is then:
- Null
Smoothing deformer
objA - vertex deformer.
This works! Smoothing is visible.
I can see that if I insert a clone of this intermediate result.
After that I do a CSTO, but then it seems as if the vertex map is not correctly filled.
No smoothing is visible.
def GetVirtualObjects(self, op, hierarchyhelp) :
doc = op.GetDocument()
if op.GetDown() is None or op.GetDown().GetNext() is None:
return c4d.BaseObject(c4d.Onull)
res = op.GetAndCheckHierarchyClone(hierarchyhelp, op.GetDown(), c4d.HIERARCHYCLONEFLAGS_ASPOLY , True)
if res['dirty'] == False:
return res['clone']
objA = res['clone'].GetDown()
objB = objA.GetNext()
vertexMap = self.Selection2VertexMap(objA) #create and add vertex map. This works.
null2 = c4d.BaseObject(c4d.Onull)
objA.InsertUnder(null2)
smoothingObject = c4d.BaseObject(1024529) #smoothing
smoothingObject[c4d.ID_CA_SMOOTHING_DEFORMER_OBJECT_STRENGTH] = .20
smoothingObject[c4d.ID_CA_SMOOTHING_DEFORMER_OBJECT_ITERATIONS] = 20
smoothingObject[c4d.ID_CA_SMOOTHING_DEFORMER_OBJECT_STIFFNESS] = 1.0
smoothingObject[c4d.ID_CA_SMOOTHING_DEFORMER_OBJECT_STIFF_MAP] = vertexMap
smoothingObject.InsertUnder(null2)
cstoObject = self.CSTO(doc, null2)
doc.InsertObject(null2.GetClone()) #debug: Show intermediate result
return cstoObject