Skip to content

Commit 796c083

Browse files
committed
Fixed get vertex count bug in max
1 parent f3d783c commit 796c083

29 files changed

+315
-155
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,7 @@ MigrationBackup/
438438

439439
# End of https://www.toptal.com/developers/gitignore/api/c++,visualstudio,visualstudiocode,sublimetext
440440

441-
PyProjects/.3rdparty/
442-
PyProjects/.venvs/
441+
.dev/
443442
build/
444443
pypi/
445444
temp.cpp
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"folders":
3+
[
4+
{
5+
"path": "../src",
6+
}
7+
],
8+
"settings": {
9+
"lsp_code_actions_on_save": {
10+
"source.fixAll": false,
11+
"source.organizeImports": true,
12+
},
13+
},
14+
"debugger_configurations":
15+
[
16+
],
17+
}

pyproject.toml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
[tool.ruff]
2+
# Exclude a variety of commonly ignored directories.
3+
exclude = [
4+
".bzr",
5+
".direnv",
6+
".eggs",
7+
".git",
8+
".git-rewrite",
9+
".hg",
10+
".ipynb_checkpoints",
11+
".mypy_cache",
12+
".nox",
13+
".pants.d",
14+
".pyenv",
15+
".pytest_cache",
16+
".pytype",
17+
".ruff_cache",
18+
".svn",
19+
".tox",
20+
".venv",
21+
".vscode",
22+
"__pypackages__",
23+
"_build",
24+
"buck-out",
25+
"build",
26+
"dist",
27+
"node_modules",
28+
"site-packages",
29+
"venv",
30+
"vendor",
31+
"generated",
32+
]
33+
34+
# Same as Black.
35+
line-length = 100
36+
indent-width = 4
37+
38+
target-version = "py39"
39+
40+
[tool.ruff.lint]
41+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
42+
select = ["E4", "E7", "E9", "F", "W", "I"]
43+
ignore = ["F811"]
44+
45+
# Allow fix for all enabled rules (when `--fix`) is provided.
46+
fixable = ["ALL"]
47+
unfixable = []
48+
49+
# Allow unused variables when underscore-prefixed.
50+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
51+
52+
[tool.ruff.lint.isort]
53+
force-single-line = true
54+
force-sort-within-sections = true
55+
required-imports = ["from __future__ import annotations"]
56+
57+
[tool.ruff.lint.pydocstyle]
58+
convention = "google"
59+
60+
[tool.ruff.format]
61+
docstring-code-format = true
62+
63+
# Like Black, use double quotes for strings.
64+
quote-style = "double"
65+
66+
# Like Black, indent with spaces, rather than tabs.
67+
indent-style = "space"
68+
69+
# Like Black, respect magic trailing commas.
70+
skip-magic-trailing-comma = false
71+
72+
# Like Black, automatically detect the appropriate line ending.
73+
line-ending = "auto"

pyrightconfig.json

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

src/.projects/SkinPlusPlus.sublime-project

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

src/cpp/.sln.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Set dependency variables here:
2-
Set-Location "$PSScriptRoot\..\.3rdparty"
2+
$devFolder = Resolve-Path -Path "$PSScriptRoot\..\..\.dev"
3+
Write-Host $devFolder
4+
Set-Location "$devFolder\3rdparty"
35
$Env:THIRD_PARTY_EIGEN = (Resolve-Path -Path "./eigen")
46
$Env:THIRD_PARTY_FMT = (Resolve-Path -Path "./fmt")
57

@@ -15,8 +17,7 @@ foreach ($version in $installedVersions) {
1517
$pythonRootPath = (Get-Item $pythonPath).Directory.FullName
1618
$majorMinor = $version -replace '(\d+\.\d+).*', '$1' -replace '\.', ''
1719
Set-Item "Env:PYTHON_$majorMinor" $pythonRootPath
18-
19-
$pybindPath = Resolve-Path -Path "..\.venvs\py$majorMinor\.venv\Lib\site-packages\pybind11" -ErrorAction SilentlyContinue
20+
$pybindPath = Resolve-Path -Path "$devFolder\venv\$majorMinor\.venv\Lib\site-packages\pybind11"
2021
if ($pybindPath) {
2122
Write-Host "Setting PyBind11 path: $pybindPath"
2223
Set-Item "Env:PYBIND11_$majorMinor" $pybindPath

src/cpp/skin_plus_plus_py/skin_plus_plus_py.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='2024-Release|x64'">
133133
<LinkIncremental>false</LinkIncremental>
134134
<TargetExt>.pyd</TargetExt>
135-
<OutDir>$(SolutionDir)..\..\PYProjects\skin_plus_plus\py\310\</OutDir>
135+
<OutDir>$(SolutionDir)..\skin_plus_plus\py\310\</OutDir>
136136
<IncludePath>$(THIRD_PARTY_EIGEN);$(THIRD_PARTY_FMT)\include;$(ProjectDir)headers;$(PYTHON_310)\include;$(PYBIND11_310)\include;$(IncludePath)</IncludePath>
137137
</PropertyGroup>
138138
<PropertyGroup Label="Vcpkg">
@@ -270,6 +270,7 @@
270270
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
271271
<LanguageStandard>stdcpp17</LanguageStandard>
272272
<LanguageStandard_C>stdc17</LanguageStandard_C>
273+
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
273274
</ClCompile>
274275
<Link>
275276
<SubSystem>Console</SubSystem>

src/cpp/skin_plus_plus_py/skin_plus_plus_py.vcxproj.filters

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
1010
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
1111
</Filter>
12-
<Filter Include="Resource Files">
13-
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14-
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15-
</Filter>
1612
</ItemGroup>
1713
<ItemGroup>
1814
<ClCompile Include="source\skin_plus_plus_py.cpp">

src/cpp/skin_plus_plus_pymaya/skin_plus_plus_pymaya.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <maya/MObject.h>
55

66

7-
87
//bool getMeshPositions(const MDagPath& dagPath, Array<Vector3>* pointArray)
98
//{
109
// nvDebugCheck(pointArray != NULL);
@@ -33,18 +32,6 @@
3332
//}
3433

3534

36-
//MStatus getNodesByName(const MStringArray& nodeNames, MObject& node)
37-
//{
38-
// MSelectionList selectionList;
39-
// MStatus status = MGlobal::getSelectionListByName(nodeNames, selectionList);
40-
// if (status == MS::kSuccess)
41-
// {
42-
// status = selectionList.getDependNode(0, node);
43-
// }
44-
// return status;
45-
//}
46-
47-
4835
bool SkinManagerMaya::initialise(const wchar_t* name, std::optional<VertexIDsMatrix> vertexIDs)
4936
{
5037
MStatus status;
@@ -306,6 +293,10 @@ PySkinData SkinManagerMaya::extractSkinData(const bool safeMode)
306293
{
307294
UINT weightIndex = weightIndexBase + boneIndex;
308295
double influenceWeight = weights[weightIndex];
296+
if (influenceWeight == 0)
297+
{
298+
continue;
299+
}
309300
pySkinData.weights(vertexIndex, influenceIndex) = influenceWeight;
310301
pySkinData.boneIDs(vertexIndex, influenceIndex) = boneIndex;
311302
influenceIndex += 1;

src/cpp/skin_plus_plus_pymaya/skin_plus_plus_pymaya.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
<TargetExt>.pyd</TargetExt>
142142
<IncludePath>$(THIRD_PARTY_EIGEN);$(THIRD_PARTY_FMT)\include;$(ProjectDir);$(ProjectDir)..\skin_plus_plus_py\headers;$(ADSK_MAYA_SDK_2024)\include;$(PYTHON_310)\include;$(PYBIND11_310)\include;$(IncludePath)</IncludePath>
143143
<LibraryPath>$(ADSK_MAYA_SDK_2024)\lib;$(PYTHON_310)\libs;$(LibraryPath)</LibraryPath>
144-
<OutDir>$(SolutionDir)..\..\PYProjects\skin_plus_plus\dccs\maya\2024\</OutDir>
144+
<OutDir>$(SolutionDir)..\skin_plus_plus\dccs\maya\2024\</OutDir>
145145
</PropertyGroup>
146146
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='2023-Debug|x64'">
147147
<LinkIncremental>true</LinkIncremental>
@@ -250,6 +250,7 @@
250250
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
251251
<ConformanceMode>true</ConformanceMode>
252252
<LanguageStandard>stdcpp17</LanguageStandard>
253+
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
253254
</ClCompile>
254255
<Link>
255256
<SubSystem>Console</SubSystem>

0 commit comments

Comments
 (0)