Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_wm_gizmo_api.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); | parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); | RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); | ||||
| RNA_def_property_ui_text(parm, "", "The matrix to transform"); | RNA_def_property_ui_text(parm, "", "The matrix to transform"); | ||||
| RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); | RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); | ||||
| /* draw_preset_box */ | /* draw_preset_box */ | ||||
| func = RNA_def_function(srna, "draw_preset_arrow", "rna_gizmo_draw_preset_arrow"); | func = RNA_def_function(srna, "draw_preset_arrow", "rna_gizmo_draw_preset_arrow"); | ||||
| RNA_def_function_ui_description(func, "Draw a box"); | RNA_def_function_ui_description(func, "Draw an arrow"); | ||||
| parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); | parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); | RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); | ||||
| RNA_def_property_ui_text(parm, "", "The matrix to transform"); | RNA_def_property_ui_text(parm, "", "The matrix to transform"); | ||||
| RNA_def_enum(func, "axis", rna_enum_object_axis_items, 2, "", "Arrow Orientation"); | RNA_def_enum(func, "axis", rna_enum_object_axis_items, 2, "", "Arrow Orientation"); | ||||
| RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); | RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); | ||||
| func = RNA_def_function(srna, "draw_preset_circle", "rna_gizmo_draw_preset_circle"); | func = RNA_def_function(srna, "draw_preset_circle", "rna_gizmo_draw_preset_circle"); | ||||
| RNA_def_function_ui_description(func, "Draw a box"); | RNA_def_function_ui_description(func, "Draw a circle"); | ||||
| parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); | parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); | RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); | ||||
| RNA_def_property_ui_text(parm, "", "The matrix to transform"); | RNA_def_property_ui_text(parm, "", "The matrix to transform"); | ||||
| RNA_def_enum(func, "axis", rna_enum_object_axis_items, 2, "", "Arrow Orientation"); | RNA_def_enum(func, "axis", rna_enum_object_axis_items, 2, "", "Arrow Orientation"); | ||||
| RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); | RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Other Shapes */ | /* Other Shapes */ | ||||
| /* draw_preset_facemap */ | /* draw_preset_facemap */ | ||||
| func = RNA_def_function(srna, "draw_preset_facemap", "rna_gizmo_draw_preset_facemap"); | func = RNA_def_function(srna, "draw_preset_facemap", "rna_gizmo_draw_preset_facemap"); | ||||
| RNA_def_function_ui_description(func, "Draw the face-map of a mesh object"); | RNA_def_function_ui_description(func, "Draw a face-map of a mesh object"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_CONTEXT); | ||||
| parm = RNA_def_pointer(func, "object", "Object", "", "Object"); | parm = RNA_def_pointer(func, "object", "Object", "", "Object"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| parm = RNA_def_int(func, "face_map", 0, 0, INT_MAX, "Face map index", "", 0, INT_MAX); | parm = RNA_def_int(func, "face_map", 0, 0, INT_MAX, "Face map index", "", 0, INT_MAX); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); | RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Property API */ | /* Property API */ | ||||
| /* Define Properties */ | /* Define Properties */ | ||||
| /* NOTE: 'target_set_handler' is defined in `bpy_rna_gizmo.c`. */ | /* NOTE: 'target_set_handler' is defined in `bpy_rna_gizmo.c`. */ | ||||
| func = RNA_def_function(srna, "target_set_prop", "rna_gizmo_target_set_prop"); | func = RNA_def_function(srna, "target_set_prop", "rna_gizmo_target_set_prop"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, ""); | RNA_def_function_ui_description(func, "Keep a property of this gizmo synchronized with the value of another property. This is mutually exclusive with target_set_operator"); /* TODO: Is this accurate? */ | ||||
| parm = RNA_def_string(func, "target", NULL, 0, "", "Target property"); | parm = RNA_def_string(func, "target", NULL, 0, "", "Name of the gizmo property to keep in sync"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* similar to UILayout.prop */ | /* similar to UILayout.prop */ | ||||
| parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); | parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take source property"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data"); | parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of the source property in the passed data"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_int(func, "index", -1, -1, INT_MAX, "", "", -1, INT_MAX); /* RNA_NO_INDEX == -1 */ | RNA_def_int(func, "index", -1, -1, INT_MAX, "", "", -1, INT_MAX); /* RNA_NO_INDEX == -1 */ | ||||
| func = RNA_def_function(srna, "target_set_operator", "rna_gizmo_target_set_operator"); | func = RNA_def_function(srna, "target_set_operator", "rna_gizmo_target_set_operator"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, | RNA_def_function_ui_description(func, | ||||
| "Operator to run when activating the gizmo " | "Operator to run when activating the gizmo " | ||||
| "(overrides property targets)"); | "(overrides property targets)"); | ||||
| parm = RNA_def_string(func, "operator", NULL, 0, "", "Target operator"); | parm = RNA_def_string(func, "operator", NULL, 0, "", "Target operator"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_int(func, "index", 0, 0, 255, "Part index", "", 0, 255); | RNA_def_int(func, "index", 0, 0, 255, "Part index", "", 0, 255); | ||||
| /* similar to UILayout.operator */ | /* similar to UILayout.operator */ | ||||
| parm = RNA_def_pointer( | parm = RNA_def_pointer( | ||||
| func, "properties", "OperatorProperties", "", "Operator properties to fill in"); | func, "properties", "OperatorProperties", "", "Operator properties to fill in"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* Access Properties */ | /* Access Properties */ | ||||
| /* NOTE: 'target_get', 'target_set' is defined in `bpy_rna_gizmo.c`. */ | /* NOTE: 'target_get', 'target_set' is defined in `bpy_rna_gizmo.c`. */ | ||||
| func = RNA_def_function(srna, "target_is_valid", "rna_gizmo_target_is_valid"); | func = RNA_def_function(srna, "target_is_valid", "rna_gizmo_target_is_valid"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_string(func, "property", NULL, 0, "", "Property identifier"); | parm = RNA_def_string(func, "property", NULL, 0, "", "Property identifier"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_function_ui_description(func, ""); | RNA_def_function_ui_description(func, ""); /* TODO: What is valid and what is not? */ | ||||
| parm = RNA_def_boolean(func, "result", 0, "", ""); | parm = RNA_def_boolean(func, "result", 0, "", ""); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| } | } | ||||
| void RNA_api_gizmogroup(StructRNA *UNUSED(srna)) | void RNA_api_gizmogroup(StructRNA *UNUSED(srna)) | ||||
| { | { | ||||
| /* nothing yet */ | /* nothing yet */ | ||||
| } | } | ||||
| #endif | #endif | ||||
| Context not available. | |||||