From 4b0ef0587ff5dc67b6a68ab71c55c0ebe73987ac Mon Sep 17 00:00:00 2001 From: Tyler Fox Date: Thu, 17 Nov 2022 15:59:36 -0800 Subject: [PATCH] Fix gcc compile issues, and fix paths for the github action --- .github/workflows/main.yml | 8 +++---- BlurRelax.mod | 44 ++++++++++++++++++++++++++++++++++++++ src/fastMayaRelax.cpp | 5 +++-- src/fastMayaRelax.h | 4 ++-- src/fastRelax.cpp | 6 ++++-- 5 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 BlurRelax.mod diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67e697c..1481282 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,7 @@ jobs: - name: Repath Artifacts run: | mkdir artifacts/plug-ins - Copy-Item "./build/src/maya/${{env.BUILD_TYPE}}/BlurRelax.mll" -Destination "artifacts/plug-ins" + Copy-Item "./build/${{env.BUILD_TYPE}}/BlurRelax.mll" -Destination "artifacts/plug-ins" - name: Upload Artifacts uses: actions/upload-artifact@v3 @@ -119,7 +119,7 @@ jobs: - name: Repath Artifacts run: | mkdir -p artifacts/plug-ins - cp ./build/src/maya/${{env.BUILD_TYPE}}/BlurRelax.bundle artifacts/plug-ins + cp ./build/${{env.BUILD_TYPE}}/BlurRelax.bundle artifacts/plug-ins - name: Upload Artifacts uses: actions/upload-artifact@v3 @@ -166,7 +166,7 @@ jobs: - name: Repath Artifacts run: | mkdir -p artifacts/plug-ins - cp ./build/src/maya/BlurRelax.so artifacts/plug-ins + cp ./build/BlurRelax.so artifacts/plug-ins - name: Upload Artifacts uses: actions/upload-artifact@v3 @@ -220,7 +220,7 @@ jobs: run: | cp ./BlurRelax.mod modules/ mkdir -p modules/BlurRelax/scripts - #cp -r ./scripts modules/BlurRelax/scripts + cp -r ./scripts modules/BlurRelax zip -r BlurRelax-${{env.RELEASE_VERSION}}.zip modules/ - name: Upload distribution diff --git a/BlurRelax.mod b/BlurRelax.mod new file mode 100644 index 0000000..58a858c --- /dev/null +++ b/BlurRelax.mod @@ -0,0 +1,44 @@ ++ PLATFORM:win64 MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax +plug-ins: windows-2018/plug-ins + ++ PLATFORM:linux MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax +plug-ins: linux-2018/plug-ins + ++ PLATFORM:mac MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax +plug-ins: mac-2018/plug-ins + ++ PLATFORM:win64 MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax +plug-ins: windows-2019/plug-ins + ++ PLATFORM:linux MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax +plug-ins: linux-2019/plug-ins + ++ PLATFORM:mac MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax +plug-ins: mac-2019/plug-ins + ++ PLATFORM:win64 MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax +plug-ins: windows-2020/plug-ins + ++ PLATFORM:linux MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax +plug-ins: linux-2020/plug-ins + ++ PLATFORM:mac MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax +plug-ins: mac-2020/plug-ins + ++ PLATFORM:win64 MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax +plug-ins: windows-2022/plug-ins + ++ PLATFORM:linux MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax +plug-ins: linux-2022/plug-ins + ++ PLATFORM:mac MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax +plug-ins: mac-2022/plug-ins + ++ PLATFORM:win64 MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax +plug-ins: windows-2023/plug-ins + ++ PLATFORM:linux MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax +plug-ins: linux-2023/plug-ins + ++ PLATFORM:mac MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax +plug-ins: mac-2023/plug-ins diff --git a/src/fastMayaRelax.cpp b/src/fastMayaRelax.cpp index 04d07d8..e5a3963 100644 --- a/src/fastMayaRelax.cpp +++ b/src/fastMayaRelax.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -232,7 +233,7 @@ pointArray_t MayaRelaxer::quickRelax( FLOAT(*baseVerts)[NUM_COMPS]; if (slide) { baseVerts = new FLOAT[numVertices][NUM_COMPS]; - memcpy(&(baseVerts[0][0]), &(verts[0][0]), NUM_COMPS * numVertices * sizeof(FLOAT)); + std::memcpy(&(baseVerts[0][0]), &(verts[0][0]), NUM_COMPS * numVertices * sizeof(FLOAT)); } // Reserve some memory for the next-to-last iteration so we can blend @@ -264,7 +265,7 @@ pointArray_t MayaRelaxer::quickRelax( for (size_t r = 0; r < iterI; ++r) { // Store the next-to-last iteration to interpolate with if ((r == iterI - 1) && (iterT > 0.0)) - memcpy(&(prevVerts[0][0]), &(verts[0][0]), NUM_COMPS * numVertices * sizeof(FLOAT)); + std::memcpy(&(prevVerts[0][0]), &(verts[0][0]), NUM_COMPS * numVertices * sizeof(FLOAT)); quickLaplacianSmooth(verts); if (taubinBias < 1.0) diff --git a/src/fastMayaRelax.h b/src/fastMayaRelax.h index ea5116d..fc5dbe2 100644 --- a/src/fastMayaRelax.h +++ b/src/fastMayaRelax.h @@ -33,7 +33,7 @@ class MayaRelaxer: public Relaxer { ) : Relaxer(borderBehavior, hardEdgeBehavior, groupEdgeBehavior, rawNeighbors, rawHardEdges, rawVertData) { } - pointArray_t MayaRelaxer::quickRelax( + pointArray_t quickRelax( MObject &mesh, const bool slide, const bool doReproject, @@ -53,7 +53,7 @@ class MayaRelaxer: public Relaxer { MMatrix getMatrixAtPoint(MObject &mesh, MFnMesh &meshFn, MItMeshVertex &vertIt) const; - std::vector MayaRelaxer::getVertMatrices(MObject &mesh, MFnMesh &meshFn) const; + std::vector getVertMatrices(MObject &mesh, MFnMesh &meshFn) const; }; diff --git a/src/fastRelax.cpp b/src/fastRelax.cpp index 11e5fec..286a0ec 100644 --- a/src/fastRelax.cpp +++ b/src/fastRelax.cpp @@ -22,6 +22,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include +#include #include #include #include @@ -74,7 +76,7 @@ void Relaxer::edgeProject( // normalized(prevPoints[n] - basePos) for (size_t x = 0; x < 3; ++x) edge[x] = basePoints[n][x] - basePos[x]; - FLOAT elen = sqrt(edge[0] * edge[0] + edge[1] * edge[1] + edge[2] * edge[2]); + FLOAT elen = std::sqrt(edge[0] * edge[0] + edge[1] * edge[1] + edge[2] * edge[2]); for (size_t x = 0; x < 3; ++x) edge[x] /= elen; @@ -156,7 +158,7 @@ void Relaxer::quickLaplacianSmooth( outComp[i] = shiftVal[i] * taubinBias * ((outComp[i] / valence[i]) - verts[i]) + verts[i]; } - memcpy(verts, outComp, nzc*sizeof(FLOAT)); + std::memcpy(verts, outComp, nzc*sizeof(FLOAT)); delete outComp; }