Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_object_api.c
| Show First 20 Lines • Show All 369 Lines • ▼ Show 20 Lines | |||||
| static void rna_Object_camera_fit_coords( | static void rna_Object_camera_fit_coords( | ||||
| Object *ob, Depsgraph *depsgraph, int num_cos, float *cos, float co_ret[3], float *scale_ret) | Object *ob, Depsgraph *depsgraph, int num_cos, float *cos, float co_ret[3], float *scale_ret) | ||||
| { | { | ||||
| BKE_camera_view_frame_fit_to_coords( | BKE_camera_view_frame_fit_to_coords( | ||||
| depsgraph, (const float(*)[3])cos, num_cos / 3, ob, co_ret, scale_ret); | depsgraph, (const float(*)[3])cos, num_cos / 3, ob, co_ret, scale_ret); | ||||
| } | } | ||||
| /* copied from Mesh_getFromObject and adapted to RNA interface */ | /* copied from Mesh_getFromObject and adapted to RNA interface */ | ||||
| /* settings: 0 - preview, 1 - render */ | static Mesh *rna_Object_to_mesh(Object *object, bContext *C, ReportList *reports) | ||||
| static Mesh *rna_Object_to_mesh(Object *ob, | |||||
| bContext *C, | |||||
| ReportList *reports, | |||||
| Depsgraph *depsgraph, | |||||
| bool apply_modifiers, | |||||
| bool calc_undeformed) | |||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| return rna_Main_meshes_new_from_object( | return rna_Main_meshes_new_from_object(bmain, reports, object); | ||||
| bmain, reports, depsgraph, ob, apply_modifiers, calc_undeformed); | |||||
| } | } | ||||
| 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; | ||||
| ▲ Show 20 Lines • Show All 479 Lines • ▼ Show 20 Lines | # endif | ||||
| RNA_def_parameter_flags(parm, 0, PARM_OUTPUT); | RNA_def_parameter_flags(parm, 0, PARM_OUTPUT); | ||||
| parm = RNA_def_property(func, "scale_return", PROP_FLOAT, PROP_NONE); | parm = RNA_def_property(func, "scale_return", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| parm, "", "The ortho scale to aim to be able to see all given points (if relevant)"); | parm, "", "The ortho scale to aim to be able to see all given points (if relevant)"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_OUTPUT); | RNA_def_parameter_flags(parm, 0, PARM_OUTPUT); | ||||
| /* mesh */ | /* mesh */ | ||||
| func = RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh"); | func = RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh"); | ||||
| RNA_def_function_ui_description(func, "Create a Mesh data-block with modifiers applied"); | RNA_def_function_ui_description(func, | ||||
| "Create a Mesh data-block from the current state of the object"); | |||||
mont29: `the current state` ;) | |||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); | ||||
| parm = RNA_def_pointer(func, | parm = RNA_def_pointer(func, | ||||
| "depsgraph", | |||||
| "Depsgraph", | |||||
| "Dependency Graph", | |||||
| "Evaluated dependency graph within which to evaluate modifiers"); | |||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | |||||
| parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); | |||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | |||||
| RNA_def_boolean(func, | |||||
| "calc_undeformed", | |||||
| false, | |||||
| "Calculate Undeformed", | |||||
| "Calculate undeformed vertex coordinates"); | |||||
| parm = RNA_def_pointer(func, | |||||
| "mesh", | "mesh", | ||||
| "Mesh", | "Mesh", | ||||
| "", | "", | ||||
| "Mesh created from object, remove it if it is only used for export"); | "Mesh created from object, remove it if it is only used for export"); | ||||
Not Done Inline ActionsUpdate descriptions here too? mont29: Update descriptions here too? | |||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* Armature */ | /* Armature */ | ||||
| func = RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature"); | func = RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature"); | ||||
| 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"); | ||||
| ▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines | |||||
the current state ;)