Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/wavefront_obj/exporter/obj_export_nurbs.cc
| Context not available. | |||||
| int OBJCurve::total_spline_control_points(const int spline_index) const | int OBJCurve::total_spline_control_points(const int spline_index) const | ||||
| { | { | ||||
| const Nurb *const nurb = static_cast<Nurb *>(BLI_findlink(&export_curve_->nurb, spline_index)); | const Nurb *const nurb = static_cast<Nurb *>(BLI_findlink(&export_curve_->nurb, spline_index)); | ||||
| const int r_nurbs_degree = nurb->orderu - 1; | int degree = nurb->type == CU_POLY ? 1 : nurb->orderu - 1; | ||||
| /* Total control points = Number of points in the curve (+ degree of the | /* Total control points = Number of points in the curve (+ degree of the | ||||
| * curve if it is cyclic). */ | * curve if it is cyclic). */ | ||||
| int r_tot_control_points = nurb->pntsv * nurb->pntsu; | int r_tot_control_points = nurb->pntsv * nurb->pntsu; | ||||
| if (nurb->flagu & CU_NURB_CYCLIC) { | if (nurb->flagu & CU_NURB_CYCLIC) { | ||||
| r_tot_control_points += r_nurbs_degree; | r_tot_control_points += degree; | ||||
| } | } | ||||
| return r_tot_control_points; | return r_tot_control_points; | ||||
| } | } | ||||
| Context not available. | |||||
| int OBJCurve::get_nurbs_degree(const int spline_index) const | int OBJCurve::get_nurbs_degree(const int spline_index) const | ||||
| { | { | ||||
| const Nurb *const nurb = static_cast<Nurb *>(BLI_findlink(&export_curve_->nurb, spline_index)); | const Nurb *const nurb = static_cast<Nurb *>(BLI_findlink(&export_curve_->nurb, spline_index)); | ||||
| return nurb->orderu - 1; | return nurb->type == CU_POLY ? 1 : nurb->orderu - 1; | ||||
| } | } | ||||
| short OBJCurve::get_nurbs_flagu(const int spline_index) const | short OBJCurve::get_nurbs_flagu(const int spline_index) const | ||||
| Context not available. | |||||