Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/wavefront_obj/exporter/obj_exporter.cc
| Context not available. | |||||
| << std::endl; | << std::endl; | ||||
| } | } | ||||
| static bool is_curve_nurbs_compatible(const Nurb *nurb) | |||||
| { | |||||
| while (nurb) { | |||||
| if (nurb->type == CU_BEZIER || nurb->pntsv != 1) { | |||||
| return false; | |||||
| } | |||||
| nurb = nurb->next; | |||||
| } | |||||
| return true; | |||||
| } | |||||
| /** | /** | ||||
| * Filter supported objects from the Scene. | * Filter supported objects from the Scene. | ||||
| * | * | ||||
| Context not available. | |||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| switch (nurb->type) { | if (export_params.export_curves_as_nurbs && is_curve_nurbs_compatible(nurb)) { | ||||
| case CU_NURBS: | /* Export in parameter form: control points. */ | ||||
| if (export_params.export_curves_as_nurbs) { | r_exportable_nurbs.append(std::make_unique<OBJCurve>(depsgraph, export_params, object)); | ||||
| /* Export in parameter form: control points. */ | } | ||||
| r_exportable_nurbs.append( | else { | ||||
| std::make_unique<OBJCurve>(depsgraph, export_params, object)); | /* Export in mesh form: edges and vertices. */ | ||||
| } | r_exportable_meshes.append(std::make_unique<OBJMesh>(depsgraph, export_params, object)); | ||||
| else { | |||||
| /* Export in mesh form: edges and vertices. */ | |||||
| r_exportable_meshes.append( | |||||
| std::make_unique<OBJMesh>(depsgraph, export_params, object)); | |||||
| } | |||||
| break; | |||||
| case CU_BEZIER: | |||||
| /* Always export in mesh form: edges and vertices. */ | |||||
| r_exportable_meshes.append( | |||||
| std::make_unique<OBJMesh>(depsgraph, export_params, object)); | |||||
| break; | |||||
| default: | |||||
| /* Other curve types are not supported. */ | |||||
| break; | |||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| Context not available. | |||||