ToolResizeData Struct Reference

#include <c4d_baselist.h>

Detailed Description

Message struct for the MSG_TOOL_RESIZE message.
Sent during MMB (Middle Mouse Button) dragging and the [ and ] shortcuts with brushes if ToolAskMsgData::resize_allowed is set to true by the developer.
Here is an example from the Live Selection tool to show how it works:

Bool LiveSelectionTool::Message(BaseDocument *doc, BaseContainer &data, Int32 type, void *t_data)
{
switch (type)
{
{
ToolAskMsgData *a = (ToolAskMsgData*)t_data;
a->resize_allowed = true;
}
break;
{
if (!d || !d->data)
return false;
switch (d->pass)
{
{
d->falloff.show = d->cross_type = d->data->GetInt32(MDATA_SELECTLIVE_MODE) != MDATA_SELECTLIVE_MODE_NORMAL;
d->falloff.size = d->data->GetFloat(MDATA_SELECTLIVE_RADIUS);
d->falloff.opacity = d->data->GetFloat(MDATA_SOFT_STRENGTH);
d->falloff.position.off = Vector(mousex, mousey, 0.0);
}
break;
{
if (d->horizontal)
{
d->falloff.size = d->data->GetFloat(MDATA_SELECTLIVE_RADIUS);
d->falloff.size += d->delta;
if (d->falloff.size < 0.0) d->falloff.size = 0.0;
if (d->falloff.size > 1000.0) d->falloff.size = 1000.0;
d->data->SetFloat(MDATA_SELECTLIVE_RADIUS, d->falloff.size);
}
else
{
{
d->falloff.opacity = d->data->GetFloat(MDATA_SOFT_STRENGTH);
d->falloff.opacity += Float(d->delta) * 0.01;
d->falloff.opacity = FCut(d->falloff.opacity, 0.0, 1.0);
d->data->SetFloat(MDATA_SOFT_STRENGTH, d->falloff.opacity);
}
else
{
d->falloff.opacity = d->data->GetFloat(MDATA_VERTEXPAINT_STRENGTH);
d->falloff.opacity += Float(d->delta) * 0.01;
d->falloff.opacity = FCut(d->falloff.opacity, 0.0, 1.0);
d->data->SetFloat(MDATA_VERTEXPAINT_STRENGTH, d->falloff.opacity);
}
}
}
break;
default: break;
}
}
break;
}
...
}
#define MSG_TOOL_RESIZE
Sent during MMB (MMB (Middle Mouse Button) dragging and the [ and ] shortcuts with brushes if ToolAsk...
Definition: c4d_baselist.h:553
#define MSG_TOOL_ASK
Sent to tools on mouse input to query them on whether they accept/use certain input such as modifier ...
Definition: c4d_baselist.h:548
maxon::Bool Bool
Definition: ge_sys_math.h:46
maxon::Int32 Int32
Definition: ge_sys_math.h:51
maxon::Float Float
Definition: ge_sys_math.h:57
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:140
PyObject ** type
Definition: pycore_pyerrors.h:34
const char * doc
Definition: pyerrors.h:226
@ RESIZE_PASS_INIT
Called before resizing starts.
Definition: c4d_baselist.h:318
@ RESIZE_PASS_RESIZE
Called during the resizing process.
Definition: c4d_baselist.h:320
BaseContainer * data
[Read-Only] A pointer to the tool's BaseContainer.
Definition: c4d_baselist.h:327
ToolResizeData()
Default constructor.
Definition: c4d_baselist.h:356
@ MDATA_VERTEXPAINT_STRENGTH
Definition: toolliveselection.h:19
@ MDATA_SELECTLIVE_RADIUS
Definition: toolliveselection.h:10
@ MDATA_SELECTLIVE_MODE
Definition: toolliveselection.h:23
@ MDATA_SELECTLIVE_MODE_NORMAL
Definition: toolliveselection.h:24
@ MDATA_SELECTLIVE_MODE_SOFTSELECTION
Definition: toolliveselection.h:26
@ MDATA_SOFT_STRENGTH
Definition: toolsoftselection.h:16

Classes

struct  ToolResizeFalloffData
 

Public Member Functions

 ToolResizeData ()
 

Input Values

enum  RESIZE_PASS {
  RESIZE_PASS_INIT ,
  RESIZE_PASS_GENERATEFALLOFF ,
  RESIZE_PASS_RESIZE ,
  RESIZE_PASS_END ,
  RESIZE_PASS_RESET
}
 
enum cinema::ToolResizeData::RESIZE_PASS pass
 
Int32 delta
 
Int32 total_delta
 
Int32 horizontal
 
BaseContainerdata
 

Result Values

Bool cross_type
 
ToolResizeFalloffData falloff
 
String cursor_text
 

Member Enumeration Documentation

◆ RESIZE_PASS

Enumerator
RESIZE_PASS_INIT 

Called before resizing starts.

RESIZE_PASS_GENERATEFALLOFF 

Called when a custom falloff needs to be generated.

RESIZE_PASS_RESIZE 

Called during the resizing process.

RESIZE_PASS_END 

Called to end the resizing process.

RESIZE_PASS_RESET 

Called to reset resizing (user canceled action).

Constructor & Destructor Documentation

◆ ToolResizeData()

Default constructor.

Member Data Documentation

◆ pass

[Read-Only]
The resize pass: RESIZE_PASS

◆ delta

Int32 delta

[Read-Only]
The mouse movement delta.

◆ total_delta

Int32 total_delta

[Read-Only]
The mouse movement delta.

◆ horizontal

Int32 horizontal

[Read-Only]
true if a horizontal movement is occurring and cross_type has been set to true in the RESIZE_PASS_INIT pass by the user.

◆ data

[Read-Only]
A pointer to the tool's BaseContainer.

◆ cross_type

Bool cross_type

Set to false to disable cross type resizing, where the primary direction the mouse is moved in dictates movement afterwards.

◆ falloff

The radial falloff display preview settings.

◆ cursor_text

String cursor_text

The text to display next to the mouse cursor.