Open Search
    c4d_tooldata.h File Reference

    Classes

    struct  ControlDisplayStruct
     
    class  EditorWindow
     
    class  ToolData
     

    Macros

    #define PLUGINFLAG_TOOL_EVALUATEHANDLES
     
    #define PLUGINFLAG_TOOL_DRAW_MULTIPLANE
     
    #define PLUGINFLAG_TOOL_TWEAK
     
    #define PLUGINFLAG_TOOL_HIGHLIGHT
     
    #define PLUGINFLAG_TOOL_EDITSTATES
     
    #define PLUGINFLAG_TOOL_SNAPSETTINGS
     
    #define PLUGINFLAG_TOOL_SINGLECLICK
     
    #define PLUGINFLAG_TOOL_TWEAK_NO_HIGHLIGHT
     
    #define PLUGINFLAG_TOOL_NO_WIREFRAME
     
    #define PLUGINFLAG_TOOL_SCULPTBRUSH
     
    #define PLUGINFLAG_TOOL_NO_OBJECTOUTLINE
     
    #define PLUGINFLAG_TOOL_OBJECTHIGHLIGHT
     
    #define PLUGINFLAG_TOOL_SWITCHACTION
     
    #define PLUGINFLAG_TOOL_IS_SELECTION
     
    #define PLUGINFLAG_TOOL_NO_TOPOLOGY_EDIT
     

    Enumerations

    enum class  VERTEXCOLOR_DISPLAYMODE {
      NONE ,
      COLOR ,
      ALPHA
    }
     
    enum  {
      PENPRESSURE ,
      PENTILT ,
      PENROTATION ,
      PENDRAWROTATION ,
      PENDRAWRANDOMNESS ,
      PENDRAWWHEELROTATION ,
      PENDRAWWHEELPRESSURE ,
      PENDRAWDISTANCE ,
      PENFINGERWHEEL
    }
     

    Functions

    enum VERTEXCOLOR_DISPLAYMODE MAXON_ENUM_FLAGS (VERTEXCOLOR_DISPLAYMODE)
     
    BaseContainerGetToolData (BaseDocument *doc, Int32 pluginid, Bool create=true)
     
    const BaseContainerGetToolData (const BaseDocument *doc, Int32 pluginid, Bool create=true)
     
    Float GetToolScale (BaseDraw *bd, AtomArray *arr, Int32 all, Int32 mode=-1)
     
    Bool RegisterToolPlugin (Int32 id, const maxon::String &str, Int32 info, BaseBitmap *icon, const maxon::String &help, ToolData *dat)
     

    Variables

     NONE
     
     COLOR
     
     ALPHA
     
    struct ControlDisplayStruct MAXON_ENUM_FLAGS
     

    Enumeration Type Documentation

    ◆ VERTEXCOLOR_DISPLAYMODE

    Enumerator
    NONE 
    COLOR 
    ALPHA 

    Function Documentation

    ◆ MAXON_ENUM_FLAGS()

    enum VERTEXCOLOR_DISPLAYMODE MAXON_ENUM_FLAGS ( VERTEXCOLOR_DISPLAYMODE  )

    ◆ GetToolData() [1/2]

    BaseContainer* GetToolData ( BaseDocument doc,
    Int32  pluginid,
    Bool  create = true 
    )

    Gets the data container for the tool with ID pluginid.

    Parameters
    [in]docThe document to get the settings for. The caller owns the pointed document.
    [in]pluginidThe plugin ID of the tool to get the data for.
    [in]createIf true, the container is created if it does not exist.
    Returns
    The tool data container. Cinema 4D owns the pointed container.

    ◆ GetToolData() [2/2]

    const BaseContainer* GetToolData ( const BaseDocument doc,
    Int32  pluginid,
    Bool  create = true 
    )

    ◆ GetToolScale()

    Float GetToolScale ( BaseDraw bd,
    AtomArray arr,
    Int32  all,
    Int32  mode = -1 
    )

    Retrieves the scale between the local size of the objects in arr and their screen size in bd. The scale is quantized to a power of 10.
    For example:

    Object size (units) Screen size (px) Scale

    100

    100

    1

    100

    900

    1

    100

    1001

    0.1

    100

    10

    10

    Note
    Useful to make mouse movements relative to the view size.
    Parameters
    [in]bdThe view to check the scale in. The caller owns the pointed base draw.
    [in]arrThe array with objects to check. The caller owns the pointed array.
    [in]allIf true all points are used for the calculation. If false the selection is used. If NOTOK the function checks if something is selected.
    [in]modeNOTOK to use the bounding box (default) or Mpoints/ Medges/Mpolygons.
    Returns
    The calculated scale.

    ◆ RegisterToolPlugin()

    Bool RegisterToolPlugin ( Int32  id,
    const maxon::String str,
    Int32  info,
    BaseBitmap icon,
    const maxon::String help,
    ToolData dat 
    )

    Registers a tool plugin.

    Parameters
    [in]idA unique plugin ID. Must be obtained from http://www.plugincafe.com
    [in]strThe name of the plugin.
    To affect the order that plugins are displayed in menus add "#$n" as a prefix to this name, where n is a number.
    Lower numbers are displayed before higher numbers. If name is "--" it will show up as a menu separator.
    [in]infoThe tool plugin info flags: PLUGINFLAG_TOOL PLUGINFLAG
    [in]iconThe icon for the tool. The bitmap is copied.
    The icon should be of size 32x32, but will be scaled if needed.
    It must also be 24 bits and should if possible include an alpha to support pattern backgrounds.
    [in]helpThe tool tips and status bar help text for the tool.
    When using strings it is advised to use the resources string (.str) files and the GeLoadString() function.
    This keeps the plugin easy to localize for any language to support and makes full use of the language features of Cinema 4D.
    [in]datThe tool data instance for the plugin. Cinema 4D takes over the ownership of the pointed tool data.
    Returns
    true if the tool plugin was registered, otherwise false.

    Variable Documentation

    ◆ NONE

    NONE

    ◆ COLOR

    COLOR

    ◆ ALPHA

    ALPHA

    ◆ MAXON_ENUM_FLAGS

    struct ControlDisplayStruct MAXON_ENUM_FLAGS