Skip to content

Commit 310537d

Browse files
authored
Merge pull request #3 from ababak/dev
Add support for Maya 2026
2 parents c3fe2c6 + 63085bb commit 310537d

11 files changed

Lines changed: 190 additions & 109 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ venv*
2525
# Installer logs
2626
pip-log.txt
2727

28+
# NOX
29+
.nox
30+
2831
# Unit test / coverage reports
2932
.coverage
3033
.tox

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Andriy Babak <ababak@gmail.com>
44
#
55
# Build the docker image:
6-
# docker build --rm -t ababak/cgcpp:1.7 .
7-
# docker run --rm -v "$(pwd):c:/source:ro" -r "$(pwd)/out:c:/out" ababak/cgcpp:1.7
8-
# docker run --rm -v "$(pwd -W):c:/source:ro" -v "$(pwd -W)/out:c:/out" ababak/cgcpp:1.7
6+
# docker build --rm -t ababak/cgcpp:1.8 .
7+
# docker run --rm -v "$(pwd):c:/source:ro" -r "$(pwd)/out:c:/out" ababak/cgcpp:1.8
8+
# docker run --rm -v "$(pwd -W):c:/source:ro" -v "$(pwd -W)/out:c:/out" ababak/cgcpp:1.8
99
# See README.md for details
1010

1111
FROM ababak/boost:latest as base

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A universal solution for common needs in C++ in computer graphics software.
88
- Python 3.10, Boost 1.80.0 on Windows
99
- Python 3.11, Boost 1.82.0 on Windows
1010
- Python 3.12, Boost 1.85.0 on Windows
11-
- Autodesk Maya 2023-2025 on Windows *(Python 3.9 and Boost 1.76.0 in Maya 2023, Python 3.10 and Boost 1.80.0 in Maya 2024, Python 3.11 and Boost 1.82.0 in Maya 2025)*
11+
- Autodesk Maya 2023-2025 on Windows *(Python 3.9 and Boost 1.76.0 in Maya 2023, Python 3.10 and Boost 1.80.0 in Maya 2024, Python 3.11 and Boost 1.82.0 in Maya 2025, Python 3.11 and Boost 1.85.0 in Maya 2026)*
1212
- SideFX Houdini 19.5-20.5 on Windows *(Python 3.9 and Boost 1.76.0 in Houdini 19.5, Python 3.10 and Boost 1.80.0 in Houdini 20.0, Python 3.11 and Boost 1.82.0 in Houdini 20.5)*
1313

1414
Support for other platforms and other DCC applications may come later.

build_plugin.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
"""
2+
(c) Andriy Babak 2025
3+
4+
date: 02/04/2025
5+
modified: 02/04/2025 13:19:52
6+
7+
Author: Andriy Babak
8+
e-mail: ababak@gmail.com
9+
------------------------------
10+
description: cgcpp
11+
------------------------------
12+
"""
13+
14+
# /// script
15+
# dependencies = [
16+
# "setuptools",
17+
# "toml",
18+
# ]
19+
# ///
20+
21+
import argparse
22+
import os
23+
import shutil
24+
import subprocess
25+
import sys
26+
from pathlib import Path
27+
28+
import toml
29+
30+
31+
def get_version() -> str:
32+
"""Read package version from the pyproject.toml file."""
33+
with open("pyproject.toml", encoding="utf-8") as fd:
34+
pyproject = toml.load(fd)
35+
return pyproject["project"]["version"]
36+
37+
38+
def get_build_name():
39+
"""Parse the package and retreive the build name."""
40+
name = Path.cwd().name
41+
version = get_version()
42+
build_name = f"{name}-{version}"
43+
return build_name
44+
45+
46+
def process():
47+
"""Run the build step."""
48+
parser = argparse.ArgumentParser()
49+
parser.add_argument(
50+
"-r",
51+
"--rebuild",
52+
help="Rebuild the resources archive",
53+
action="store_true",
54+
)
55+
args = parser.parse_args()
56+
build_plugin(rebuild=args.rebuild)
57+
58+
59+
def build_plugin(rebuild: bool = False) -> Path:
60+
"""Run the build step."""
61+
root_path = Path(__file__).parent
62+
build_path = root_path / "build"
63+
build_name = get_build_name()
64+
archive_name = f"{build_name}.zip"
65+
staging_path = build_path / build_name
66+
plugin_zip_path = build_path / archive_name
67+
if plugin_zip_path.is_file() and not rebuild:
68+
print(f"Archive already exists: {plugin_zip_path}")
69+
return plugin_zip_path
70+
71+
# Clean staging path
72+
print(f'Preparing to stage: "{build_name}"')
73+
shutil.rmtree(staging_path, ignore_errors=True)
74+
print(f'Building: "{build_name}"')
75+
subprocess.check_call(
76+
[sys.executable, "-m", "pip", "install", ".", "--target", staging_path]
77+
)
78+
# Generate plugin zip
79+
print(f'Archiving: "{build_name}"')
80+
plugin_zip_path = Path(
81+
shutil.make_archive(
82+
base_name=os.path.join(build_path, build_name),
83+
format="zip",
84+
root_dir=staging_path,
85+
)
86+
)
87+
print(f'Archive created: "{plugin_zip_path}"')
88+
return plugin_zip_path
89+
90+
91+
if __name__ == "__main__":
92+
raise SystemExit(process())

cmake/build_functions.cmake

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,26 @@
1313
function(build_maya_module MAYA_VERSION PROJECT_BUILD_TYPE)
1414
find_package (Maya REQUIRED)
1515
set (CMAKE_BUILD_TYPE "${PROJECT_BUILD_TYPE}" CACHE INTERNAL "" FORCE)
16-
if (MAYA_VERSION VERSION_LESS 2024)
16+
if (MAYA_VERSION VERSION_EQUAL 2023)
1717
set(PYTHON_REQUESTED_VERSION 3.9)
1818
set(Python_ROOT_DIR "C:/Python39")
1919
set(BOOST_REQUESTED_VERSION 1.76.0)
2020
set(BOOST_ROOT "C:/local/boost_1_76_0")
21-
elseif (MAYA_VERSION VERSION_LESS 2025)
21+
elseif (MAYA_VERSION VERSION_EQUAL 2024)
2222
set(PYTHON_REQUESTED_VERSION 3.10)
2323
set(Python_ROOT_DIR "C:/Python310")
2424
set(BOOST_REQUESTED_VERSION 1.80.0)
2525
set(BOOST_ROOT "C:/local/boost_1_80_0")
26-
elseif (MAYA_VERSION VERSION_LESS 2026)
26+
elseif (MAYA_VERSION VERSION_EQUAL 2025)
2727
set(PYTHON_REQUESTED_VERSION 3.11)
2828
set(Python_ROOT_DIR "C:/Python311")
2929
set(BOOST_REQUESTED_VERSION 1.82.0)
3030
set(BOOST_ROOT "C:/local/boost_1_82_0")
31+
elseif (MAYA_VERSION VERSION_EQUAL 2026)
32+
set(PYTHON_REQUESTED_VERSION 3.11)
33+
set(Python_ROOT_DIR "C:/Python311")
34+
set(BOOST_REQUESTED_VERSION 1.85.0)
35+
set(BOOST_ROOT "C:/local/boost_1_85_0")
3136
else ()
3237
message( FATAL_ERROR "Unsupported Maya version: ${MAYA_VERSION}" )
3338
endif ()
@@ -74,16 +79,21 @@ function(build_houdini_module HOUDINI_VERSION PROJECT_BUILD_TYPE)
7479
# specifying this path.
7580
list(APPEND CMAKE_PREFIX_PATH "${HFS}/toolkit/cmake")
7681
find_package (Houdini REQUIRED)
77-
if (Houdini_VERSION VERSION_LESS 20.0)
82+
if (Houdini_VERSION VERSION_EQUAL 19.5)
7883
set(PYTHON_REQUESTED_VERSION 3.9)
7984
set(Python_ROOT_DIR "C:/Python39")
8085
set(BOOST_REQUESTED_VERSION 1.76.0)
8186
set(BOOST_ROOT "C:/local/boost_1_76_0")
82-
elseif (Houdini_VERSION VERSION_LESS 20.5)
87+
elseif (Houdini_VERSION VERSION_EQUAL 20.0)
8388
set(PYTHON_REQUESTED_VERSION 3.10)
8489
set(Python_ROOT_DIR "C:/Python310")
8590
set(BOOST_REQUESTED_VERSION 1.80.0)
8691
set(BOOST_ROOT "C:/local/boost_1_80_0")
92+
elseif (Houdini_VERSION VERSION_EQUAL 20.5)
93+
set(PYTHON_REQUESTED_VERSION 3.11)
94+
set(Python_ROOT_DIR "C:/Python311")
95+
set(BOOST_REQUESTED_VERSION 1.82.0)
96+
set(BOOST_ROOT "C:/local/boost_1_82_0")
8797
else ()
8898
message( FATAL_ERROR "Unsupported Houdini version: ${HOUDINI_VERSION}" )
8999
endif ()

noxfile.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
(c) Andriy Babak 2025
3+
4+
date: 02/04/2025
5+
modified: 02/04/2025 13:14:21
6+
7+
Author: Andriy Babak
8+
e-mail: ababak@gmail.com
9+
------------------------------
10+
description: cgcpp
11+
------------------------------
12+
"""
13+
14+
import nox
15+
16+
17+
@nox.session(default=False)
18+
def tests(session):
19+
session.install("pytest")
20+
session.run("pytest")
21+
22+
23+
@nox.session
24+
def build_plugin(session):
25+
session.install_and_run_script("build_plugin.py", *session.posargs)

package.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[project]
2+
dependencies = []
3+
name = "cgcpp"
4+
version = "1.8.0"
5+
description = "CG C++ Support module"
6+
authors = [{ name = "Andriy Babak", email = "ababak@gmail.com" }]
7+
license = "Apache-2.0"
8+
readme = { file = "README.md", content-type = "text/markdown" }
9+
10+
[project.urls]
11+
Homepage = "https://github.com/ababak/cgcpp"
12+
Repository = "https://github.com/ababak/cgcpp.git"
13+
14+
[build-system]
15+
requires = ["setuptools", "toml"]
16+
build-backend = "setuptools.build_meta"
17+
18+
[tool.setuptools.packages.find]
19+
where = ["source/"]

0 commit comments

Comments
 (0)