What was New in R18¶
The Python API in R18 brings important additions and more C++ API coverage. It also carries some API changes and fixes several issues.
In R18.020¶
New Features Support¶
MoGraph Weight Paintbrush: The new function
c4d.modules.mograph.GeGetMoDataWeights()supports the weights workflowVertex Colors: The new
c4d.VertexColorTagclass allows to access the Vertex Color tag and its dataColor Chooser: The new module
c4d.modules.colorchooseris a new API for the Color Chooser swatchesSubstance Engine: The new module
c4d.modules.substanceprovides functions to handle Substance shaders and graphsObject Tracker: The new module
c4d.modules.motiontrackerallows to retrieve object tracking dataAnimation: Quaternion Rotation Mode new methods/parameters in
c4d.BaseObject,c4d.CKey,c4d.CCurveandc4d.CTrack
c4d.Vector4dclass allows to manipulate four-dimensional vectors (e.g. RGB colors with alpha value for Vertex Colors)Draw HUD text to the viewport with the new methods
BaseDraw.DrawHUDText()andBaseDraw.DrawMultipleHUDText()
API Parity¶
Here are the additions in R18 for the ongoing effort on parity with the C++ API:
Dynamic Descriptions:
NodeData.GetDDescription()/NodeData.GetDParameter()/NodeData.SetDParameter()and enhancedc4d.DescriptionclassBodyPaint 3D UV commands:
c4d.modules.bodypaint.CallUVCommand()andc4d.modules.bodypaint.GetActiveUVSet()/c4d.modules.bodypaint.FreeActiveUVSet()Texture Baking:
c4d.utils.InitBakeTexture()/c4d.utils.BakeTexture()c4d.plugins.ObjectDataAutomated Handle Interface:GetHandle()/SetHandle()/GetHandleCount()Custom GUIs:
c4d.gui.BaseCustomGuiclass is no longer empty and now provides the same methods as in C++ (e.g.BaseCustomGui.GetData()/BaseCustomGui.SetData())Miscellaneous:
c4d.InExcludeDatamissing methods,c4d.modules.mograph.GeGetMoDataSelection()
New Plugins and Scripts Examples¶
Plugins:
Dynamic Description Parameters: Py-DynamicParametersObject
Texture Baking and Threads: Py-TextureBaker
Scripts:
MoGraph Weights and Selection: GeGetMoDataSelection.py, GeGetMoDataWeights.py
Vertex Colors: VertexColorTag_PointMode.py and VertexColorTag_PolygonMode.py
BodyPaint 3D UV Commands: CallUVCommand.py
Descriptions: CheckDescID.py, CreatePopupMenu.py, GetSubDescriptionWithData.py
API Changes¶
- Removed ReflectionLayer.name, ReflectionLayer.layerID and ReflectionLayer.flags attributesInstead use new methods
ReflectionLayer.GetName()/SetName(),ReflectionLayer.GetLayerID()andReflectionLayer.GetFlags()/SetFlags() FalloffData.Draw()return value changed from bool to DRAWRESULT. Returning a bool is still supported for backward compatibilityID_MODELING_KNIFE_TOOL was removed
Fixes¶
HyperFile.WriteFloat32()writes wrong value and corrupts stackc4d.modules.render.InitRenderStructnot correctly initialized with a documentBaseList2D.SetLayerObject()parameter layer can be NoneTextureTag.GetMaterial()can now be passed parameter ignoredoc. The parameter is optional and by default True for backward compatibilityFreeze after raised AttributeError in
GeDialog.Message()when message BFM_WEIGHTS_CHANGED was receivedSplineHelp.GetLineObject()crashes if not initialized with SPLINEHELPFLAGS_RETAINLINEOBJECT
In R18.039¶
API Additions¶
The new class
c4d.VoronoiFractureallows to access and create Voronoi fracture objectsGeSetMoDataSelection()andGeSetMoDataWeights()setMoGraphclones selection and weightsc4d.utils.RadToDeg()andc4d.utils.DegToRad()functions have been added. These functions should be used instead ofc4d.utils.Deg()andc4d.utils.Rad()
Fixes¶
XPresso Python node Activation port not working
c4d.modules.bodypaint.CallUVCommand()does not change UV dataDrag&Drop in dialogs and user areas does not handle commands
TakeData.GetTakeSelection()is broken
New Scripts Examples¶
MoGraph Weights and Selection: GeSetMoDataSelection.py, GeSetMoDataWeights.py
c4d.VoronoiFracture: VoronoiFracture.py
Documentation Changes¶
Added missing documentation for the following class, functions and methods:
Updated information for
PolygonObject.GetNgonEdgesCompact()
Py-DoubleCircle and Py-RoundedTube examples:
Removed implementation of MoveHandle() and DetectHandle()
Fixed to use the
c4d.plugins.ObjectDataAutomated Handle Interface functionsGetHandle()/SetHandle()/GetHandleCount()
In R18.057¶
API Additions¶
The addition of
GvNode.OperatorSetData()allows to simulate dragging onto an XPresso node- The parameters dirty and trans have been added to
BaseObject.GetHierarchyClone()/BaseObject.GetAndCheckHierarchyClone()Also the functions no longer return only None when the cloned object is None. It has been changed to always return a dictionary with clone and dirty keysWith these changesBaseObject.GetHierarchyClone()/BaseObject.GetAndCheckHierarchyClone()have the same behavior as their C++ API counterparts
Fixes¶
MessageDatatimer fires too oftenc4d.Cast()returns a copy of aBaseContainerinstead of a referenceCannot set RELAXUV_EDGESEL_POINTER for
CallUVCommand()settingsc4d.GenerateTexturePath()freezes if called with aNetRenderServiceand/or aBaseThreadBaseDraw.DrawPoints()vc and vn optional parameters can be NoneDescID.IsPartOf()cmp parameter cannot be NoneWrong index range check in
UVWTag.CpySlow()Description.GetParameterI()crashes
API Changelist¶
See API Changelist R18 page.