Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object_api.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| ReportList *reports, | ReportList *reports, | ||||
| bool preserve_all_data_layers, | bool preserve_all_data_layers, | ||||
| Depsgraph *depsgraph) | Depsgraph *depsgraph) | ||||
| { | { | ||||
| /* TODO(sergey): Make it more re-usable function, de-duplicate with | /* TODO(sergey): Make it more re-usable function, de-duplicate with | ||||
| * rna_Main_meshes_new_from_object. */ | * rna_Main_meshes_new_from_object. */ | ||||
| switch (object->type) { | switch (object->type) { | ||||
| case OB_FONT: | case OB_FONT: | ||||
| case OB_CURVE: | case OB_CURVES_LEGACY: | ||||
| case OB_SURF: | case OB_SURF: | ||||
| case OB_MBALL: | case OB_MBALL: | ||||
| case OB_MESH: | case OB_MESH: | ||||
| break; | break; | ||||
| default: | default: | ||||
| BKE_report(reports, RPT_ERROR, "Object does not have geometry data"); | BKE_report(reports, RPT_ERROR, "Object does not have geometry data"); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| return BKE_object_to_mesh(depsgraph, object, preserve_all_data_layers); | return BKE_object_to_mesh(depsgraph, object, preserve_all_data_layers); | ||||
| } | } | ||||
| static void rna_Object_to_mesh_clear(Object *object) | static void rna_Object_to_mesh_clear(Object *object) | ||||
| { | { | ||||
| BKE_object_to_mesh_clear(object); | BKE_object_to_mesh_clear(object); | ||||
| } | } | ||||
| static Curve *rna_Object_to_curve(Object *object, | static Curve *rna_Object_to_curve(Object *object, | ||||
| ReportList *reports, | ReportList *reports, | ||||
| Depsgraph *depsgraph, | Depsgraph *depsgraph, | ||||
| bool apply_modifiers) | bool apply_modifiers) | ||||
| { | { | ||||
| if (!ELEM(object->type, OB_FONT, OB_CURVE)) { | if (!ELEM(object->type, OB_FONT, OB_CURVES_LEGACY)) { | ||||
| BKE_report(reports, RPT_ERROR, "Object is not a curve or a text"); | BKE_report(reports, RPT_ERROR, "Object is not a curve or a text"); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| if (depsgraph == NULL) { | if (depsgraph == NULL) { | ||||
| BKE_report(reports, RPT_ERROR, "Invalid depsgraph"); | BKE_report(reports, RPT_ERROR, "Invalid depsgraph"); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| bool rna_Object_generate_gpencil_strokes(Object *ob, | bool rna_Object_generate_gpencil_strokes(Object *ob, | ||||
| bContext *C, | bContext *C, | ||||
| ReportList *reports, | ReportList *reports, | ||||
| Object *ob_gpencil, | Object *ob_gpencil, | ||||
| bool use_collections, | bool use_collections, | ||||
| float scale_thickness, | float scale_thickness, | ||||
| float sample) | float sample) | ||||
| { | { | ||||
| if (ob->type != OB_CURVE) { | if (ob->type != OB_CURVES_LEGACY) { | ||||
| BKE_reportf(reports, | BKE_reportf(reports, | ||||
| RPT_ERROR, | RPT_ERROR, | ||||
| "Object '%s' is not valid for this operation! Only curves are supported", | "Object '%s' is not valid for this operation! Only curves are supported", | ||||
| ob->id.name + 2); | ob->id.name + 2); | ||||
| return false; | return false; | ||||
| } | } | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||