PopulateCopies: Reference placement propagation

This commit is contained in:
DeepSOIC 2018-08-16 13:20:47 +03:00
parent f4b88d1a2e
commit 62c6b6d7cc

View File

@ -121,12 +121,26 @@ class LatticePopulateCopies(lattice2BaseFeature.LatticeFeature):
outputIsLattice = lattice2BaseFeature.isObjectLattice(screen(obj.Object)) outputIsLattice = lattice2BaseFeature.isObjectLattice(screen(obj.Object))
# Pre-collect base placement list, if base is a lattice. For speed. # Pre-collect base placement list, if base is a lattice. For speed.
if outputIsLattice: if outputIsLattice:
objectPlms = lattice2BaseFeature.getPlacementsList(screen(obj.Object),obj) objectPlms = lattice2BaseFeature.getPlacementsList(screen(obj.Object),obj)
placements = DereferenceArray(obj, obj.PlacementsTo, screen(obj.PlacementsFrom), obj.Referencing) placements = DereferenceArray(obj, obj.PlacementsTo, screen(obj.PlacementsFrom), obj.Referencing)
#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)
# initialize output containers and loop variables # initialize output containers and loop variables
outputShapes = [] #output list of shapes outputShapes = [] #output list of shapes
outputPlms = [] #list of placements outputPlms = [] #list of placements