Skip to content

Commit

Permalink
2024.4 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
maxon-madam committed Apr 11, 2024
1 parent 55bd2ff commit a59ad73
Show file tree
Hide file tree
Showing 25 changed files with 633 additions and 61 deletions.
16 changes: 11 additions & 5 deletions plugins/example.assets/project/projectdefinition.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Platform=Win64;OSX
// The platforms this project is targeting - can be [Win64;OSX;Linux].
Platform=Win64;OSX;Linux

// Type of project - can be [Lib;DLL;App].
Type=DLL

// API dependencies
// The frameworks dependencies of this project as shipped in the frameworks folder of an SDK. You can only include
// header files from frameworks that are listed here.
APIS=\
asset.framework;\
cinema.framework;\
Expand All @@ -13,12 +17,14 @@ graph.framework;\
image.framework;\
neutron.framework;\
nodes.framework;\
nodespace.framework;\
nodespace.framework

// C4D component
// If this is a classic API plugin, enabling some classic API features and disabling automatic style checks.
C4D=true

stylecheck.level=3

// Custom ID
// The ID of the module/plugin which is being compiled. You should use here the "net.mycompany.myplugin" format.
// You cannot use a module ID of the format "net.maxon.myplugin" as this domain is reserved for Maxon and plugins
// ignoring this will not be loaded.
ModuleId=net.maxonexample.assets
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ maxon::Result<maxon::AssetDatabaseStruct> AddOrGetDatabase(const maxon::Url& url
if (GeIsMainThread())
EventAdd();

return std::move(newDatabase);
return newDatabase;
}
//! [add_database]

Expand Down Expand Up @@ -466,7 +466,7 @@ maxon::Result<maxon::AssetDescription> CopyAsset(const maxon::AssetRepositoryRef
maxon::CategoryAssetInterface::SetAssetCategory(assetCopy, categoryId) iferr_return;
}

return std::move(assetCopy);
return assetCopy;
}
//! [copy_asset]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ maxon::Result<maxon::AssetDescription> AddAssetVersion(
ApplicationOutput("Original asset: @", asset);
ApplicationOutput("Added asset version: @", assetVersion);

return std::move(assetVersion);
return assetVersion;
}
//! [add_asset_version]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ MAXON_METHOD maxon::Result<maxon::Asset> DotsPresetAssetTypeImpl::Load(
// Making use of the Init() implementation provided above in DotsPresetAssetImpl to load an
// asset from its asset description and url.
maxon::Asset asset = DotsPresetAssetImpl::CreateInit(assetDescription, url) iferr_return;
return std::move(asset);
return asset;
}

MAXON_METHOD maxon::Bool DotsPresetAssetTypeImpl::LoadPreset(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ maxon::Result<maxon::AssetDescription> InstantiateDotsPresetAsset()
maxon::AssetDescription asset = maxon::AssetCreationInterface::SaveBrowserPreset(
maxon::AssetTypes::DotsPresetAsset(), data, typeName, name, false, false, false) iferr_return;

return std::move(asset);
return asset;
}
//! [instantiate_dots_preset_asset]

Expand Down
15 changes: 11 additions & 4 deletions plugins/example.image/project/projectdefinition.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Platform=Win64;OSX
// The platforms this project is targeting - can be [Win64;OSX;Linux].
Platform=Win64;OSX;Linux

// Type of project - can be [Lib;DLL;App].
Type=DLL

// The frameworks dependencies of this project as shipped in the frameworks folder of an SDK. You can only include
// header files from frameworks that are listed here.
// API dependencies
APIS=\
asset.framework;\
Expand All @@ -13,12 +18,14 @@ graph.framework;\
image.framework;\
neutron.framework;\
nodes.framework;\
nodespace.framework;\
nodespace.framework

// C4D component
// If this is a classic API plugin, enabling some classic API features and disabling automatic style checks.
C4D=true

stylecheck.level=3

// Custom ID
// The ID of the module/plugin which is being compiled. You should use here the "net.mycompany.myplugin" format.
// You cannot use a module ID of the format "net.maxon.myplugin" as this domain is reserved for Maxon and plugins
// ignoring this will not be loaded.
ModuleId=net.maxonexample.image
19 changes: 11 additions & 8 deletions plugins/example.main/project/projectdefinition.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Supported platforms - can be [Win64;OSX]
Platform=Win64;OSX
// The platforms this project is targeting - can be [Win64;OSX;Linux].
Platform=Win64;OSX;Linux

// Type of project - can be [Lib;DLL;App]
// Type of project - can be [Lib;DLL;App].
Type=DLL

// API dependencies
// The frameworks dependencies of this project as shipped in the frameworks folder of an SDK. You can only include
// header files from frameworks that are listed here.
APIS=\
asset.framework;\
cinema.framework;\
Expand All @@ -17,14 +18,16 @@ image.framework; \
math.framework; \
misc.framework; \
mesh_misc.framework; \
python.framework;
python.framework

// C4D component
// If this is a classic API plugin, enabling some classic API features and disabling automatic style checks.
C4D=true

stylecheck.level=3 // must be set after c4d=true
stylecheck.enum-registration=false
stylecheck.enum-class=false

// Custom ID
ModuleId=net.maxonexample.main
// The ID of the module/plugin which is being compiled. You should use here the "net.mycompany.myplugin" format.
// You cannot use a module ID of the format "net.maxon.myplugin" as this domain is reserved for Maxon and plugins
// ignoring this will not be loaded.
ModuleId=net.maxonexample.main
37 changes: 26 additions & 11 deletions plugins/example.main/source/gui/activeobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// be sure to use a unique ID obtained from www.plugincafe.com
#define ID_ACTIVEOBJECT 1000472

#include "c4d.h"
#include "c4d_symbols.h"
#include "main.h"
#include "activeobject.h"
#include "maxon/sortedarray.h"
#include "maxon/utilities/sprintf_safe.h"
#include "maxon/weakrawptr.h"
Expand Down Expand Up @@ -769,16 +767,23 @@ class Function2 : public TreeViewFunctions
switch (lColumn)
{
case 'tree':
if (link && link->GetType() == ID_LISTHEAD)
if (link)
{
bc->InsData(REFRESH_TREE, GeData("Refresh Tree"));
}
else if (link && link->IsInstanceOf(Obase))
{
bc->InsData(SHOW_OBJECT_INFORMATION, GeData("Show object information..."));
bc->InsData(EXTRACT_OBJECT_TO_SCENE, GeData("Extract to scene"));
if (link->GetType() == ID_LISTHEAD)
{
bc->InsData(REFRESH_TREE, GeData("Refresh Tree"));
}
else if (link->IsInstanceOf(Obase))
{
bc->InsData(SHOW_OBJECT_INFORMATION, GeData("Show object information..."));
bc->InsData(EXTRACT_OBJECT_TO_SCENE, GeData("Extract to scene"));
}
else if (link->IsInstanceOf(Tvariable))
{
bc->InsData(SHOW_VARIABLE_TAG_DATA, GeData("Show variable tag dat"));
}
}

if (node->ptr)
{
bc->InsData(COPY_ADDRESS, GeData("Copy Address"));
Expand Down Expand Up @@ -859,6 +864,15 @@ class Function2 : public TreeViewFunctions

break;
}
case SHOW_VARIABLE_TAG_DATA:
{
if (link && link->IsInstanceOf(Tvariable))
{
const VariableTag* tag = static_cast<const VariableTag*>(link);
ShowVariableTagDataDialog(tag);
}
break;
}
}

return true;
Expand All @@ -869,6 +883,7 @@ class Function2 : public TreeViewFunctions
static const Int32 SHOW_OBJECT_INFORMATION = ID_TREEVIEW_FIRST_NEW_ID + 2;
static const Int32 EXTRACT_OBJECT_TO_SCENE = ID_TREEVIEW_FIRST_NEW_ID + 3;
static const Int32 COPY_ADDRESS = ID_TREEVIEW_FIRST_NEW_ID + 4;
static const Int32 SHOW_VARIABLE_TAG_DATA = ID_TREEVIEW_FIRST_NEW_ID + 5;
};

Function2 g_functable;
Expand Down
10 changes: 10 additions & 0 deletions plugins/example.main/source/gui/activeobject.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef ACTIVEOBJECT_H__
#define ACTIVEOBJECT_H__

#include "c4d.h"
#include "c4d_symbols.h"
#include "main.h"

void ShowVariableTagDataDialog(const VariableTag* tag);

#endif // ACTIVEOBJECT_H__
Loading

0 comments on commit a59ad73

Please sign in to comment.