R23 的变化
Cinema 4D R23 Service Pack 1 supports both Intel-based and ARM-based Apple hardware via universal binaries. See 通用二进制 .
见 API Changes in R23.110 for the detailed list.
Cinema 4D R23 is supported on Windows 10 and on macOS 10.15 (recommended) and macOS 10.14 . Developing Cinema 4D R23 requires Visual Studio 2019 and Xcode 11 on the respective operating systems.
Plugins built against previous versions are
not
compatible with Cinema 4D R23 and require a rebuild against the R23 API.
Minor code adoption could also be required to build against R23.
In R23 the source processor could generate more files and it's recommended to include them at the end of the corresponding header file as shown below.
#include "headerFileName1.hxx" #include "headerFileName2.hxx"
R23 API documentation includes a section concerning to the Classic API resources resulting by parsing the files located in {C4D Install Folder}/resource/modules/*.
The new content is located in
Classic Resource overview
.
The section enables browsing the Cinema 4D resources to find a particular ID for a given parameter or possible values for a Cycle parameter.
Scene Nodes is a technology preview of Cinema 4D future.
Due to the scope of the project, an API to directly access the provided functionalities is not yet available.
As a temporary fallback, it's possible to request and create a Classic API representation of the Scene Nodes output adopting the code below:
// Request reference to Neutron objects before scene hook execution is done. scenenodes-> 消息 ( Int32 ( SCENENODES_IDS::MSGUPDATE_LEGACYOBJ_ID ), &scenenodesRoot); if (scenenodesRoot == nullptr ) return maxon::UnexpectedError( MAXON_SOURCE_LOCATION );
// Do anything with the sceneNodeRoot object. It's similar than BaseDocument::GetFirstObject(), but for the Scene Node Root.
For the time being, Scene Nodes Classic API representation only output
PolygonObject
, Null,
LineObject
and
InstanceObject
in Multi-Instances mode.
材质
applied via any
材质
node, will result in the creation of a
TextureTag
. Vertex Map will result in the creating of a
VertexMapTag
.
Dirty bit for these Classic API objects should be reliable. They also have unique hashes:
It's worth to mention the activeobject.cpp example has been adapted to display Scene Nodes Classic API representation (see Project Hooks->Scene Nodes-> "CLASSIC_REPRESENTATION" within the plugin).
The EXECUTIONPRIORITY_SCENENODE has been added and it establishes a priority level higher than EXECUTIONPRIORITY_GENERATOR.
A new maxon::Array template interface has been introduced. This new Array support COW (Copy-On-Write) reference and it allows to wrap any existing array-like implementation ( maxon::BaseArray , maxon::BlockArray ).
Scene Nodes uses this interface to access arrays (some PORT_BUNDLE have been replaced from BaseArray to Array).
However, rest assured the use of
maxon::BaseArray
,
maxon::BlockArray
is supported by Scene Nodes and conversion to the
maxon::Array
is granted using the
maxon::ArrayFactory
.
The maxon::SqMat2, maxon::SqMat3 and maxon::SqMat4 structs have been renamed in maxon::SqrMat2 , maxon::SqrMat3 and maxon::SqrMat4 . This renaming does not affect the class member variables named "sqmat".
The maxon::Limit<>::MAX and maxon::Limit<>::MIN constants have been added for types in which they were missing and maxon::Limit<>::Max() and maxon::Limit<>::Min() have been replaced by the former two for types in which they were existing.
Most of MAXON API elements such as
maxon::MAXON_DATATYPE
or Interface have now a GetHashCode method used to perform efficient comparison.
In R23 the implementation must return a
maxon::HashInt
and while, at the current time, a Uint64 is used, this may change to 128bits in the future without breaking compatibility.
The new DefaultHash class has a Combine function which allows combining HashInt values.
maxon::HashInt GetHashCode() const { maxon::DefaultHash hash; for ( const DescLevel & d : _subids) { hash. Combine ( maxon::DefaultCompare::GetHashCode (d.id)); } return hash;// return maxon::DefaultHash::EMPTY_HASH in case of error. }
This code shall be used instead of
hash = hash * 31 + value
which was previously suggested.
The macro
MAXON_HASHCODE(value)
can also be used to compute the hash code of the arguments based on DefaultCompare::GetCombinedHashCode.
Finally the old hash mechanism is still available via the macro MAXON_HASHCODE_LEGACY(value) .
Within the Release 23, Python version was updated from 2.7.14 to 3.7.7.
This is a significant internal change within Python although if the python.framework was previously used, porting the code to Python 3 should be rather easy.
If the deprecated Python Library (lib_py.h) is used, the only change needed is:
PYFN_FLAGS::KEYWORDS
to
PYFN_FLAGS::KEYWORDS | PYFN_FLAGS::VARARGS
. PYFN_FLAGS::NOARGS doesn't need to be adapted.
Finally:
见 API Changes in R23.008 for the detailed list.