obevel
Attributes
-
ENGLISH NAME : BevelDeformer
-
NAME : obevel
-
INCLUDE : Obase
-
PATH : model/description/obevel.res
-
PLUGIN : model
-
MAXON online help (may not exist): OBEVEL
Elements
Example Code
The following code does not use the correct values when setting the data. You should check directly in C4D for the correct values that you should use in place of the ones that are shown.
This code is just to show you how to access the values for getting and setting the parameters.
Python
import c4d
from c4d import gui
def main():
obj = c4d.BaseObject(c4d.obevel)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.O_BEVEL_MODE_COMPONENT_TYPE] = c4d.O_BEVEL_MODE_COMPONENT_TYPE_POINT
obj[c4d.O_BEVEL_RESTRICTION_START] = "Hello World"
obj[c4d.O_BEVEL_MODE_SELECTION_ANGLE_USE] = True
obj[c4d.O_BEVEL_MODE_SELECTION_ANGLE_VAL] = 0.1
obj[c4d.O_BEVEL_MASTER_MODE] = c4d.O_BEVEL_MASTER_MODE_CHAMFER
obj[c4d.O_BEVEL_OFFSET_MODE] = c4d.O_BEVEL_OFFSET_MODE_FIXED
obj[c4d.O_BEVEL_RADIUS] = 0.1
obj[c4d.O_BEVEL_SUB] = 0.1
obj[c4d.O_BEVEL_DEPTH] = 0.1
obj[c4d.O_BEVEL_SHAPING_EXTR] = 0.1
obj[c4d.O_BEVEL_LIMIT] = True
obj[c4d.O_BEVEL_EXTRUSION] = 0.1
obj[c4d.O_BEVEL_POLY_ANGLE] = 0.1
obj[c4d.O_BEVEL_GROUP] = True
obj[c4d.O_BEVEL_SHAPING_MODE] = c4d.O_BEVEL_SHAPING_MODE_ROUND
obj[c4d.O_BEVEL_SHAPING_TENSION] = 0.1
obj[c4d.O_BEVEL_SHAPING_SPLINE_PLANE] = c4d.O_BEVEL_SHAPING_SPLINE_PLANE_XY
obj[c4d.O_BEVEL_SHAPING_SYMMETRY] = True
obj[c4d.O_BEVELL_SHAPING_CONSTANT] = True
obj[c4d.O_BEVEL_MITERING] = c4d.O_BEVEL_MITERING_DEFAULT
obj[c4d.O_BEVEL_CORNER_ENDING] = c4d.O_BEVEL_CORNER_ENDING_DEFAULT
obj[c4d.O_BEVEL_PROUNDING_TYPE] = c4d.O_BEVEL_PROUNDING_TYPE_FLAT
obj[c4d.O_BEVEL_CORNER_NGON] = True
obj[c4d.O_BEVEL_ROUNDING_NGON] = True
obj[c4d.O_BEVEL_SELECTION_PHONG_BREAK] = True
obj[c4d.O_BEVEL_SELECTION_PHONG_BREAK_M] = True
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetInt32(c4d.O_BEVEL_MODE_COMPONENT_TYPE,c4d.O_BEVEL_MODE_COMPONENT_TYPE_POINT)
bc.SetString(c4d.O_BEVEL_RESTRICTION_START,"Hello World")
bc.SetBool(c4d.O_BEVEL_MODE_SELECTION_ANGLE_USE,True)
bc.SetFloat(c4d.O_BEVEL_MODE_SELECTION_ANGLE_VAL,0.1)
bc.SetInt32(c4d.O_BEVEL_MASTER_MODE,c4d.O_BEVEL_MASTER_MODE_CHAMFER)
bc.SetInt32(c4d.O_BEVEL_OFFSET_MODE,c4d.O_BEVEL_OFFSET_MODE_FIXED)
bc.SetFloat(c4d.O_BEVEL_RADIUS,0.1)
bc.SetFloat(c4d.O_BEVEL_SUB,0.1)
bc.SetFloat(c4d.O_BEVEL_DEPTH,0.1)
bc.SetFloat(c4d.O_BEVEL_SHAPING_EXTR,0.1)
bc.SetBool(c4d.O_BEVEL_LIMIT,True)
bc.SetFloat(c4d.O_BEVEL_EXTRUSION,0.1)
bc.SetFloat(c4d.O_BEVEL_POLY_ANGLE,0.1)
bc.SetBool(c4d.O_BEVEL_GROUP,True)
bc.SetInt32(c4d.O_BEVEL_SHAPING_MODE,c4d.O_BEVEL_SHAPING_MODE_ROUND)
bc.SetFloat(c4d.O_BEVEL_SHAPING_TENSION,0.1)
bc.SetInt32(c4d.O_BEVEL_SHAPING_SPLINE_PLANE,c4d.O_BEVEL_SHAPING_SPLINE_PLANE_XY)
bc.SetBool(c4d.O_BEVEL_SHAPING_SYMMETRY,True)
bc.SetBool(c4d.O_BEVELL_SHAPING_CONSTANT,True)
bc.SetInt32(c4d.O_BEVEL_MITERING,c4d.O_BEVEL_MITERING_DEFAULT)
bc.SetInt32(c4d.O_BEVEL_CORNER_ENDING,c4d.O_BEVEL_CORNER_ENDING_DEFAULT)
bc.SetInt32(c4d.O_BEVEL_PROUNDING_TYPE,c4d.O_BEVEL_PROUNDING_TYPE_FLAT)
bc.SetBool(c4d.O_BEVEL_CORNER_NGON,True)
bc.SetBool(c4d.O_BEVEL_ROUNDING_NGON,True)
bc.SetBool(c4d.O_BEVEL_SELECTION_PHONG_BREAK,True)
bc.SetBool(c4d.O_BEVEL_SELECTION_PHONG_BREAK_M,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../model/description/obevel.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(obevel);
pDoc->InsertObject(pObject);
pDoc->StartUndo();
pDoc->AddUndo(UNDO_NEW,pObject);
pDoc->EndUndo();
EventAdd(EVENT_FORCEREDRAW);
//You can set parameters two different ways.
//First way
//Some objects do not store all their data in the container. You need to use GetParameter()/SetParameter() instead.
DESCFLAGS_SET flags = DESCFLAGS_SET_PARAM_SET;
pObject->SetParameter(DescID(O_BEVEL_MODE_COMPONENT_TYPE),GeData(O_BEVEL_MODE_COMPONENT_TYPE_POINT),flags);
pObject->SetParameter(DescID(O_BEVEL_RESTRICTION_START),GeData("Hello World"),flags);
pObject->SetParameter(DescID(O_BEVEL_MODE_SELECTION_ANGLE_USE),GeData(true),flags);
pObject->SetParameter(DescID(O_BEVEL_MODE_SELECTION_ANGLE_VAL),GeData(0.1),flags);
pObject->SetParameter(DescID(O_BEVEL_MASTER_MODE),GeData(O_BEVEL_MASTER_MODE_CHAMFER),flags);
pObject->SetParameter(DescID(O_BEVEL_OFFSET_MODE),GeData(O_BEVEL_OFFSET_MODE_FIXED),flags);
pObject->SetParameter(DescID(O_BEVEL_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(O_BEVEL_SUB),GeData(0.1),flags);
pObject->SetParameter(DescID(O_BEVEL_DEPTH),GeData(0.1),flags);
pObject->SetParameter(DescID(O_BEVEL_SHAPING_EXTR),GeData(0.1),flags);
pObject->SetParameter(DescID(O_BEVEL_LIMIT),GeData(true),flags);
pObject->SetParameter(DescID(O_BEVEL_EXTRUSION),GeData(0.1),flags);
pObject->SetParameter(DescID(O_BEVEL_POLY_ANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(O_BEVEL_GROUP),GeData(true),flags);
pObject->SetParameter(DescID(O_BEVEL_SHAPING_MODE),GeData(O_BEVEL_SHAPING_MODE_ROUND),flags);
pObject->SetParameter(DescID(O_BEVEL_SHAPING_TENSION),GeData(0.1),flags);
pObject->SetParameter(DescID(O_BEVEL_SHAPING_SPLINE_PLANE),GeData(O_BEVEL_SHAPING_SPLINE_PLANE_XY),flags);
pObject->SetParameter(DescID(O_BEVEL_SHAPING_SYMMETRY),GeData(true),flags);
pObject->SetParameter(DescID(O_BEVELL_SHAPING_CONSTANT),GeData(true),flags);
pObject->SetParameter(DescID(O_BEVEL_MITERING),GeData(O_BEVEL_MITERING_DEFAULT),flags);
pObject->SetParameter(DescID(O_BEVEL_CORNER_ENDING),GeData(O_BEVEL_CORNER_ENDING_DEFAULT),flags);
pObject->SetParameter(DescID(O_BEVEL_PROUNDING_TYPE),GeData(O_BEVEL_PROUNDING_TYPE_FLAT),flags);
pObject->SetParameter(DescID(O_BEVEL_CORNER_NGON),GeData(true),flags);
pObject->SetParameter(DescID(O_BEVEL_ROUNDING_NGON),GeData(true),flags);
pObject->SetParameter(DescID(O_BEVEL_SELECTION_PHONG_BREAK),GeData(true),flags);
pObject->SetParameter(DescID(O_BEVEL_SELECTION_PHONG_BREAK_M),GeData(true),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetInt32(O_BEVEL_MODE_COMPONENT_TYPE,O_BEVEL_MODE_COMPONENT_TYPE_POINT);
bc->SetString(O_BEVEL_RESTRICTION_START,"Hello World");
bc->SetBool(O_BEVEL_MODE_SELECTION_ANGLE_USE,true);
bc->SetFloat(O_BEVEL_MODE_SELECTION_ANGLE_VAL,0.1);
bc->SetInt32(O_BEVEL_MASTER_MODE,O_BEVEL_MASTER_MODE_CHAMFER);
bc->SetInt32(O_BEVEL_OFFSET_MODE,O_BEVEL_OFFSET_MODE_FIXED);
bc->SetFloat(O_BEVEL_RADIUS,0.1);
bc->SetFloat(O_BEVEL_SUB,0.1);
bc->SetFloat(O_BEVEL_DEPTH,0.1);
bc->SetFloat(O_BEVEL_SHAPING_EXTR,0.1);
bc->SetBool(O_BEVEL_LIMIT,true);
bc->SetFloat(O_BEVEL_EXTRUSION,0.1);
bc->SetFloat(O_BEVEL_POLY_ANGLE,0.1);
bc->SetBool(O_BEVEL_GROUP,true);
bc->SetInt32(O_BEVEL_SHAPING_MODE,O_BEVEL_SHAPING_MODE_ROUND);
bc->SetFloat(O_BEVEL_SHAPING_TENSION,0.1);
bc->SetInt32(O_BEVEL_SHAPING_SPLINE_PLANE,O_BEVEL_SHAPING_SPLINE_PLANE_XY);
bc->SetBool(O_BEVEL_SHAPING_SYMMETRY,true);
bc->SetBool(O_BEVELL_SHAPING_CONSTANT,true);
bc->SetInt32(O_BEVEL_MITERING,O_BEVEL_MITERING_DEFAULT);
bc->SetInt32(O_BEVEL_CORNER_ENDING,O_BEVEL_CORNER_ENDING_DEFAULT);
bc->SetInt32(O_BEVEL_PROUNDING_TYPE,O_BEVEL_PROUNDING_TYPE_FLAT);
bc->SetBool(O_BEVEL_CORNER_NGON,true);
bc->SetBool(O_BEVEL_ROUNDING_NGON,true);
bc->SetBool(O_BEVEL_SELECTION_PHONG_BREAK,true);
bc->SetBool(O_BEVEL_SELECTION_PHONG_BREAK_M,true);
pObject->Message(MSG_UPDATE);
}
Buttons
This node has buttons. Buttons can manually be executed by calling the following code
Python
c4d.CallButton(obj,c4d.O_BEVEL_RESTRICTION_ADD)
c4d.CallButton(obj,c4d.O_BEVEL_RESTRICTION_REMOVE)
C++
DescriptionCommand dc;
dc.id = DescID(O_BEVEL_RESTRICTION_ADD);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(O_BEVEL_RESTRICTION_REMOVE);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);