Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/screen_ops.c
| Context not available. | |||||
| bool ED_operator_editsurfcurve(bContext *C) | bool ED_operator_editsurfcurve(bContext *C) | ||||
brecht: This poll function is used for many operators. I don't think these changes are correct for all… | |||||
achalpandeyyAuthorUnsubmitted Done Inline ActionsYes, you're right. I updated the diff to account for this, please have a look at it again. achalpandeyy: Yes, you're right. I updated the diff to account for this, please have a look at it again. | |||||
| { | { | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| if (obedit && ELEM(obedit->type, OB_CURVE, OB_SURF)) | |||||
| return NULL != ((Curve *)obedit->data)->editnurb; | if (obedit && ELEM(obedit->type, OB_CURVE, OB_SURF)) { | ||||
| if(obedit->type == OB_SURF) { | |||||
| Curve *cu = obedit->data; | |||||
| Nurb* nu = (&cu->editnurb->nurbs)->first; | |||||
| if(nu->pntsv != 1) /*check if given nurb is 1-D*/ | |||||
| return 0; | |||||
| else | |||||
| return NULL != ((Curve *)obedit->data)->editnurb; | |||||
| } | |||||
| else return NULL != ((Curve *)obedit->data)->editnurb; | |||||
| } | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| Context not available. | |||||
This poll function is used for many operators. I don't think these changes are correct for all of them?