c4d_painter.h File Reference

Classes

struct  TempUVHandle
 
struct  TextureSize
 
class  PaintBitmap
 
class  PaintLayer
 
class  PaintLayerMask
 
class  PaintLayerFolder
 
class  PaintLayerBmp
 
class  PaintTexture
 
class  PaintMaterial
 
struct  PaintBrushData
 

Namespaces

 maxon
 

Macros

#define PAINTER_SAVETEXTURE
 
#define PAINTER_SAVETEXTURE_FLAGS
 
#define PAINTER_SAVEBIT_SAVEAS
 
#define PAINTER_SAVEBIT_SAVECOPY
 
#define PAINTER_SAVEBIT_SAVEALLOWWARNING
 
#define PAINTER_SAVEBIT_RENAMEINSCENE
 
#define PAINTER_BRINGTOFRONT
 
#define PAINTER_LOADTEXTURE
 
#define LOADTEXTURE_FILENAME
 
#define PAINTER_FORCECLOSETEXTURE
 
#define PAINTER_CLOSETEXTURE
 
#define PAINTER_RELOADTEXTURE
 
#define RELOADTEXTURE_FILENAME
 
#define UV_SET_FROM_PROJECTION_CMD_ID
 
#define GETACTIVEUVSET_CHECKENABLING
 
#define GETACTIVEUVSET_UVWS
 
#define GETACTIVEUVSET_POLYS
 
#define GETACTIVEUVSET_POLYSELECTION
 
#define GETACTIVEUVSET_POINTS
 
#define GETACTIVEUVSET_POINTSELECTION
 
#define GETACTIVEUVSET_OBJECT
 
#define GETACTIVEUVSET_MODE
 
#define GETACTIVEUVSET_POLYHIDDEN
 
#define GETACTIVEUVSET_EDGESELECTION
 
#define GETACTIVEUVSET_ISLANDS
 
#define GETACTIVEUVSET_ALL_CHECKENABLING
 
#define GETACTIVEUVSET_ALL
 
#define UVCOMMAND_OPTIMALMAPPING
 
#define UVCOMMAND_OPTIMALCUBICMAPPING
 
#define UVCOMMAND_REALIGN
 
#define OPTIMALMAPPING_PRESERVEORIENTATION
 
#define OPTIMALMAPPING_STRETCHTOFIT
 
#define OPTIMALMAPPING_DISTORTION
 
#define OPTIMALMAPPING_SPACING
 
#define OPTIMALMAPPING_AREAFAK
 
#define OPTIMALMAPPING_TWOD
 
#define OPTIMALMAPPING_PROGRESSBAR
 
#define OPTIMALMAPPING_RELAXCOUNT
 
#define OPTIMALMAPPING_EQUALIZEAREA
 
#define UVCOMMAND_RELAX
 
#define RELAXUV_KEEP_BORDER
 
#define RELAXUV_KEEP_NEIGHBORS
 
#define RELAXUV_KEEP_POINTSEL
 
#define RELAXUV_CUT_EDGESEL
 
#define RELAXUV_EDGESEL_POINTER
 
#define RELAXUV_MAX_ITERATIONS
 
#define RELAXUV_MODE
 
#define RELAXUV_MODE_LSCM
 
#define RELAXUV_MODE_ABF
 
#define RELAXUV_ITERATION_NUMBER
 
#define RELAXUV_INTERACTIVE_ABF
 
#define RELAXUV_LIVE_ABF_UPDATE
 
#define RELAXUV_SAFE
 
#define RELAXUV_ERROR_MESSAGE
 
#define RELAXUV_ERROR_POLY_SELECTION
 
#define UVCOMMAND_COPY_UV
 
#define UVCOMMAND_PASTE_UV
 
#define UVCOMMAND_MAX_UV
 
#define UVCOMMAND_FLIP_SEQUENCE
 
#define UVCOMMAND_CYCLE_CW_UV
 
#define UVCOMMAND_CYCLE_CCW_UV
 
#define UVCOMMAND_TERRACE
 
#define UVCOMMAND_FIT_TO_CANVAS
 
#define UVCOMMAND_TRANSFORM
 
#define UVCOMMAND_TRANSFORM_MOVE_X
 
#define UVCOMMAND_TRANSFORM_MOVE_Y
 
#define UVCOMMAND_TRANSFORM_SCALE_X
 
#define UVCOMMAND_TRANSFORM_SCALE_Y
 
#define UVCOMMAND_TRANSFORM_ANGLE
 
#define UVCOMMAND_LINEUP
 
#define UVCOMMAND_UNSTITCH
 
#define UVCOMMAND_BOUNDARY2SHAPE
 
#define UVCOMMAND_BOUNDARY2SHAPE_MODE
 
#define UVCOMMAND_BOUNDARY2SHAPE_CIRCLE
 
#define UVCOMMAND_BOUNDARY2SHAPE_QUAD
 
#define UVCOMMAND_PACK_UV
 
#define UVCOMMAND_AUTOMATICUV
 
#define UVCOMMAND_PACK_RASTERIZED
 
#define UVCOMMAND_PACK_GEOMETRIC
 
#define UVCOMMAND_PACK_BOUNDINGBOX
 
#define AMSI_CREATE_MISSING_MATERIALS
 
#define AMSI_CREATE_MISSING_CHANNELS
 
#define AMSI_AUTOSELECT_MATERIALS
 
#define AMSI_AUTOSELECT_OBJECTS
 
#define AMSI_DELETE_BROKENMATERIALTAGS
 
#define AMSI_ENABLEMATERIALS
 
#define AMSI_SINGLEMATERIAL
 
#define CREATE_CHANNEL
 
#define CREATE_CHANNEL_C
 
#define AMSI_ENABLED
 
#define AMSI_TEXW
 
#define AMSI_TEXH
 
#define AMSI_TEXMIN
 
#define AMSI_TEXMAX
 
#define AMSI_QUANTIZE
 
#define AMSI_RESCALE_EXISTING
 
#define AMSI_USE_SAME_RES
 
#define AMSI_UV_CALC_METHOD
 
#define UV_CALC_METHOD_OPTIMAL1
 
#define UV_CALC_METHOD_OPTIMAL2
 
#define UV_CALC_METHOD_REALIGN
 
#define AMSI_UV_CALC_EXISTING
 
#define AMSI_UV_RELAXATION
 
#define OBJECT_PAINTLAYERBMP
 
#define OBJECT_PAINTTEXTURE
 
#define OBJECT_PAINTBITMAP
 
#define OBJECT_PAINTLAYERFOLDER
 
#define OBJECT_PAINTLAYER
 
#define UPDATE_CHILDREN
 
#define UPDATE_PARENTS
 
#define UPDATE_PREVIEW
 
#define UPDATE_REFRESH2D
 
#define UPDATE_RECALC
 
#define UPDATE_NOSAVECHG
 
#define UPDATE_NOOFFSET
 
#define UPDATE_REFRESH3D
 
#define UPDATE_REFRESHCURSOR
 
#define UPDATE_NOSTOPTHREADS
 
#define UPDATE_STD
 
#define RECALC_NOGRID
 
#define RECALC_INITBMP
 
#define GETPIXEL_ALPHAMASKS
 
#define GETPIXEL_USEBLENDING
 
#define GETPIXEL_ALL
 
#define GETPIXEL_NOMASK
 
#define GETPIXEL_CACHE
 
#define GETPIXEL_NOWORK
 
#define GETPIXEL_ONLYWORK
 
#define GETPIXEL_TILE_BOTH
 
#define GETPIXEL_DONTAPPLYMASK
 
#define GETPIXEL_USESELECTED
 
#define GETPIXEL_DITHERING
 
#define GETPIXEL_PROJECTIONPIXEL
 
#define GETPIXEL_RECALCBRUSHSTROKE
 
#define GETPIXEL_VOXELCACHING
 
#define GETPIXEL_MERGE
 
#define GETPIXEL_TILE_U
 
#define GETPIXEL_TILE_V
 
#define TEXTURE_FILEFORMAT
 
#define TEXTURE_WIDTH
 
#define TEXTURE_HEIGHT
 
#define TEXTURE_MODE
 
#define TEXTURE_COLOR
 
#define TEXTURE_SAVE_IMMEDIATLY
 
#define GETALLSTRINGS_FILESTRING
 
#define GETALLSTRINGS_SUGGESTED_PATH
 
#define GETALLSTRINGS_CHANNEL_ID
 

Functions

void * SendPainterCommand (Int32 command, BaseDocument *doc, PaintTexture *tex, BaseContainer *bc)
 
TempUVHandleGetActiveUVSet (BaseDocument *doc, Int32 flags)
 
Bool UpdateMeshUV (Bool fullUpdate=false)
 
void FreeActiveUVSet (TempUVHandle *handle)
 
const EdgeBaseSelectGetUVSeams (const BaseObject *obj)
 
const EdgeBaseSelectGetUVSeams2 (const BaseObject *obj, Bool checkUVSettings=false)
 
Bool CallUVCommand (const Vector *padr, Int32 PointCount, const CPolygon *polys, Int32 lPolyCount, UVWStruct *uvw, BaseSelect *polyselection, BaseSelect *pointselection, BaseObject *op, Int32 mode, Int32 cmdid, const BaseContainer &settings)
 
Int32 IdentifyImage (const Filename &texpath)
 
Bool BPSetupWizardWithParameters (BaseDocument *doc, const BaseContainer &settings, AtomArray &objects, AtomArray &material)
 
Bool CalculateTextureSize (BaseDocument *doc, AtomArray &materials, TextureSize *&sizes)
 
Bool GetAllStrings_AddTexture (const void *msgdata, const BaseContainer &d)
 
void PainterActivateChannel (Int32 channel, Bool multi, Bool enable)
 
PaintTexturePainterCreateNewTextureDialog (String &result, Filename &resultdirectory, Int32 channelid, BaseMaterial *bmat)
 
maxon::Result< maxon::DrawportTextureInterface * > PainterGetBrush (BaseDraw *bd, PaintBrushData &brushData)
 

Macro Definition Documentation

◆ UV_SET_FROM_PROJECTION_CMD_ID

#define UV_SET_FROM_PROJECTION_CMD_ID

Set UVW from Projection command in texture view.

Function Documentation

◆ SendPainterCommand()

void* SendPainterCommand ( Int32  command,
BaseDocument doc,
PaintTexture tex,
BaseContainer bc 
)

Sends commands to BodyPaint 3D.

Parameters
[in]commandThe command: PAINTER
[in]docThe optional document for the operation.
[in]texThe optional paint texture for the operation.
[in]bcThe optional container for the operation: PAINTER
Returns
The BodyPaint 3D window handle. Private.

◆ GetActiveUVSet()

TempUVHandle* GetActiveUVSet ( BaseDocument doc,
Int32  flags 
)

Retrieves the document's active UV set.

Parameters
[in]docThe document returning the active UV set.
[in]flagsThe flags: GETACTIVEUVSET
Returns
A temporary handle to the active UV set, or nullptr if there is no active UV set. Has to be freed with FreeActiveUVSet().

◆ UpdateMeshUV()

Bool UpdateMeshUV ( Bool  fullUpdate = false)

Updates the mesh based on the UVW result of interactive unwrapping.

Returns
true if successful, otherwise false.

◆ FreeActiveUVSet()

void FreeActiveUVSet ( TempUVHandle handle)

Frees the active UV set.

Parameters
[in]handleThe temporary handle of the UV set to be freed.

◆ GetUVSeams()

const EdgeBaseSelect* GetUVSeams ( const BaseObject obj)

Deprecated. Use GetUVSeams2(obj, true) to have the same behavior as before, but most of the time you want the "checkUVSettings" parameter to be false. Gets the UV seam edges for obj.
The edges are indexed by 4 * polygon + edge where polygon is the polygon index and edge is the edge index between 0 and 3.

Note
If the UV seams are disabled in the UV viewport, nullptr will be returned.
Parameters
[in]objThe object of the UV set.
Returns
The UV seam edges. The UV mesh owns the pointed base select.

◆ GetUVSeams2()

const EdgeBaseSelect* GetUVSeams2 ( const BaseObject obj,
Bool  checkUVSettings = false 
)

Gets the UV seam edges for obj.
The edges are indexed by 4 * polygon + edge where polygon is the polygon index and edge is the edge index between 0 and 3.

Parameters
[in]objThe object of the UV set.
[in]checkUVSettingsIf true and the UV seams are disabled in the UV viewport, nullptr will be return. If false, will always return the UV seams, without checking if the UV seams settings is enabled or not in the UV viewport.
Returns
The UV seam edges. The UV mesh owns the pointed base select.

◆ CallUVCommand()

Bool CallUVCommand ( const Vector padr,
Int32  PointCount,
const CPolygon polys,
Int32  lPolyCount,
UVWStruct uvw,
BaseSelect polyselection,
BaseSelect pointselection,
BaseObject op,
Int32  mode,
Int32  cmdid,
const BaseContainer settings 
)

Calls UV commands.
Example:

if (!handle)
return false;
CallUVCommand(pPoints, lPointCount, pPolys, lPolyCount, pUVW, pPolySel, pPointSel,
handle->SetUVW(pUVW);
Bool CallUVCommand(const Vector *padr, Int32 PointCount, const CPolygon *polys, Int32 lPolyCount, UVWStruct *uvw, BaseSelect *polyselection, BaseSelect *pointselection, BaseObject *op, Int32 mode, Int32 cmdid, const BaseContainer &settings)
TempUVHandle * GetActiveUVSet(BaseDocument *doc, Int32 flags)
Definition: c4d_basecontainer.h:47
const wchar_t * mode
Definition: fileutils.h:96
#define GETACTIVEUVSET_ALL
Combine all flags except the enable status and ignore UV view private option.
Definition: c4d_painter.h:218
#define UVCOMMAND_FIT_TO_CANVAS
Fit UV To Canvas.
Definition: c4d_painter.h:316
PyObject * op
Definition: object.h:520
Definition: c4d_painter.h:63
Bool SetUVW(UVWStruct *uv)
Parameters
[in]padrThe address of the points array.
[in]PointCountThe number of points in padr array.
[in]polysThe address of the polygons array.
[in]lPolyCountThe number of polygons in polys array.
[in]uvwThe address of the UV array.
[in]polyselectionThe polygon selection.
[in]pointselectionThe UV points selection.
The points are indexed by 4 * polygon + point where polygon is the polygon index and point is the point index between 0 and 3.
[in]opThe object of the UV set.
[in]modeThe UV editing mode: EditorModes
[in]cmdidThe UV command: UVCOMMAND
[in]settingsThe optional settings for the UV command.
Returns
true if successful, otherwise false.

◆ IdentifyImage()

Int32 IdentifyImage ( const Filename texpath)

Identifies an image's file format.

Parameters
[in]texpathThe texture's file path.
Returns
The image's file format: FILTER

◆ BPSetupWizardWithParameters()

Bool BPSetupWizardWithParameters ( BaseDocument doc,
const BaseContainer settings,
AtomArray objects,
AtomArray material 
)

Runs BodyPaint 3D paint wizard.

Parameters
[in]docThe document.
[in]settingsThe settings for the paint wizard: AMSI
[in]objectsAn array with the objects the paint wizard is using.
[in]materialAn array with the materials the paint wizard is using.
Returns
true if successful, otherwise false.

◆ CalculateTextureSize()

Bool CalculateTextureSize ( BaseDocument doc,
AtomArray materials,
TextureSize *&  sizes 
)

Calculates the texture size based on the geometry and the size of the UV polygons.

Parameters
[in]docThe document.
[in]materialsAn array containing the materials the texture size calculation is applied to.
[in]sizesAn array with the texture sizes, equals the number of materials. Must be freed with DeleteMem.
Returns
true if successful, otherwise false.

◆ GetAllStrings_AddTexture()

Bool GetAllStrings_AddTexture ( const void *  msgdata,
const BaseContainer d 
)

Private.

◆ PainterActivateChannel()

void PainterActivateChannel ( Int32  channel,
Bool  multi,
Bool  enable 
)

Activates/deactivates paint channels.

Parameters
[in]channelThe paint channel: CHANNEL
[in]multitrue for multi channel painting, false for single channel painting.
[in]enabletrue to activate the paint channel, false to deactivate the paint channel.

◆ PainterCreateNewTextureDialog()

PaintTexture* PainterCreateNewTextureDialog ( String result,
Filename resultdirectory,
Int32  channelid,
BaseMaterial bmat 
)

Opens the texture creation dialog for a material.

Parameters
[out]resultFilled with the texture's name (e.g. the filename).
[out]resultdirectoryThe directory of the texture.
[in]channelidThe channel type: CHANNEL
[in]bmatThe material of the texture.
Returns
The created paint texture if successful, otherwise nullptr. Cinema 4D owns the pointed paint texture.

◆ PainterGetBrush()

maxon::Result<maxon::DrawportTextureInterface*> PainterGetBrush ( BaseDraw bd,
PaintBrushData brushData 
)