}
public void updateShape(String shapeName, ShapeFeature shapeFeature, boolean update) {
if (!update) {
// Create shape
PShape shape = createShape();
shape.beginShape();
shape.stroke(30);
//shape.fill(255, 0, 0, 4);
shape.fill(color(255, 0, 0), 100);
updateShapeVertices(shape, shapeFeature, false);
shape.endShape();
// Add shape AND add to name list to retrieve later
shapeGroup.addChild(shape);
shapeGroup.addName(shapeName, shape);
}
else {
// Get shape via name list (and not via index)
PShape shape = shapeGroup.getChild(shapeName);
// PShape shape = shapeGroup.getChild(i);
updateShapeVertices(shape, shapeFeature, true);
}
}