Skip to content

Commit c853cb0

Browse files
committed
fix: macos
1 parent 2f4837f commit c853cb0

8 files changed

Lines changed: 55 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ jobs:
5757

5858
steps:
5959
- name: Checkout
60-
uses: actions/checkout@v4
60+
uses: actions/checkout@v5
6161
with:
6262
# workflow_call: optional ref; push/dispatch: never read inputs (undefined outside workflow_call)
6363
ref: ${{ github.event_name == 'workflow_call' && (inputs.ref != '' && inputs.ref || github.ref) || github.ref }}
6464
submodules: recursive
6565

6666
- name: Cache prebuilt dependencies
6767
id: deps-cache
68-
uses: actions/cache@v4
68+
uses: actions/cache@v5
6969
with:
7070
path: _build_msvc/cmt_deps_prebuilt
7171
key: deps-prebuilt-${{ runner.os }}-${{ hashFiles('dependency/**', 'cmake/mmdtool_plugin_dependencies.cmake') }}
@@ -98,7 +98,7 @@ jobs:
9898
run: cmake --build --preset "${{ matrix.build_preset }}"
9999

100100
- name: Upload plugin output
101-
uses: actions/upload-artifact@v4
101+
uses: actions/upload-artifact@v5
102102
with:
103103
name: build-${{ runner.os }}-${{ matrix.sdk }}
104104
path: _build_msvc/${{ matrix.sdk }}/bin/Release/plugins/mmdtool/

.github/workflows/package.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
shell: bash
3232
steps:
3333
- name: Checkout (resources for installer)
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v5
3535
with:
3636
ref: ${{ github.ref }}
3737
submodules: recursive
3838

3939
- name: Download Windows build artifacts
40-
uses: actions/download-artifact@v4
40+
uses: actions/download-artifact@v5
4141
with:
4242
pattern: build-Windows-*
4343
path: ${{ github.workspace }}/_dl
@@ -83,7 +83,7 @@ jobs:
8383
"${{ github.workspace }}/setup/Common/installer_script.iss"
8484
8585
- name: Upload installer artifact
86-
uses: actions/upload-artifact@v4
86+
uses: actions/upload-artifact@v5
8787
with:
8888
name: windows-installer
8989
path: setup/Common/Output/*.exe
@@ -97,13 +97,13 @@ jobs:
9797
shell: bash
9898
steps:
9999
- name: Checkout (res/)
100-
uses: actions/checkout@v4
100+
uses: actions/checkout@v5
101101
with:
102102
ref: ${{ github.ref }}
103103
submodules: recursive
104104

105105
- name: Download macOS build artifacts
106-
uses: actions/download-artifact@v4
106+
uses: actions/download-artifact@v5
107107
with:
108108
pattern: build-macOS-*
109109
path: ${{ github.workspace }}/_dl
@@ -131,7 +131,7 @@ jobs:
131131
done
132132
133133
- name: Upload macOS zip artifacts
134-
uses: actions/upload-artifact@v4
134+
uses: actions/upload-artifact@v5
135135
with:
136136
name: macos-zips
137137
path: dist/*.zip
@@ -142,13 +142,13 @@ jobs:
142142
runs-on: ubuntu-latest
143143
steps:
144144
- name: Download installer
145-
uses: actions/download-artifact@v4
145+
uses: actions/download-artifact@v5
146146
with:
147147
name: windows-installer
148148
path: ${{ github.workspace }}/assets
149149

150150
- name: Download macOS zips
151-
uses: actions/download-artifact@v4
151+
uses: actions/download-artifact@v5
152152
with:
153153
name: macos-zips
154154
path: ${{ github.workspace }}/assets

sdk_2023/frameworks/core.framework/source/maxon/datatypelib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ class InternedId
183183

184184
MAXON_OPERATOR_INEQUALITY(InternedId);
185185

186-
#ifndef _HAS_CPP20_COMPARISONS
187186
Bool operator ==(const Id& other) const
188187
{
189188
return _id && *_id == other;
190189
}
191190

191+
#ifndef _HAS_CPP20_COMPARISONS
192192
Bool operator !=(const Id& other) const
193193
{
194194
return !this->operator ==(other);

sdk_2023/frameworks/core.framework/source/maxon/interfacebase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,12 @@ template <typename S1, typename S2> inline Bool operator ==(const RefBaseFn<S1>&
610610
constexpr Bool COW = MAXON_IS_COW_KIND(S1::Handler::KIND);
611611
static_assert(COW == MAXON_IS_COW_KIND(S2::Handler::KIND), "Comparison of mixed COW/non-COW reference types.");
612612
using BASE = typename std::conditional<S1_IS_BASE, S1, S2>::type::ReferencedType;
613-
return RefCompare<COW, true>::template IsEqual(reinterpret_cast<const BASE*>(a.GetPointer()), reinterpret_cast<const BASE*>(b.GetPointer()));
613+
return RefCompare<COW, true>::IsEqual(reinterpret_cast<const BASE*>(a.GetPointer()), reinterpret_cast<const BASE*>(b.GetPointer()));
614614
}
615615

616616
template <typename S> inline Bool operator ==(const RefBaseFn<S>& a, std::nullptr_t)
617617
{
618-
return RefCompare<MAXON_IS_COW_KIND(S::Handler::KIND), true>::template IsEqual(a.GetPointer(), static_cast<const typename S::ReferencedType*>(nullptr));
618+
return RefCompare<MAXON_IS_COW_KIND(S::Handler::KIND), true>::IsEqual(a.GetPointer(), static_cast<const typename S::ReferencedType*>(nullptr));
619619
}
620620
#endif
621621

sdk_2024/frameworks/core.framework/source/maxon/datatypelib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ class InternedId
200200

201201
MAXON_OPERATOR_INEQUALITY(InternedId);
202202

203-
#ifndef _HAS_CPP20_COMPARISONS
204203
Bool operator ==(const Id& other) const
205204
{
206205
return _id && *_id == other;
207206
}
208207

208+
#ifndef _HAS_CPP20_COMPARISONS
209209
Bool operator !=(const Id& other) const
210210
{
211211
return !this->operator ==(other);

sdk_2024/frameworks/core.framework/source/maxon/interfacebase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,12 +622,12 @@ template <typename S1, typename S2> inline Bool operator ==(const RefBaseFn<S1>&
622622
constexpr Bool COW = MAXON_IS_COW_KIND(S1::Handler::KIND);
623623
static_assert(COW == MAXON_IS_COW_KIND(S2::Handler::KIND), "Comparison of mixed COW/non-COW reference types.");
624624
using BASE = typename std::conditional<S1_IS_BASE, S1, S2>::type::ReferencedType;
625-
return RefCompare<COW, true>::template IsEqual(reinterpret_cast<const BASE*>(a.GetPointer()), reinterpret_cast<const BASE*>(b.GetPointer()));
625+
return RefCompare<COW, true>::IsEqual(reinterpret_cast<const BASE*>(a.GetPointer()), reinterpret_cast<const BASE*>(b.GetPointer()));
626626
}
627627

628628
template <typename S> inline Bool operator ==(const RefBaseFn<S>& a, std::nullptr_t)
629629
{
630-
return RefCompare<MAXON_IS_COW_KIND(S::Handler::KIND), true>::template IsEqual(a.GetPointer(), static_cast<const typename S::ReferencedType*>(nullptr));
630+
return RefCompare<MAXON_IS_COW_KIND(S::Handler::KIND), true>::IsEqual(a.GetPointer(), static_cast<const typename S::ReferencedType*>(nullptr));
631631
}
632632
#endif
633633

source/module/tools/object/mmd_mesh_manager.cpp

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ Description: MMD mesh root object
2525
#include "module/tools/material/mmd_material.h"
2626
#include "utils/string_util.hpp"
2727

28+
namespace
29+
{
30+
/// Pose morph slider used by MorphUIData comes from tag GetMorphID; CAMorph::SetStrength alone may not
31+
/// persist that parameter, so SyncMorphSlidersFromTags still read the default 1.0.
32+
static void ZeroPoseMorphSlider(CAPoseMorphTag* morph_tag, CAMorph* morph)
33+
{
34+
if (!morph_tag || !morph)
35+
return;
36+
morph->SetStrength(0.);
37+
const Int32 morph_idx = morph_tag->GetMorphIndex(morph);
38+
if (morph_idx >= 0)
39+
{
40+
const DescID slider_id = morph_tag->GetMorphID(morph_idx);
41+
morph_tag->SetParameter(slider_id, GeData(0.0), DESCFLAGS_SET::NONE);
42+
}
43+
}
44+
}
45+
2846
namespace cinema
2947
{
3048
class CAWeightTag;
@@ -784,7 +802,7 @@ Bool MMDMeshManagerObject::LoadPMX(
784802
morph->SetMode(setting.doc, morph_tag, CAMORPH_MODE_FLAGS::ALL | CAMORPH_MODE_FLAGS::COLLAPSE, CAMORPH_MODE::AUTO);
785803
morph_tag->UpdateMorphs();
786804
morph_tag->Message(MSG_UPDATE);
787-
morph->SetStrength(0);
805+
ZeroPoseMorphSlider(morph_tag, morph);
788806
break;
789807
}
790808
case libmmd::PMXMorphType::UV: [[fallthrough]];
@@ -868,7 +886,7 @@ Bool MMDMeshManagerObject::LoadPMX(
868886
morph->SetMode(setting.doc, morph_tag, CAMORPH_MODE_FLAGS::ALL | CAMORPH_MODE_FLAGS::COLLAPSE, CAMORPH_MODE::AUTO);
869887
morph_tag->UpdateMorphs();
870888
morph_tag->Message(MSG_UPDATE);
871-
morph->SetStrength(0);
889+
ZeroPoseMorphSlider(morph_tag, morph);
872890
break;
873891
}
874892
case libmmd::PMXMorphType::Flip:
@@ -1446,6 +1464,11 @@ Bool MMDMeshManagerObject::LoadPMX(
14461464
morph->SetMode(setting.doc, morph_tag, CAMORPH_MODE_FLAGS::ALL | CAMORPH_MODE_FLAGS::COLLAPSE, CAMORPH_MODE::AUTO);
14471465
}
14481466
morph_tag->UpdateMorphs();
1467+
for (Int32 morph_index = 1; morph_index < morph_tag_count; ++morph_index)
1468+
{
1469+
if (CAMorph* morph = morph_tag->GetMorph(morph_index))
1470+
ZeroPoseMorphSlider(morph_tag, morph);
1471+
}
14491472
morph_tag->SetParameter(ConstDescID(DescLevel(ID_CA_POSE_MODE)), ID_CA_POSE_MODE_ANIMATE, DESCFLAGS_SET::NONE);
14501473
}
14511474
}

source/module/tools/object/mmd_model_manager.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,13 @@ Bool MMDModelManagerObject::CopyMorph(MMDModelManagerObject* dst) const
616616
if (!morph.CopyTo(new_morph))
617617
return true;
618618
new_morph->AddMorphUI(*dst, new_morph_index);
619+
if (GeListNode* const dst_node = dst->Get())
620+
{
621+
Float src_strength = 0.0;
622+
if (GeListNode* const src_node = const_cast<MMDModelManagerObject*>(this)->Get())
623+
src_strength = morph.GetStrength(src_node);
624+
new_morph->SetStrength(dst_node, src_strength);
625+
}
619626
}
620627
return true;
621628
}
@@ -3012,8 +3019,13 @@ Int MMDModelManagerObject::AddMorph(const MMDMorphType& morph_type, String morph
30123019
index = -1;
30133020
return index;
30143021
}
3015-
if(is_add_morph_ui)
3022+
if (is_add_morph_ui)
3023+
{
30163024
morph->AddMorphUI(*this, index);
3025+
// Dynamic DTYPE_REAL defaults to 1.0; MMD morph weight is 0 until posed.
3026+
if (GeListNode* const self = Get())
3027+
morph->SetStrength(self, 0.0);
3028+
}
30173029
return index;
30183030
}
30193031

0 commit comments

Comments
 (0)