If you have not transitioned yet to the R15 naming schemes and still use the __LEGACY_API
preprocessor define we strongly recommend to do this now!
R16 brings a different file structure: the SDK is now located in frameworks folder and the API definitions in the cinema.framework/source subfolder.
The cinema4dsdk examples project can now be found in plugins/examples.
Most notably the resources are in a centralized place. All the description headers that Cinema 4D offer can now be found in frameworks/cinema.framework/source/description.
This allows to move plugins along with the frameworks folder to any location on hard disk. The whole installation was previously necessary to access the description definitions.
It is also not needed anymore to search the directory where a description is defined in the resources for the include
statement.
For instance Cinema 4D's descriptions headers can now be simply included writing:
For plugins nothing has changed but if any of the internal resources is referenced make sure the paths are updated.
New folder frameworks/settings contains .xcconfig files (XCode) and .props files (Visual Studio) base definitions for the different targets and compilers.
Under Visual Studio add the file cinema.framework.includes.props (in frameworks/cinema.framework/project) to a plugin project and this will automatically add the necessary include directories for the API.
It is then no longer needed to manually add all kinds of API include paths to the project settings.
R16 brings minor changes and some additions.
Material
classSnapCore::SetCustomExcludeList()
.See API Changes in R16.021 for the detailed list.
Cinema 4D R16.038 brings some changes.
A new color property has been added to Thinking Particles. See IN_PART_COLOR
and OUT_PART_COLOR
.
TP_MasterSystem
has Color()
and SetColor()
new methods.
To preserve the old behavior PGROUP_USE_COLOR
parameter has been added to Particle Groups.
Also TP_PGroup
class has GetUseColor()
and SetUseColor()
new methods.
ChannelData::GetCurrentCPU()
has been added to support Multiprocessing in Channel Shaders computation with no VolumeData
passed.
This change only affects shaders that store (and preallocate) information per CPU index.
Let say we write a Channel Shader that uses dynamic arrays during its operation. It would be inefficient to allocate and free the arrays every single time ShaderData::Output()
is called.
So in ShaderData::InitRender() we query InitRenderStruct::vd->GetCPUCount()
(or assume 1 if InitRenderStruct::vd
is nullptr) and preallocate those structures. For example:
Note that the _threadArray
must be a PointerArray (and not a BaseArray), otherwise a lot of False Sharing would be given which would dramatically decrease performance.
So given this setup a variety of combinations how calls are made from Cinema 4D can happen:
1.)
ShaderData::InitRender
is passed a VolumeData:
InitRender
resizes the _threadArray
with InitRenderStruct::vd->GetCPUCount()
.ShaderData::Output
is called with a VolumeData:
the correct index is determined with VolumeData::GetCurrentCPU()
.2.)
ShaderData::InitRender
is passed a VolumeData:
InitRender
resizes the _threadArray
with InitRenderStruct::vd->GetCPUCount()
.ShaderData::Output
does not get a VolumeData:
there must either be no access to _threadArray
, or ChannelData::GetCurrentCPU()
needs to be used.ChannelData::GetCurrentCPU()
did not exist. Assuming 0 for the thread index would lead to crashes as Output()
still could be called in parallel from multiple threads.3.)
ShaderData::InitRender
is passed no VolumeData:
InitRender
resizes the _threadArray
with 1.ShaderData::Output
does not get a VolumeData:
Same as 2.) and ChannelData::GetCurrentCPU()
returns 0.GeIsMainThreadAndNoDrawThread() has been added to check if code is run from within the main thread of Cinema 4D and if the main thread is not executing any draw code.
MSG_DOCUMENTINFO_TYPE_RENDER_CLONE
has been renamed to MSG_DOCUMENTINFO_TYPE_SWAP_XREF
and made private.
The message was misused and the new naming makes it clear for what it is used.
The macro __FLOAT_32_BIT
has been renamed to MAXON_TARGET_SINGLEPRECISION
.
Descriptions headers xskyshadervolume.h and xxmbreflection.h have been removed.
Added note to BITMAPBUTTON_TOOLTIP
.
See API Changes in R16.038 for the detailed list.
Cinema 4D R16.050 brings minor changes.
The most important additions in R16.050 are related to Thinking Particles:
The following description headers have been added:
MSG_XREFINIT new message and its related struct XrefInitData.
EXECUTIONPRIORITY_FORCE new flag for the execution pipeline.
CheckEditorVisibility() new function.
See API Changes in R16.050 for the detailed list.