Apply patchdata to the patch, reconstructing it.
(patch, patchdata)
| 84 | return patch |
| 85 | |
| 86 | def resetPatch(patch, patchdata): |
| 87 | """Apply patchdata to the patch, reconstructing it.""" |
| 88 | p, pd = patch, patchdata |
| 89 | p.setDims(pd.cols, pd.rows) |
| 90 | p.setShader(pd.shader) |
| 91 | p.setFixedSubdivisions(pd.subdivisionsFixed, pd.subdivs) |
| 92 | for row in range(pd.rows): |
| 93 | for col in range(pd.cols): |
| 94 | p.ctrlAt(row, col).vertex = pd.getVertex(row, col) |
| 95 | p.ctrlAt(row, col).texcoord = pd.getTexcoord(row, col) |
| 96 | p.controlPointsChanged() |
| 97 | |
| 98 | def clonePatch(patch): |
| 99 | """Clone the existing patch so the new one is automatically |
no test coverage detected