MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / resetPatch

Function resetPatch

install/scripts/commands/patchsplitter.py:86–96  ·  view source on GitHub ↗

Apply patchdata to the patch, reconstructing it.

(patch, patchdata)

Source from the content-addressed store, hash-verified

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

Callers 2

getSelectedVertsLineFunction · 0.85
executeFunction · 0.85

Calls 7

rangeFunction · 0.85
getTexcoordMethod · 0.80
setDimsMethod · 0.45
setShaderMethod · 0.45
setFixedSubdivisionsMethod · 0.45
getVertexMethod · 0.45
controlPointsChangedMethod · 0.45

Tested by

no test coverage detected