Skip to content

Commit

Permalink
Use main as the default branch and Unzip the qt headers
Browse files Browse the repository at this point in the history
  • Loading branch information
tbttfox committed Oct 4, 2024
1 parent 6e7f3d2 commit 2d4bec2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 15 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: build

on:
push:
branches: [ master ]
branches: [ main ]
tags:
- v*
pull_request:
branches: [ master ]
branches: [ main ]

# matrix:
# maya: [2024]
# os: [macos-latest, ubuntu-latest, windows-latest]
# os: [ubuntu-latest, windows-latest]
# include:
# - maya: 2024
# update: 2
Expand Down Expand Up @@ -38,6 +38,8 @@ jobs:
maya: 2022
- os: macos-latest
maya: 2023
- os: macos-latest
maya: 2025 # No idea how to link to Qt6 on Mac
- os: macos-13
maya: 2024
- os: macos-13
Expand All @@ -56,6 +58,7 @@ jobs:
with:
maya: ${{ matrix.maya }}
update: ${{ matrix.update }}
extract-qt: true

- name: Build
uses: blurstudio/mayaModuleActions/mesonBuild@v1
Expand All @@ -70,7 +73,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ matrix.maya }}-plugin
path: build/*.${{ steps.get-devkit.outputs.plugin-ext }}
path: output_Maya${{ matrix.maya }}/*.${{ steps.get-devkit.outputs.plugin-ext }}
if-no-files-found: error

upload_release:
Expand Down
3 changes: 2 additions & 1 deletion src/brSkinBrush/include/skinBrushTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@
#include <set>
#include <unordered_map>
#include <vector>
#include <format>
#include <string>
#include <sstream>
#include <iomanip>

// Macro for the press/drag/release methods in case there is nothing
// selected or the tool gets applied outside any geometry. If the actual
Expand Down
7 changes: 5 additions & 2 deletions src/brSkinBrush/src/skinBrushContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1648,9 +1648,12 @@ MStatus SkinBrushContext::doDragCommon(MEvent &event) {
if (event.isModifierShift()) precision = 3;

std::string stdMessage = std::string(message.asChar());
std::string theMessage = std::format("{}: {:.{}f}", stdMessage, adjustValue, precision);
std::string headsUpFmt = std::format("headsUpMessage -horizontalOffset {} -verticalOffset {} -time 0.1 \"{}\"", offsetX, offsetY, theMessage);

std::stringstream stream;
stream << std::fixed << std::setprecision(precision) << adjustValue;

std::string theMessage = stdMessage + ": " + stream.str();
std::string headsUpFmt = "headsUpMessage -horizontalOffset "+ std::to_string(offsetX) +" -verticalOffset "+ std::to_string(offsetY) +" -time 0.1 \""+ theMessage +"\"";
MGlobal::executeCommand(MString(headsUpFmt.c_str(), headsUpFmt.length()));

// Also, adjust the slider in the tool settings window if it's
Expand Down
37 changes: 29 additions & 8 deletions subprojects/maya/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ endif

maya_inc_dir = maya_install_path / maya_inc_suffix
message('Searching Maya Include directory:', maya_inc_dir)
maya_inc = include_directories(maya_inc_dir)

maya_inc_folders = [maya_inc_dir]


maya_lib_dir = maya_install_path / maya_lib_suffix
message('Searching Maya lib directory:', maya_lib_dir)
Expand All @@ -75,26 +77,45 @@ maya_libs = [

# Link to maya's qt libs if required
# This doesn't do MOC stuff ... yet
qt_ver = 5
if maya_link_qt
fs = import('fs')

qt_lib_dir = maya_lib_dir
if not fs.is_dir(maya_inc_dir / 'QtCore')
error(
'Could not find Maya QT headers with `maya_link_qt` defined\n',
'You probably need to unzip `include/qt_*-include.zip`\n',
'Checking in folder: ', maya_inc_dir,
)
# Check for the maya 2025+ Qt.zip folder
qt_include_dir = maya_install_path / 'Qt' / 'include'
if fs.is_dir(qt_include_dir)
maya_inc_folders += qt_include_dir
qt_lib_dir = maya_install_path / 'Qt' / 'lib'
qt_ver = 6
if os_name == 'darwin'
error(
'I have no idea how to link to Autodesk\'s Qt6 headers and libs on macOS. If you do, please help'
)
endif
else
error(
'Could not find Maya QT headers with `maya_link_qt` defined\n',
'You probably need to unzip `include/qt_*-include.zip` or `Qt.zip`\n',
'Checking in folders: ', maya_inc_dir, qt_include_dir,
)
endif
endif

maya_qt_lib_names = ['Qt5Core', 'Qt5Gui', 'Qt5Widgets']
maya_qt_lib_names = [f'Qt@qt_ver@Core', f'Qt@qt_ver@Gui', f'Qt@qt_ver@Widgets']

if maya_qt_extra_includes != ''
maya_qt_lib_names += maya_qt_extra_includes.split(';')
endif

foreach lib_name : maya_qt_lib_names
maya_libs += cmplr.find_library(lib_name, dirs : maya_lib_dir)
maya_libs += cmplr.find_library(lib_name, dirs : qt_lib_dir)
endforeach
endif

maya_inc = include_directories(maya_inc_folders)

maya_dep = declare_dependency(
dependencies : maya_libs,
include_directories : maya_inc,
Expand Down

0 comments on commit 2d4bec2

Please sign in to comment.