Skip to content

Commit 2093a0a

Browse files
authored
Merge pull request #10 from tbttfox/master
Add a maya menu item, and github actions
2 parents 97c9045 + 4b0ef05 commit 2093a0a

File tree

12 files changed

+860
-157
lines changed

12 files changed

+860
-157
lines changed

.github/workflows/main.yml

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
tags:
7+
- v*
8+
pull_request:
9+
branches: [ master ]
10+
11+
env:
12+
BUILD_TYPE: Release
13+
14+
jobs:
15+
#
16+
# Windows
17+
#
18+
# __
19+
# |\__/ \
20+
# | |
21+
# | __ |
22+
# \__/ \|
23+
#
24+
#
25+
maya-win:
26+
runs-on: windows-2019
27+
28+
strategy:
29+
# Without this, all containers stop if any fail
30+
# That's bad, we want to know whether it's only one
31+
# or if it happens to multiples or all.
32+
fail-fast: false
33+
34+
matrix:
35+
include:
36+
- maya: "2018"
37+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2018/Autodesk_Maya_2018_7_Update_DEVKIT_Windows.zip"
38+
- maya: "2019"
39+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2019/Autodesk_Maya_2019_3_Update_DEVKIT_Windows.zip"
40+
- maya: "2020"
41+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2020/Autodesk_Maya_2020_4_Update_DEVKIT_Windows.zip"
42+
- maya: "2022"
43+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2022/Autodesk_Maya_2022_3_Update_DEVKIT_Windows.zip"
44+
- maya: "2023"
45+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_DEVKIT_Windows.zip"
46+
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v3
50+
with:
51+
submodules: true
52+
53+
- name: Install devkit
54+
run: |
55+
Write-Host "Downloading Devkit: ${{matrix.devkit}}..."
56+
Invoke-WebRequest -Uri ${{matrix.devkit}} -OutFile "$pwd/devkit.zip"
57+
Write-Host "Extracting devkit.zip.."
58+
Expand-Archive -LiteralPath devkit.zip -DestinationPath $pwd
59+
60+
- name: Configure CMake
61+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION="${{matrix.maya}}" -DMAYA_DEVKIT_BASE="$pwd/devkitBase"
62+
63+
- name: Build
64+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
65+
66+
- name: Repath Artifacts
67+
run: |
68+
mkdir artifacts/plug-ins
69+
Copy-Item "./build/${{env.BUILD_TYPE}}/BlurRelax.mll" -Destination "artifacts/plug-ins"
70+
71+
- name: Upload Artifacts
72+
uses: actions/upload-artifact@v3
73+
with:
74+
name: windows-${{matrix.maya}}
75+
path: |
76+
artifacts/plug-ins/BlurRelax.mll
77+
78+
maya-macos:
79+
runs-on: macos-10.15
80+
81+
strategy:
82+
fail-fast: false
83+
84+
matrix:
85+
include:
86+
- maya: "2018"
87+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2018/Autodesk_Maya_2018_7_Update_DEVKIT_Mac.dmg"
88+
- maya: "2019"
89+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2019/Autodesk_Maya_2019_3_Update_DEVKIT_Mac.dmg"
90+
- maya: "2020"
91+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2020/Autodesk_Maya_2020_4_Update_DEVKIT_Mac.dmg"
92+
- maya: "2022"
93+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2022/Autodesk_Maya_2022_3_Update_DEVKIT_Mac.dmg"
94+
- maya: "2023"
95+
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_DEVKIT_Mac.dmg"
96+
97+
steps:
98+
- name: Checkout code
99+
uses: actions/checkout@v3
100+
with:
101+
submodules: true
102+
103+
- name: Install devkit
104+
run: |
105+
curl -o devkit.dmg ${{matrix.devkit}}
106+
7z x devkit.dmg
107+
108+
- uses: maxim-lobanov/setup-xcode@v1
109+
with:
110+
xcode-version: '10.3'
111+
112+
- name: Configure CMake
113+
run: |
114+
cmake -G Xcode -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_BASE="$PWD/devkitBase"
115+
116+
- name: Build
117+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
118+
119+
- name: Repath Artifacts
120+
run: |
121+
mkdir -p artifacts/plug-ins
122+
cp ./build/${{env.BUILD_TYPE}}/BlurRelax.bundle artifacts/plug-ins
123+
124+
- name: Upload Artifacts
125+
uses: actions/upload-artifact@v3
126+
with:
127+
name: mac-${{matrix.maya}}
128+
path: |
129+
artifacts/plug-ins/BlurRelax.bundle
130+
131+
maya-linux:
132+
runs-on: ubuntu-latest
133+
container: scottenglert/maya-build:${{matrix.maya}}
134+
135+
strategy:
136+
fail-fast: false
137+
138+
matrix:
139+
include:
140+
- maya: "2018.7"
141+
year: "2018"
142+
- maya: "2019.3"
143+
year: "2019"
144+
- maya: "2020.4"
145+
year: "2020"
146+
- maya: "2022.3"
147+
year: "2022"
148+
- maya: "2023"
149+
year: "2023"
150+
151+
steps:
152+
- name: Checkout code
153+
uses: actions/checkout@v3
154+
with:
155+
submodules: true
156+
157+
- name: Configure CMake
158+
run: |
159+
mkdir build
160+
cd build
161+
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_BASE="/usr/autodesk/devkitBase" ..
162+
163+
- name: Build
164+
run: cmake --build ./build --config ${{env.BUILD_TYPE}}
165+
166+
- name: Repath Artifacts
167+
run: |
168+
mkdir -p artifacts/plug-ins
169+
cp ./build/BlurRelax.so artifacts/plug-ins
170+
171+
- name: Upload Artifacts
172+
uses: actions/upload-artifact@v3
173+
with:
174+
name: linux-${{matrix.year}}
175+
path: |
176+
artifacts/plug-ins/BlurRelax.so
177+
178+
#
179+
# Shipping
180+
#
181+
# _________
182+
# |\ _ _ _ _\
183+
# | \________\
184+
# | | |
185+
# | | |
186+
# \|________|
187+
#
188+
#
189+
upload_release:
190+
name: Upload release
191+
needs: [maya-win, maya-linux, maya-macos]
192+
runs-on: ubuntu-latest
193+
194+
# Only run on e.g. v0.1.0
195+
if: startsWith(github.ref, 'refs/tags/v')
196+
197+
steps:
198+
- name: Checkout code
199+
uses: actions/checkout@v3
200+
201+
- name: Download artifacts
202+
uses: actions/download-artifact@v3
203+
204+
# Omitting name: means "download all artifacts"
205+
# Destination directory structure:
206+
# ~/modules
207+
# /BlurRelax
208+
# /<os_name>-<maya_major_version>
209+
# /plug-ins
210+
# BlurRelax.mll
211+
# /BlurRelax.mod
212+
213+
with:
214+
path: modules/BlurRelax
215+
216+
- name: Set env
217+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
218+
219+
- name: Create distribution
220+
run: |
221+
cp ./BlurRelax.mod modules/
222+
mkdir -p modules/BlurRelax/scripts
223+
cp -r ./scripts modules/BlurRelax
224+
zip -r BlurRelax-${{env.RELEASE_VERSION}}.zip modules/
225+
226+
- name: Upload distribution
227+
uses: "marvinpinto/action-automatic-releases@latest"
228+
with:
229+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
230+
automatic_release_tag: "latest"
231+
prerelease: false
232+
files: |
233+
BlurRelax-*.zip

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

CMakeLists.txt

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,36 @@
1-
cmake_minimum_required(VERSION 2.6)
1+
cmake_minimum_required(VERSION 3.9)
22

3-
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/modules)
3+
project(
4+
"BlurRelax"
5+
VERSION 1.0
6+
DESCRIPTION "A quick smooth with border conditions"
7+
LANGUAGES CXX
8+
)
49

5-
project(BlurRelax)
6-
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
7-
find_package(Maya REQUIRED)
8-
find_package(OpenGL REQUIRED)
9-
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/../output/Maya${MAYA_VERSION})
10+
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
11+
set(CMAKE_CXX_STANDARD 14)
1012

11-
set(SOURCE_FILES
12-
"src/blurRelaxNode.cpp"
13+
# (defined in FindMaya.cmake, copied here for reference)
14+
# set(MAYA_INSTALL_BASE_PATH "" CACHE STRING
15+
# "Root path containing your maya installations, e.g. /usr/autodesk or /Applications/Autodesk/"
16+
# )
17+
set(MAYA_VERSION 2020 CACHE STRING "Maya version")
18+
19+
set(MAYA_FILES
1320
"src/blurRelaxNode.h"
14-
"src/fastRelax.cpp"
21+
"src/fastMayaRelax.h"
1522
"src/fastRelax.h"
23+
"src/blurRelaxNode.cpp"
1624
"src/fastMayaRelax.cpp"
17-
"src/fastMayaRelax.h"
25+
"src/fastRelax.cpp"
1826
"src/pluginRegister.cpp"
1927
)
2028

21-
include_directories(${MAYA_INCLUDE_DIR})
22-
link_directories(${MAYA_LIBRARY_DIR})
23-
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
24-
target_link_libraries(${PROJECT_NAME} ${MAYA_LIBRARIES} ${OPENGL_LIBRARY})
25-
29+
find_package(Maya REQUIRED)
30+
add_library(${PROJECT_NAME} SHARED ${MAYA_FILES})
31+
target_link_libraries(${PROJECT_NAME} PRIVATE Maya::Maya)
32+
target_include_directories(${PROJECT_NAME}
33+
PRIVATE Maya::Maya
34+
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}"
35+
)
2636
MAYA_PLUGIN(${PROJECT_NAME})
27-
install(TARGETS ${PROJECT_NAME} ${MAYA_TARGET_TYPE} DESTINATION plug-ins)
28-

0 commit comments

Comments
 (0)