Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object_api.c
| Show First 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | static Mesh *rna_Object_to_mesh(Object *object, | ||||
| 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, | |||||
| ReportList *reports, | |||||
| Depsgraph *depsgraph, | |||||
| bool apply_modifiers) | |||||
| { | |||||
| if (!ELEM(object->type, OB_FONT, OB_CURVE)) { | |||||
| BKE_report(reports, RPT_ERROR, "Object is not a curve or a text"); | |||||
| return NULL; | |||||
| } | |||||
| if (depsgraph == NULL) { | |||||
| BKE_report(reports, RPT_ERROR, "Invalid depsgraph"); | |||||
| return NULL; | |||||
| } | |||||
| return BKE_object_to_curve(object, depsgraph, apply_modifiers); | |||||
| } | |||||
| static void rna_Object_to_curve_clear(Object *object) | |||||
| { | |||||
| BKE_object_to_curve_clear(object); | |||||
| } | |||||
| static PointerRNA rna_Object_shape_key_add( | static PointerRNA rna_Object_shape_key_add( | ||||
| Object *ob, bContext *C, ReportList *reports, const char *name, bool from_mix) | Object *ob, bContext *C, ReportList *reports, const char *name, bool from_mix) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| KeyBlock *kb = NULL; | KeyBlock *kb = NULL; | ||||
| if ((kb = BKE_object_shapekey_insert(bmain, ob, name, from_mix))) { | if ((kb = BKE_object_shapekey_insert(bmain, ob, name, from_mix))) { | ||||
| PointerRNA keyptr; | PointerRNA keyptr; | ||||
| ▲ Show 20 Lines • Show All 557 Lines • ▼ Show 20 Lines | RNA_def_pointer( | ||||
| "Dependency Graph", | "Dependency Graph", | ||||
| "Evaluated dependency graph which is required when preserve_all_data_layers is true"); | "Evaluated dependency graph which is required when preserve_all_data_layers is true"); | ||||
| parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object"); | parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "to_mesh_clear", "rna_Object_to_mesh_clear"); | func = RNA_def_function(srna, "to_mesh_clear", "rna_Object_to_mesh_clear"); | ||||
| RNA_def_function_ui_description(func, "Clears mesh data-block created by to_mesh()"); | RNA_def_function_ui_description(func, "Clears mesh data-block created by to_mesh()"); | ||||
| /* curve */ | |||||
| func = RNA_def_function(srna, "to_curve", "rna_Object_to_curve"); | |||||
| RNA_def_function_ui_description( | |||||
| func, | |||||
| "Create a Curve data-block from the current state of the object. This only works for curve " | |||||
| "and text objects. The object owns the data-block. To force free it, use to_curve_clear(). " | |||||
| "The result is temporary and can not be used by objects from the main database"); | |||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | |||||
| parm = RNA_def_pointer( | |||||
| func, "depsgraph", "Depsgraph", "Dependency Graph", "Evaluated dependency graph"); | |||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | |||||
| RNA_def_boolean(func, | |||||
| "apply_modifiers", | |||||
| false, | |||||
| "", | |||||
| "Apply the deform modifiers on the control points of the curve. This is only " | |||||
| "supported for curve objects"); | |||||
| parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve created from object"); | |||||
| RNA_def_function_return(func, parm); | |||||
| func = RNA_def_function(srna, "to_curve_clear", "rna_Object_to_curve_clear"); | |||||
| RNA_def_function_ui_description(func, "Clears curve data-block created by to_curve()"); | |||||
| /* Armature */ | /* Armature */ | ||||
| func = RNA_def_function(srna, "find_armature", "BKE_modifiers_is_deformed_by_armature"); | func = RNA_def_function(srna, "find_armature", "BKE_modifiers_is_deformed_by_armature"); | ||||
| RNA_def_function_ui_description( | RNA_def_function_ui_description( | ||||
| func, "Find armature influencing this object as a parent or via a modifier"); | func, "Find armature influencing this object as a parent or via a modifier"); | ||||
| parm = RNA_def_pointer( | parm = RNA_def_pointer( | ||||
| func, "ob_arm", "Object", "", "Armature object influencing this object or NULL"); | func, "ob_arm", "Object", "", "Armature object influencing this object or NULL"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| ▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines | |||||