Skip to content

Commit

Permalink
Fix gcc compile issues, and fix paths for the github action
Browse files Browse the repository at this point in the history
  • Loading branch information
tbttfox committed Nov 17, 2022
1 parent a8724da commit 4b0ef05
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
44 changes: 44 additions & 0 deletions BlurRelax.mod
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions src/fastMayaRelax.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <cstring>
#include <maya/MFnMeshData.h>
#include <maya/MItMeshEdge.h>
#include <maya/MItMeshVertex.h>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/fastMayaRelax.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -53,7 +53,7 @@ class MayaRelaxer: public Relaxer {


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

};

6 changes: 4 additions & 2 deletions src/fastRelax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <numeric>
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 4b0ef05

Please sign in to comment.