c4d.modules.bodypaint

Follow me to the Inheritance diagramm.

Functions

c4d.modules.bodypaint.IdentifyImage(texpath)

Identifies the image’s file format.

Parameters:texpath (str) – The path to the image.
Return type:int
Returns:The image’s file format:
FILTER_TIF TIFF
FILTER_TGA TGA
FILTER_BMP BMP
FILTER_IFF IFF
FILTER_JPG JPEG
FILTER_PICT Mac Pict
FILTER_PSD Photoshop
FILTER_RLA RLA
FILTER_RPF RPF
FILTER_B3D Bodypaint
FILTER_TIF_B3D TIFF B3D
FILTER_PSB Photoshop Big
FILTER_AVI AVI Movie
FILTER_MOVIE Quicktime Movie
FILTER_QTVRSAVER_PANORAMA QTVR Panorama
FILTER_QTVRSAVER_OBJECT QTVR Object
FILTER_HDR HDR
FILTER_EXR_LOAD EXR (Load)
FILTER_EXR EXR
FILTER_PNG PNG
FILTER_IES IES
FILTER_DPX DPX
c4d.modules.bodypaint.PainterActivateChannel(channel, multi, enable)

Activation/deactivation of paint channels.

Parameters:
  • channel (int) –

    The paint channel:

    CHANNEL_COLOR The color channel of the material.
    CHANNEL_LUMINANCE The luminance channel of the material.
    CHANNEL_TRANSPARENCY The transparency channel of the material.
    CHANNEL_REFLECTION The reflection channel of the material.
    CHANNEL_ENVIRONMENT The environment channel of the material.
    CHANNEL_FOG The fog channel of the material.
    CHANNEL_BUMP The bump channel of the material.
    CHANNEL_ALPHA The alpha channel of the material.
    CHANNEL_SPECULAR The specular channel of the material.
    CHANNEL_SPECULARCOLOR The specular color channel of the material.
    CHANNEL_GLOW The glow channel of the material.
    CHANNEL_DISPLACEMENT The displacement channel of the material.
    CHANNEL_DIFFUSION The diffusion channel of the material.
  • multi (bool) – True for multi channel painting, False for single channel painting.
  • enable (bool) – True to activate the paint channel, False to deactivate the paint channel.
c4d.modules.bodypaint.BPSetupWizardWithParameters(doc, settings, objects, material)
../../../_images/bnsetupwizard.png

Run the BodyPaint 3D paint wizard.

Parameters:
  • doc (BaseDocument) – The document
  • settings (BaseContainer) –

    The container with the settings for the paint wizard:

    AMSI_CREATE_MISSING_MATERIALS bool Create materials and texturetag if they are missing.
    AMSI_CREATE_MISSING_CHANNELS bool Create missing texture channels.
    AMSI_AUTOSELECT_MATERIALS bool Autoselect materials from object selection.
    AMSI_AUTOSELECT_OBJECTS bool Autoselect objects from materials selection.
    AMSI_DELETE_BROKENMATERIALTAGS bool Delete material tags with broken material links.
    AMSI_ENABLEMATERIALS bool Enable all materials for painting.
    AMSI_SINGLEMATERIAL bool Enable all materials for painting.
    CREATE_CHANNEL bool Create missing texture channels (CREATE_CHANNEL + CHANNEL_ID).
    CREATE_CHANNEL_C Vector Channel color (CREATE_CHANNEL_C + CHANNEL_ID).
    AMSI_ENABLED bool Enable automatic mapsize interpolation, otherwise minimum size == texsize.
    AMSI_TEXW int Fixed texture size width.
    AMSI_TEXH int Fixed texture size height.
    AMSI_TEXMIN int Minimum texture size (width and height).
    AMSI_TEXMAX int Maximum texture size (width and height).
    AMSI_QUANTIZE int Quantize.
    AMSI_RESCALE_EXISTING bool Rescale existing material channels.
    AMSI_USE_SAME_RES bool Use the same texture size if already one channel exists.
    AMSI_UV_CALC_METHOD int Calculation mode:
    UV_CALC_METHOD_OPTIMAL1 Optimal Cube Mapping.
    UV_CALC_METHOD_OPTIMAL2 Optimal Angle Mapping.
    UV_CALC_METHOD_REALIGN Realign.
    AMSI_UV_CALC_EXISTING bool Calculate UVs.
    AMSI_UV_RELAXATION bool Relax UVs.
  • objects (any) – Any iteratable object, e.g: list, tuple.
  • material (any) – Any iteratable object, e.g: list, tuple.
Return type:

bool

Returns:

True if successfull, otherwise False.

c4d.modules.bodypaint.SendPainterCommand(command, doc, tex, bc)

Sends commands to Bodypaint 3D.

Parameters:
  • command (int) –

    Commands:

    PAINTER_SAVETEXTURE Save the textures. If doc != None all textures associated with doc are saved and if tex != None only tex is saved. Otherwise all textures are saved.
    PAINTER_SAVETEXTURE_FLAGS long Save texture flags.
    PAINTER_SAVEBIT_SAVEAS Save As.
    PAINTER_SAVEBIT_SAVECOPY Save As Copy.
    PAINTER_SAVEBIT_SAVEALLOWWARNING Allow warnings.
    PAINTER_SAVEBIT_RENAMEINSCENE Rename.
    PAINTER_BRINGTOFRONT Bring the BodyPaint 3D application window to front (for exchange plugins). Private.
    PAINTER_LOADTEXTURE Load a texture. Pass the texture to tex.
    LOADTEXTURE_FILENAME str The filename of the texture to load.
    PAINTER_FORCECLOSETEXTURE Remove a texture from memory. Pass the texture to tex.
    PAINTER_CLOSETEXTURE Remove a texture from memory but ask for if the texture is unsaved. Pass the texture to tex.
    PAINTER_SAVETEXTURE_DIRECT Save a texture. Pass the texture to tex.
    PAINTER_RELOADTEXTURE Reload a texture in BodyPaint 3D and CINEMA 4D’s renderer locklist.
    RELOADTEXTURE_FILENAME str The filename of the texture to reload.
  • doc (BaseDocument) – The optional document for the operation.
  • tex (PaintTexture) – The optional paint texture for the operation.
  • bc (BaseContainer) –

    The optional container for the operation.

    PAINTER_SAVETEXTURE_FLAGS long Save texture flags.
    PAINTER_SAVEBIT_SAVEAS Save As.
    PAINTER_SAVEBIT_SAVECOPY Save As Copy.
    PAINTER_SAVEBIT_SAVEALLOWWARNING Allow warnings.
    PAINTER_SAVEBIT_RENAMEINSCENE Rename.
    LOADTEXTURE_FILENAME str The filename of the texture to load.
    RELOADTEXTURE_FILENAME str The filename of the texture to reload.
Return type:

bool

Returns:

True if the command was successfully sent, otherwise False. If command was PAINTER_LOADTEXTURE and the texture successfully loaded, it then returns the PaintTexture:

import c4d
from c4d.modules import bodypaint

texturename = r'path/to/texture'
settings = c4d.BaseContainer()
settings.SetFilename(c4d.LOADTEXTURE_FILENAME, texturename)

tex = bodypaint.SendPainterCommand(c4d.PAINTER_LOADTEXTURE, doc=doc, tex=None, bc=settings)
if tex is not None:
    print tex

Table Of Contents