From 7d0d5d63a3b438ff68bce32d7b364fb08c591a26 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Thu, 16 Aug 2018 19:47:08 +0300 Subject: [PATCH] PopulateChildren: reference inheritance --- lattice2PopulateChildren.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lattice2PopulateChildren.py b/lattice2PopulateChildren.py index bfc7caa..8463bcd 100644 --- a/lattice2PopulateChildren.py +++ b/lattice2PopulateChildren.py @@ -100,6 +100,20 @@ class LatticePopulateChildren(lattice2BaseFeature.LatticeFeature): numChildren = len(objectPlms) if outputIsLattice else len(objectShapes) copy_method_index = ShapeCopy.getCopyTypeIndex(obj.Copying) + #inherit reference placement from the array being copied + if outputIsLattice: + refplm = None + if obj.Referencing == 'Array\'s reference' or obj.Referencing == 'First item' or obj.Referencing == 'Last item': + #simple cases - we just copy the reference plm from the object + refplm = lattice2BaseFeature.getReferencePlm(obj.Object) + else: + #other cases - apply first transform to reference placement + refplm = lattice2BaseFeature.getReferencePlm(obj.Object) + if refplm is not None and len(placements) > 0: + refplm = placements[0].multiply(refplm) + self.setReferencePlm(obj, refplm) + + # the essence for iPlm in range(len(placements)): if iChild == numChildren: