c4d.modules.bodypaint

Follow me to the Inheritance diagramm .

Types

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.
    CHANNEL_NORMAL The normal channel of the material.
    CHANNEL_ANY This specifies an unlabeled plugin channel.
  • 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 ( c4d.documents.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 ( c4d.documents.BaseDocument ) – The optional document for the operation.
  • tex ( c4d.modules.bodypaint.PaintTexture ) – The optional paint texture for the operation.
  • bc ( c4d.BaseContainer ) – The optional container for the operation.
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
											

c4d.modules.bodypaint. GetActiveUVSet ( doc , flags )

New in version R18.011.

Retrieves the document’s active UV set.

Parameters:
  • doc ( c4d.documents.BaseDocument ) – The document returning the active UV set.
  • flags ( int ) –

    The flags:

    GETACTIVEUVSET_CHECKENABLING Enable status.
    GETACTIVEUVSET_UVWS Get the UVWs array.
    GETACTIVEUVSET_POLYS Get the polygons array.
    GETACTIVEUVSET_POLYSELECTION Get the selected polygons array.
    GETACTIVEUVSET_POINTS Get the points array.
    GETACTIVEUVSET_POINTSELECTION Get the selected UV points.
    GETACTIVEUVSET_OBJECT Get the object of the UV set.
    GETACTIVEUVSET_MODE Get the active editor mode.
    GETACTIVEUVSET_POLYHIDDEN Get the hidden polygons array.
    GETACTIVEUVSET_ALL_CHECKENABLING Combine all of the previous flags and the enable status.
    GETACTIVEUVSET_ALL Combine all of the previous flags except the enable status.
Return type:

c4d.modules.bodypaint.TempUVHandle

Returns:

A temporary handle to the active UV set, or None if there is no active UV set. Has to be freed with FreeActiveUVSet() .

c4d.modules.bodypaint. FreeActiveUVSet ( handle )

New in version R18.011.

Frees the active UV set.

Parameters: handle ( c4d.modules.bodypaint.TempUVHandle ) – The temporary handle of the UV set to be freed.
c4d.modules.bodypaint. CallUVCommand ( points , pointCount , polys , polyCount , uvw , polySelection , pointSelection , op , mode , cmdid , settings )

New in version R18.011.

Calls UV commands.

Parameters:
  • points ( list of c4d.Vector ) – The points array.
  • pointCount ( int ) – The number of points in the points array.
  • polys ( list of c4d.CPolygon ) – The polygons array.
  • polyCount ( int ) – The number of polygons in the polys array.
  • uvw ( list of dict ( ‘a’ , ’b’ , ’c’ , ’d’ ) ) – The UVWs array.
  • polySelection ( c4d.BaseSelect ) – The polygon selection.
  • pointSelection ( c4d.BaseSelect ) – The UV point 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 .
  • op ( c4d.BaseObject ) – The object of the UV set.
  • mode ( int ) –

    The UV editing mode:

    Mcamera Camera mode.
    Mobject Object mode.
    Mtexture Texture mode.
    Mtextureaxis Texture axis mode.
    Mpoints Point edit mode.
    Medges Edge edit mode.
    Mpolygons Polygon edit mode.
    Manimation Animation mode.
    Mkinematic IK mode.
    Mmodel Model mode.
    Mpaint Paint mode.
    Muvpoints UV points.
    Muvpolygons UV polygons.
    Mdrag Drag mode.
    Mpolyedgepoint Combined poly/edge/point mode. Must only be used in ViewportSelect .
    Medgepoint Combined edge/point mode. Must only be used in ViewportSelect .
    Mworkplane Workplane mode.
  • cmdid ( int ) –

    The UV command:

    UVCOMMAND_OPTIMALMAPPING Optimal Angle UV Mapping.  
    UVCOMMAND_OPTIMALCUBICMAPPING Optimal Cubic UV Mapping.  
    UVCOMMAND_REALIGN Realign UV Mapping:  
      OPTIMALMAPPING_PRESERVEORIENTATION bool Preserve Orientation (Cubic, Angle, Realign).
      OPTIMALMAPPING_STRETCHTOFIT bool Stretch To Fit (Cubic, Angle, Realign).
      OPTIMALMAPPING_DISTORTION float Maximum Distortion (Angle).
      OPTIMALMAPPING_SPACING float Spacing (Cubic, Angle, Realign).
      OPTIMALMAPPING_AREAFAK float Maximum Area Factor (Cubic).
      OPTIMALMAPPING_TWOD bool 2D (Cubic).
      OPTIMALMAPPING_PROGRESSBAR bool Progress bar (Cubic, Angle, Realign).
      OPTIMALMAPPING_RELAXCOUNT int Relaxation Steps (Cubic, Angle).
      OPTIMALMAPPING_EQUALIZEAREA bool Equalize Island Size (Realign).
    UVCOMMAND_RELAX Relax UV:  
      RELAXUV_KEEP_BORDER bool Pin Border Points.
      RELAXUV_KEEP_NEIGHBORS bool Pin To Neighbors.
      RELAXUV_KEEP_POINTSEL bool Pin Point Selection.
      RELAXUV_CUT_EDGESEL bool Cut Selected Edges.
      RELAXUV_EDGESEL_POINTER c4d.BaseSelect Pointer to the edge selection.
      RELAXUV_MAX_ITERATIONS int Maximum Iteration Steps.
      RELAXUV_MODE int Relaxation Mode:
      RELAXUV_MODE_LSCM LSCM relaxation.
      RELAXUV_MODE_ABF ABF relaxation.
    UVCOMMAND_COPY_UV Copy UV Points.  
    UVCOMMAND_PASTE_UV Paste UV Points.  
    UVCOMMAND_MAX_UV Max UV.  
    UVCOMMAND_FLIP_SEQUENCE Flip Sequence.  
    UVCOMMAND_MOVE_DOWN_SEQUENCE Move Down Sequence.  
    UVCOMMAND_MOVE_UP_SEQUENCE Move Up Sequence.  
    UVCOMMAND_TERRACE UV Terrace.  
    UVCOMMAND_FIT_TO_CANVAS Fit UV To Canvas.  
    UVCOMMAND_TRANSFORM Transform UV:  
      UVCOMMAND_TRANSFORM_MOVE_X float Move X (U).
      UVCOMMAND_TRANSFORM_MOVE_Y float Move Y (V).
      UVCOMMAND_TRANSFORM_SCALE_X float Scale X (U).
      UVCOMMAND_TRANSFORM_SCALE_Y float Scale Y (V).
      UVCOMMAND_TRANSFORM_ANGLE float Rotation angle in radians.
    UVCOMMAND_LINEUP Line Up UV.  
    UVCOMMAND_UNSTITCH Unstitch UV.  
    UVCOMMAND_BOUNDARY2SHAPE UV Boundary To Shape:  
      UVCOMMAND_BOUNDARY2SHAPE_MODE int UV boundary shape:
      UVCOMMAND_BOUNDARY2SHAPE_CIRCLE UV boundary to circle.
      UVCOMMAND_BOUNDARY2SHAPE_QUAD UV boundary to square.
  • settings ( c4d.BaseContainer ) – The optional settings for the UV command.
Return type:

bool

Returns:

True if successful, otherwise False .

Table Of Contents