When you create a Bezier curve and enter the Edit mode, then you will see a greyed out menu item Spin in the Curve menu in the header.
How do i activate this menu item? How does it work?
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.
Sign up to join this communityWhen you create a Bezier curve and enter the Edit mode, then you will see a greyed out menu item Spin in the Curve menu in the header.
How do i activate this menu item? How does it work?
The reason Spin is greyed out is because currently the UI file for that menu item is
layout.operator("curve.spin")
Which points to an operator written in C
source/blender/editors/curve/editcurve.c
void CURVE_OT_spin(wmOperatorType *ot)
Inside that operator is a poll to check if the current state of blender warrants showing the menu entry as clickable.
ot->poll = ED_operator_editsurf;
this sets the value of ot->poll
to whatever the value of ED_operator_editsurf
is,
source/blender/editors/screen/screen_ops.c
int ED_operator_editsurf(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_SURF)
return NULL != ((Curve *)obedit->data)->editnurb;
return 0;
}
this tests if the object is in edit mode, it would be, and also tests the type
of the object, which in that case is not OB_SURF
, not a surface type curve.