Open Search
    FalloffData Class Reference

    #include <c4d_falloffdata.h>

    Inheritance diagram for FalloffData:

    Detailed Description

    A data class for creating falloff plugins.
    Falloffs appear in any falloff description (unless the flag PLUGINFLAG_HIDE is set during registration) and extend the functionality of effectors and anything that uses falloffs.
    Use RegisterFalloffPlugin() to register a falloff plugin.

    Public Member Functions

    virtual Bool CheckDirty (const BaseDocument *doc, const BaseContainer *bc)
     
    virtual Bool GetDVisible (const DescID &id, const BaseContainer *bc, BaseContainer *desc_bc) const
     
    virtual DRAWRESULT Draw (const FalloffDataData &data, DRAWPASS drawpass, BaseDraw *bd, BaseDrawHelp *bh)
     
    virtual Bool Message (Int32 type, BaseContainer *bc, void *m_data)
     
    virtual maxon::Result< BoolGetAccessedObjects (const BaseList2D *op, METHOD_ID method, AccessedObjectsCallback &access) const
     
    - Public Member Functions inherited from BaseData
    virtual ~BaseData ()
     
    void Destructor ()
     

    Init/Sample/Free

    virtual Bool Init (BaseContainer *bc)
     
    virtual Bool InitFalloff (const BaseDocument *doc, const BaseContainer *bc, FalloffDataData &falldata) const
     
    virtual void Sample (const Vector &p, const FalloffDataData &data, Float *res) const
     

    Handle

    virtual Int32 GetHandleCount (BaseContainer *bc, const FalloffDataData &data)
     
    virtual void GetHandle (BaseContainer *bc, Int32 i, HandleInfo &info, const FalloffDataData &data)
     
    virtual void SetHandle (BaseContainer *bc, Int32 i, Vector p, const FalloffDataData &data)
     

    Member Function Documentation

    ◆ Init()

    virtual Bool Init ( BaseContainer bc)
    virtual

    Called to initialize the falloff when it is first created.

    Parameters
    [in,out]bcThe falloff's container; normally this is the owning object's container.
    Returns
    true if successful, otherwise false.

    ◆ InitFalloff()

    virtual Bool InitFalloff ( const BaseDocument doc,
    const BaseContainer bc,
    FalloffDataData falldata 
    ) const
    virtual

    Called to initialize the falloff just before sampling. Allows to setup any necessary data in falldata or bc.

    Parameters
    [in,out]bcThe falloff's data.
    [in,out]falldataThe falloff's container; normally this is the container of the object owning the falloff.
    Returns
    true if successful, otherwise false.

    ◆ Sample()

    virtual void Sample ( const Vector p,
    const FalloffDataData data,
    Float res 
    ) const
    virtual

    Called to sample any point. Assign res to return the sampled value.

    Parameters
    [in]pThe position of the point to sample in falloff space.
    [in]dataThe falloff's data.
    [out]resSet to the sampled value.

    ◆ CheckDirty()

    virtual Bool CheckDirty ( const BaseDocument doc,
    const BaseContainer bc 
    )
    virtual

    Called to check for a change in the falloff.

    Parameters
    [in]bcThe falloff's container; normally this is the container of the object owning the falloff.
    Returns
    true if the falloff is dirty, otherwise false.

    ◆ GetDVisible()

    virtual Bool GetDVisible ( const DescID id,
    const BaseContainer bc,
    BaseContainer desc_bc 
    ) const
    virtual

    Called to check the visibility of any element in the falloff description. Just return true or false for the id (like NodeData::GetDEnabling).

    Parameters
    [in]idThe description ID.
    [in,out]bcThe falloff's container; normally this is the container of the object owning the falloff.
    [in,out]desc_bcThe description element's container.
    Returns
    true if the description element should be visible, otherwise false.

    ◆ GetHandleCount()

    virtual Int32 GetHandleCount ( BaseContainer bc,
    const FalloffDataData data 
    )
    virtual

    Called to get the number of handles for the falloff.
    Same as ObjectData::GetHandleCount with additional FalloffDataData.

    Parameters
    [in,out]bcThe falloff's container; normally this is the container of the object owning the falloff.
    [in,out]dataThe falloff's data.
    Returns
    The handle count.

    ◆ GetHandle()

    virtual void GetHandle ( BaseContainer bc,
    Int32  i,
    HandleInfo info,
    const FalloffDataData data 
    )
    virtual

    Called to get a handle for the falloff.
    Same as ObjectData::GetHandle with additional FalloffDataData.

    Parameters
    [in,out]bcThe falloff's container; normally this is the container of the object owning the falloff.
    [in]iThe handle index.
    [out]infoFilled with the information for handle i.
    [in,out]dataThe falloff's data.

    ◆ SetHandle()

    virtual void SetHandle ( BaseContainer bc,
    Int32  i,
    Vector  p,
    const FalloffDataData data 
    )
    virtual

    Called to set a handle for the falloff.
    Same as ObjectData::SetHandle with additional FalloffDataData.
    Called when the user has moved handle i to position p. Constrain the movement and update the internal data.

    Parameters
    [in,out]bcThe falloff's container; normally this is the container of the object owning the falloff.
    [in]iThe handle index.
    [in]pThe new position for handle i.
    [in,out]dataThe falloff's data.

    ◆ Draw()

    virtual DRAWRESULT Draw ( const FalloffDataData data,
    DRAWPASS  drawpass,
    BaseDraw bd,
    BaseDrawHelp bh 
    )
    virtual

    Called to draw the falloff in the viewport.
    Same as ObjectData::Draw with additional FalloffDataData.
    These predefined color constants should be used: FALLOFFCOLORS

    Parameters
    [in,out]dataThe falloff's data.
    [in]drawpassThe draw pass: DRAWPASS
    [in]bdThe editor's view. The caller owns the pointed base draw.
    [in]bhThe editor's view help. The caller owns the pointed base draw help.
    Returns
    The result of drawing into the editor view: DRAWRESULT

    ◆ Message()

    virtual Bool Message ( Int32  type,
    BaseContainer bc,
    void *  m_data 
    )
    virtual

    Called to process messages sent to the falloff.

    Parameters
    [in]typeThe message type: MSG
    [in,out]bcThe falloff's container; normally this is the container of the object owning the falloff.
    [in,out]m_dataThe message data. The sender owns the pointed data.
    Returns
    true if successful, otherwise false.

    ◆ GetAccessedObjects()

    virtual maxon::Result<Bool> GetAccessedObjects ( const BaseList2D op,
    METHOD_ID  method,
    AccessedObjectsCallback access 
    ) const
    virtual