fix data transfer from object to renderer

This commit is contained in:
Neyl
2025-06-24 10:54:52 +02:00
parent 69f637b3ba
commit f67b543331
2 changed files with 7 additions and 8 deletions

View File

@@ -191,7 +191,7 @@ Model3DObjectConfiguration::GetProperties() const {
objectProperties["isCastingShadow"]
.SetValue(isCastingShadow ? "true" : "false")
.SetType("boolean")
.SetLabel(_("Shadow Casting"))
.SetLabel(_("Shadow casting"))
.SetGroup(_("Shadows"));
objectProperties["isReceivingShadow"]
@@ -265,8 +265,8 @@ void Model3DObjectConfiguration::DoSerializeTo(
content.SetAttribute("centerLocation", centerLocation);
content.SetAttribute("keepAspectRatio", keepAspectRatio);
content.SetAttribute("crossfadeDuration", crossfadeDuration);
content.SetAttribute("castShadow", isCastingShadow);
content.SetAttribute("receiveShadow", isReceivingShadow);
content.SetAttribute("isCastingShadow", isCastingShadow);
content.SetAttribute("isReceivingShadow", isReceivingShadow);
auto &animationsElement = content.AddChild("animations");
animationsElement.ConsiderAsArrayOf("animation");

View File

@@ -127,13 +127,12 @@ namespace gdjs {
objectData.content.materialType
);
this._isCastingShadow = objectData.content.isCastingShadow;
this._isReceivingShadow = objectData.content.isReceivingShadow;
this.onModelChanged(objectData);
this._crossfadeDuration = objectData.content.crossfadeDuration || 0;
this._isCastingShadow = objectData.content.isCastingShadow;
this._isReceivingShadow = objectData.content.isReceivingShadow;
// *ALWAYS* call `this.onCreated()` at the very end of your object constructor.
this.onCreated();
}
@@ -377,11 +376,11 @@ namespace gdjs {
return this._renderer.hasAnimationEnded();
}
setCastShadow(value: boolean): void {
setIsCastShadow(value: boolean): void {
this._isCastingShadow = value;
}
setReceiveShadow(value: boolean): void {
setIsReceiveShadow(value: boolean): void {
this._isReceivingShadow = value;
}