Hi Adrian, that’s ok. I have created a sample script that demonstrates how to handle teeth, eyelashes, eyes etc. using lattice deformer. The archive includes pre-selected control points and a basemesh model.
http://www.russian3dscanner.com/Scripts/WrapLatticeExample.zip
To make it clearer you can run it step-by-step. Select a portion of the code and run it with SHIFT+F5
http://www.russian3dscanner.com/images/Lattice.gif
http://www.russian3dscanner.com/images/InnerParts.jpg
import wrap
scan = wrap.Geom(wrap.demoModelsPath + '/AlexNeutral_3DHumanity.obj',scaleFactor = 100)
scan.wireframe = False
basemesh = wrap.Geom('ManWithDetailsPolygroups.obj',scaleFactor = 10)
# Rigid Alignment
(pointsScan, pointsBasemesh) = wrap.selectPoints(scan,basemesh,wrap.loadPoints('pScan.txt'),wrap.loadPoints('pBasemesh.txt'))
rigidTransformation = wrap.rigidAlignment(basemesh,pointsBasemesh,scan,pointsScan,matchScale = True)
basemesh.transform(rigidTransformation)
basemesh.fitToView()
# Take a subset of good connected manifold head geometry
headPolygons = basemesh.selectPolygonsByPolygroup('Head') + basemesh.selectPolygonsByPolygroup('Sockets')
head, indices = wrap.subset(basemesh,headPolygons)
basemesh.hide()
# Non-rigid registration
(controlPointsScan,controlPointsHead) = wrap.selectPoints(scan,head,wrap.loadPoints('cpScan.txt'),wrap.loadPoints('cpHead.txt'))
freePolygons = wrap.selectPolygons(head,head.selectPolygonsByPolygroup('Sockets'))
initialRadiusMultiplier = 2.0
smoothnessFinal = 0.2
headWrapped = wrap.nonRigidRegistration(head,scan,controlPointsHead,controlPointsScan,freePolygons,minNodes = 50,initialRadiusMultiplier = initialRadiusMultiplier,smoothnessFinal = smoothnessFinal,maxIterations = 20)
head.hide()
# Bring changes of head geometry back to basemesh
wrap.applySubset(basemesh,headWrapped,indices)
headWrapped.hide()
basemesh.show()
# Extract hair, eyelashes, eyes, teeth into subset
otherPolygons = basemesh.selectPolygonsByPolygroup('Other')
other, indices = wrap.subset(basemesh,otherPolygons)
basemesh.hide()
scan.hide()
# Lattice deformer
nNeighbours = 150
otherDeformed = wrap.latticeDeformAdaptive(other,head,headWrapped,nNeighbours)
otherDeformed.color = (128,0,255)
other.hide()
headWrapped.show()
# Bring changes to original geometry
wrap.applySubset(basemesh,otherDeformed,indices)
otherDeformed.hide()
headWrapped.hide()
basemesh.show()