Skip to content

Commit 55bd2ff

Browse files
committed
2024.2 Release
1 parent 6525969 commit 55bd2ff

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

plugins/example.assets/source/dots_preset_asset_impl/dots_preset_asset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ MAXON_METHOD maxon::Bool DotsPresetAssetTypeImpl::LoadPreset(
295295
return true;
296296

297297
// Attempt to instantiate the specific preset type and retrieve the custom data attached to it.
298-
const DotsPresetAssetImpl* impl = DotsPresetAssetImpl::GetOrDefault(preset);
298+
const DotsPresetAssetImpl* impl = DotsPresetAssetImpl::GetOrNull(preset);
299299
if (!impl)
300300
return false;
301301

plugins/example.image/source/examples_color_management.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ maxon::Result<void> GetColorProfilesFromFile(
6565
// To run this example, you must download these files and put them next to this cpp file.
6666

6767
// Construct the URLs for the two ICC profiles next to this cpp file.
68-
const maxon::Url directory = maxon::Url(maxon::String(__FILE__)).GetDirectory();
68+
const maxon::Url directory = maxon::Url(maxon::String(MAXON_FILE)).GetDirectory();
6969
const maxon::Url srgbIccFile = (directory + "sRGB2014.icc"_s) iferr_return;
7070
const maxon::Url xyzIccFile = (directory + "D65_XYZ.icc"_s) iferr_return;
7171

@@ -149,7 +149,7 @@ maxon::Result<void> WriteColorProfileToFile()
149149

150150
// Construct a URL for an ICC file next to this cpp file and write it to disk, written is
151151
// here effectively an sRGB-2.2 ICC profile from the builtin color RGB color space.
152-
const maxon::Url directory = maxon::Url(maxon::String(__FILE__)).GetDirectory();
152+
const maxon::Url directory = maxon::Url(maxon::String(MAXON_FILE)).GetDirectory();
153153
const maxon::Url url = (directory + "myProfile.icc"_s) iferr_return;
154154
profile.WriteProfileToFile(url) iferr_return;
155155

@@ -450,7 +450,7 @@ maxon::Result<void> ConvertTextureWithColorProfile(
450450
// Instantiate a PSD file format output handler and define a storage URL next to this cpp file
451451
// with the file name "texture.psd",
452452
const maxon::MediaOutputUrlRef psdFormat = maxon::ImageSaverClasses::Psd().Create() iferr_return;
453-
const maxon::Url url = (maxon::Url(maxon::String(__FILE__)).GetDirectory() + "texture.psd"_s) iferr_return;
453+
const maxon::Url url = (maxon::Url(maxon::String(MAXON_FILE)).GetDirectory() + "texture.psd"_s) iferr_return;
454454

455455
// To store the ImageRef #image, it must be inserted below a type instance in the ImageInterface
456456
// hierarchy that supports serialization, e.g., ImageTextureInterface.

plugins/example.image/source/examples_ocio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ maxon::Result<void> ConvertOcioColorsArbitrarily(BaseDocument* doc)
175175
}
176176

177177
// Load the "sRGB2014" ICC profile located next to this file.
178-
const maxon::Url directory = maxon::Url(maxon::String(__FILE__)).GetDirectory();
178+
const maxon::Url directory = maxon::Url(maxon::String(MAXON_FILE)).GetDirectory();
179179
const maxon::Url sRgb2014File = (directory + "sRGB2014.icc"_s) iferr_return;
180180
if (sRgb2014File.IoDetect() == maxon::IODETECT::NONEXISTENT)
181181
return maxon::IoError(

plugins/example.migration_2024/source/oboundingbox.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,16 @@ Bool RegisterBoundingBoxObject()
9696
if (!bmp)
9797
return false;
9898

99-
return RegisterObjectPlugin(PID_OBOUNDINGBOX, "BoundingBox"_s, OBJECT_GENERATOR | OBJECT_INPUT,
100-
BoundingBoxObject::Alloc, "oboundingbox"_s, bmp, 0, OBJECTCATEGORY::GENERATOR);
99+
finally
100+
{
101+
// bitmap is copied inside RegisterObjectPlugin
102+
BaseBitmap::Free(bmp);
103+
};
104+
105+
if (!RegisterObjectPlugin(PID_OBOUNDINGBOX, "BoundingBox"_s, OBJECT_GENERATOR | OBJECT_INPUT, BoundingBoxObject::Alloc, "oboundingbox"_s, bmp, 0, OBJECTCATEGORY::GENERATOR))
106+
return false;
107+
108+
return true;
101109
}
102110

103111
NodeData* BoundingBoxObject::Alloc()
@@ -162,7 +170,7 @@ Bool BoundingBoxObject::Init(GeListNode* node, Bool isCloneInit)
162170
{
163171
// We should use C++ style casts instead of C style casts.
164172
BaseObject* obj = static_cast<BaseObject*>(node);
165-
BaseContainer bc = obj->GetDataInstanceRef();
173+
BaseContainer& bc = obj->GetDataInstanceRef();
166174

167175
// In 2024.0 the #isCloneInit argument has been added to throttle initialization overhead for
168176
// cloned scene elements. The data container values will be copied right after this

plugins/example.nodes/source/space/nodematerialimport_impl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ class ExampleNodeMaterialImport : public maxon::Component<ExampleNodeMaterialImp
1515

1616
MAXON_METHOD maxon::Result<void> Import(maxon::nodes::NodesGraphModelRef& graph, const maxon::material::MaterialExchangeData& materialData, BaseDocument& baseDocument);
1717

18+
MAXON_METHOD maxon::Result<void> ImportExtended(maxon::nodes::NodesGraphModelRef& graph, const maxon::material::MaterialExchangeDataExtended& materialData, BaseDocument& baseDocument)
19+
{
20+
return self.Import(graph, reinterpret_cast<const maxon::material::MaterialExchangeData&>(materialData), baseDocument);
21+
}
22+
1823
private:
1924
static BaseList2D* FindSubstanceAsset(BaseDocument& baseDocument, const String& assetName);
2025
};

0 commit comments

Comments
 (0)