Skip to content

Commit 4b0ef05

Browse files
committed
Fix gcc compile issues, and fix paths for the github action
1 parent a8724da commit 4b0ef05

File tree

5 files changed

+57
-10
lines changed

5 files changed

+57
-10
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Repath Artifacts
6767
run: |
6868
mkdir artifacts/plug-ins
69-
Copy-Item "./build/src/maya/${{env.BUILD_TYPE}}/BlurRelax.mll" -Destination "artifacts/plug-ins"
69+
Copy-Item "./build/${{env.BUILD_TYPE}}/BlurRelax.mll" -Destination "artifacts/plug-ins"
7070
7171
- name: Upload Artifacts
7272
uses: actions/upload-artifact@v3
@@ -119,7 +119,7 @@ jobs:
119119
- name: Repath Artifacts
120120
run: |
121121
mkdir -p artifacts/plug-ins
122-
cp ./build/src/maya/${{env.BUILD_TYPE}}/BlurRelax.bundle artifacts/plug-ins
122+
cp ./build/${{env.BUILD_TYPE}}/BlurRelax.bundle artifacts/plug-ins
123123
124124
- name: Upload Artifacts
125125
uses: actions/upload-artifact@v3
@@ -166,7 +166,7 @@ jobs:
166166
- name: Repath Artifacts
167167
run: |
168168
mkdir -p artifacts/plug-ins
169-
cp ./build/src/maya/BlurRelax.so artifacts/plug-ins
169+
cp ./build/BlurRelax.so artifacts/plug-ins
170170
171171
- name: Upload Artifacts
172172
uses: actions/upload-artifact@v3
@@ -220,7 +220,7 @@ jobs:
220220
run: |
221221
cp ./BlurRelax.mod modules/
222222
mkdir -p modules/BlurRelax/scripts
223-
#cp -r ./scripts modules/BlurRelax/scripts
223+
cp -r ./scripts modules/BlurRelax
224224
zip -r BlurRelax-${{env.RELEASE_VERSION}}.zip modules/
225225
226226
- name: Upload distribution

BlurRelax.mod

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
+ PLATFORM:win64 MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax
2+
plug-ins: windows-2018/plug-ins
3+
4+
+ PLATFORM:linux MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax
5+
plug-ins: linux-2018/plug-ins
6+
7+
+ PLATFORM:mac MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax
8+
plug-ins: mac-2018/plug-ins
9+
10+
+ PLATFORM:win64 MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax
11+
plug-ins: windows-2019/plug-ins
12+
13+
+ PLATFORM:linux MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax
14+
plug-ins: linux-2019/plug-ins
15+
16+
+ PLATFORM:mac MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax
17+
plug-ins: mac-2019/plug-ins
18+
19+
+ PLATFORM:win64 MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax
20+
plug-ins: windows-2020/plug-ins
21+
22+
+ PLATFORM:linux MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax
23+
plug-ins: linux-2020/plug-ins
24+
25+
+ PLATFORM:mac MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax
26+
plug-ins: mac-2020/plug-ins
27+
28+
+ PLATFORM:win64 MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax
29+
plug-ins: windows-2022/plug-ins
30+
31+
+ PLATFORM:linux MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax
32+
plug-ins: linux-2022/plug-ins
33+
34+
+ PLATFORM:mac MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax
35+
plug-ins: mac-2022/plug-ins
36+
37+
+ PLATFORM:win64 MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax
38+
plug-ins: windows-2023/plug-ins
39+
40+
+ PLATFORM:linux MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax
41+
plug-ins: linux-2023/plug-ins
42+
43+
+ PLATFORM:mac MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax
44+
plug-ins: mac-2023/plug-ins

src/fastMayaRelax.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <cstring>
12
#include <maya/MFnMeshData.h>
23
#include <maya/MItMeshEdge.h>
34
#include <maya/MItMeshVertex.h>
@@ -232,7 +233,7 @@ pointArray_t MayaRelaxer::quickRelax(
232233
FLOAT(*baseVerts)[NUM_COMPS];
233234
if (slide) {
234235
baseVerts = new FLOAT[numVertices][NUM_COMPS];
235-
memcpy(&(baseVerts[0][0]), &(verts[0][0]), NUM_COMPS * numVertices * sizeof(FLOAT));
236+
std::memcpy(&(baseVerts[0][0]), &(verts[0][0]), NUM_COMPS * numVertices * sizeof(FLOAT));
236237
}
237238

238239
// Reserve some memory for the next-to-last iteration so we can blend
@@ -264,7 +265,7 @@ pointArray_t MayaRelaxer::quickRelax(
264265
for (size_t r = 0; r < iterI; ++r) {
265266
// Store the next-to-last iteration to interpolate with
266267
if ((r == iterI - 1) && (iterT > 0.0))
267-
memcpy(&(prevVerts[0][0]), &(verts[0][0]), NUM_COMPS * numVertices * sizeof(FLOAT));
268+
std::memcpy(&(prevVerts[0][0]), &(verts[0][0]), NUM_COMPS * numVertices * sizeof(FLOAT));
268269

269270
quickLaplacianSmooth(verts);
270271
if (taubinBias < 1.0)

src/fastMayaRelax.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MayaRelaxer: public Relaxer {
3333
) : Relaxer(borderBehavior, hardEdgeBehavior, groupEdgeBehavior, rawNeighbors, rawHardEdges, rawVertData)
3434
{ }
3535

36-
pointArray_t MayaRelaxer::quickRelax(
36+
pointArray_t quickRelax(
3737
MObject &mesh,
3838
const bool slide,
3939
const bool doReproject,
@@ -53,7 +53,7 @@ class MayaRelaxer: public Relaxer {
5353

5454

5555
MMatrix getMatrixAtPoint(MObject &mesh, MFnMesh &meshFn, MItMeshVertex &vertIt) const;
56-
std::vector<MMatrix> MayaRelaxer::getVertMatrices(MObject &mesh, MFnMesh &meshFn) const;
56+
std::vector<MMatrix> getVertMatrices(MObject &mesh, MFnMesh &meshFn) const;
5757

5858
};
5959

src/fastRelax.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2222
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
SOFTWARE.
2424
*/
25+
#include <cstring>
26+
#include <cmath>
2527
#include <vector>
2628
#include <algorithm>
2729
#include <numeric>
@@ -74,7 +76,7 @@ void Relaxer::edgeProject(
7476
// normalized(prevPoints[n] - basePos)
7577
for (size_t x = 0; x < 3; ++x)
7678
edge[x] = basePoints[n][x] - basePos[x];
77-
FLOAT elen = sqrt(edge[0] * edge[0] + edge[1] * edge[1] + edge[2] * edge[2]);
79+
FLOAT elen = std::sqrt(edge[0] * edge[0] + edge[1] * edge[1] + edge[2] * edge[2]);
7880
for (size_t x = 0; x < 3; ++x)
7981
edge[x] /= elen;
8082

@@ -156,7 +158,7 @@ void Relaxer::quickLaplacianSmooth(
156158
outComp[i] = shiftVal[i] * taubinBias * ((outComp[i] / valence[i]) - verts[i]) + verts[i];
157159
}
158160

159-
memcpy(verts, outComp, nzc*sizeof(FLOAT));
161+
std::memcpy(verts, outComp, nzc*sizeof(FLOAT));
160162
delete outComp;
161163
}
162164

0 commit comments

Comments
 (0)