2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2021-08-18 00:22:23 +10:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup RNA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* NOTE: this is included multiple times with different #defines for DEF_ENUM. */
|
|
|
|
|
|
|
|
|
|
/* use in cases where only dynamic types are used */
|
|
|
|
|
DEF_ENUM(DummyRNA_NULL_items)
|
|
|
|
|
DEF_ENUM(DummyRNA_DEFAULT_items)
|
|
|
|
|
|
|
|
|
|
/* all others should follow 'rna_enum_*_items' naming */
|
|
|
|
|
DEF_ENUM(rna_enum_id_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_object_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_workspace_object_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_object_empty_drawtype_items)
|
|
|
|
|
DEF_ENUM(rna_enum_object_gpencil_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_metaelem_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_proportional_falloff_items)
|
|
|
|
|
DEF_ENUM(rna_enum_proportional_falloff_curve_only_items)
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 10:28:14 -04:00
|
|
|
DEF_ENUM(rna_enum_snap_source_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
DEF_ENUM(rna_enum_snap_element_items)
|
|
|
|
|
DEF_ENUM(rna_enum_snap_node_element_items)
|
|
|
|
|
DEF_ENUM(rna_enum_curve_fit_method_items)
|
|
|
|
|
DEF_ENUM(rna_enum_mesh_select_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_mesh_select_mode_uv_items)
|
|
|
|
|
DEF_ENUM(rna_enum_mesh_delimit_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_space_graph_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_space_file_browse_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_space_sequencer_view_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_space_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_space_image_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_space_image_mode_all_items)
|
|
|
|
|
DEF_ENUM(rna_enum_space_action_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_fileselect_params_sort_items)
|
|
|
|
|
DEF_ENUM(rna_enum_region_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_object_modifier_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_constraint_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_boidrule_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_sequence_modifier_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_object_greasepencil_modifier_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_object_shaderfx_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_modifier_triangulate_quad_method_items)
|
|
|
|
|
DEF_ENUM(rna_enum_modifier_triangulate_ngon_method_items)
|
|
|
|
|
DEF_ENUM(rna_enum_modifier_shrinkwrap_mode_items)
|
2021-12-13 17:09:22 +01:00
|
|
|
DEF_ENUM(rna_enum_shrinkwrap_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_shrinkwrap_face_cull_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_image_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_image_color_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_image_color_depth_items)
|
|
|
|
|
DEF_ENUM(rna_enum_image_generated_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_normal_space_items)
|
|
|
|
|
DEF_ENUM(rna_enum_normal_swizzle_items)
|
|
|
|
|
DEF_ENUM(rna_enum_bake_save_mode_items)
|
2022-01-17 18:00:35 +01:00
|
|
|
DEF_ENUM(rna_enum_bake_margin_type_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
DEF_ENUM(rna_enum_bake_target_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_views_format_items)
|
|
|
|
|
DEF_ENUM(rna_enum_views_format_multilayer_items)
|
|
|
|
|
DEF_ENUM(rna_enum_views_format_multiview_items)
|
|
|
|
|
DEF_ENUM(rna_enum_stereo3d_display_items)
|
|
|
|
|
DEF_ENUM(rna_enum_stereo3d_anaglyph_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_stereo3d_interlace_type_items)
|
|
|
|
|
|
|
|
|
|
#ifdef WITH_OPENEXR
|
|
|
|
|
DEF_ENUM(rna_enum_exr_codec_items)
|
|
|
|
|
#endif
|
|
|
|
|
DEF_ENUM(rna_enum_color_sets_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_beztriple_keyframe_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_beztriple_interpolation_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_beztriple_interpolation_easing_items)
|
|
|
|
|
DEF_ENUM(rna_enum_fcurve_auto_smoothing_items)
|
|
|
|
|
DEF_ENUM(rna_enum_keyframe_handle_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_driver_target_rotation_mode_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_keyingset_path_grouping_items)
|
|
|
|
|
DEF_ENUM(rna_enum_keying_flag_items)
|
|
|
|
|
DEF_ENUM(rna_enum_keying_flag_items_api)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_fmodifier_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_motionpath_bake_location_items)
|
2022-04-26 12:29:22 +02:00
|
|
|
DEF_ENUM(rna_enum_motionpath_display_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_motionpath_range_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
|
2022-03-02 15:07:00 +11:00
|
|
|
DEF_ENUM(rna_enum_event_value_items)
|
|
|
|
|
DEF_ENUM(rna_enum_event_direction_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_event_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_event_type_mask_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_operator_type_flag_items)
|
|
|
|
|
DEF_ENUM(rna_enum_operator_return_items)
|
|
|
|
|
DEF_ENUM(rna_enum_operator_property_tags)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_brush_sculpt_tool_items)
|
|
|
|
|
DEF_ENUM(rna_enum_brush_uv_sculpt_tool_items)
|
|
|
|
|
DEF_ENUM(rna_enum_brush_vertex_tool_items)
|
|
|
|
|
DEF_ENUM(rna_enum_brush_weight_tool_items)
|
|
|
|
|
DEF_ENUM(rna_enum_brush_gpencil_types_items)
|
|
|
|
|
DEF_ENUM(rna_enum_brush_gpencil_vertex_types_items)
|
|
|
|
|
DEF_ENUM(rna_enum_brush_gpencil_sculpt_types_items)
|
|
|
|
|
DEF_ENUM(rna_enum_brush_gpencil_weight_types_items)
|
2022-05-31 14:07:06 +10:00
|
|
|
DEF_ENUM(rna_enum_brush_curves_sculpt_tool_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
DEF_ENUM(rna_enum_brush_image_tool_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_axis_xy_items)
|
|
|
|
|
DEF_ENUM(rna_enum_axis_xyz_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_axis_flag_xyz_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_symmetrize_direction_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_texture_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_light_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_lightprobes_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_unpack_method_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_object_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_object_rotation_mode_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_object_type_curve_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_rigidbody_object_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_rigidbody_object_shape_items)
|
|
|
|
|
DEF_ENUM(rna_enum_rigidbody_constraint_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_object_axis_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_render_pass_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_bake_pass_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_bake_pass_filter_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_keymap_propvalue_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_operator_context_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_wm_report_items)
|
Expose background job info to Python
Add `bpy.app.is_job_running(job_type)` as high-level indicator. Job
types currently exposed are `WM_JOB_TYPE_RENDER`,
`WM_JOB_TYPE_RENDER_PREVIEW`, and `WM_JOB_TYPE_OBJECT_BAKE`, as strings
with the `WM_JOB_TYPE_` prefix removed. The functions can be polled by
Python code to determine whether such background work is still ongoing
or not.
Furthermore, new app handles are added for
`object_bake_{pre,complete,canceled}`, which are called respectively
before an object baking job starts, completes sucessfully, and stops due
to a cancellation.
Motivation: There are various cases where Python can trigger the
execution of a background job, without getting notification that that
background job is done. As a result, it's hard to do things like
cleanups, or auto-quitting Blender after the work is done.
The approach in this commit can easily be extended with other job types,
when the need arises. The rendering of asset previews is one that's
likely to be added sooner than later, as there have already been
requests about this.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D14587
2022-06-02 11:20:17 +02:00
|
|
|
DEF_ENUM(rna_enum_wm_job_type_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_property_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_property_subtype_items)
|
2022-05-31 14:07:12 +10:00
|
|
|
DEF_ENUM(rna_enum_property_subtype_string_items)
|
|
|
|
|
DEF_ENUM(rna_enum_property_subtype_number_items)
|
|
|
|
|
DEF_ENUM(rna_enum_property_subtype_number_array_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
DEF_ENUM(rna_enum_property_unit_items)
|
2022-05-31 14:07:12 +10:00
|
|
|
DEF_ENUM(rna_enum_property_flag_items)
|
|
|
|
|
DEF_ENUM(rna_enum_property_flag_enum_items)
|
|
|
|
|
DEF_ENUM(rna_enum_property_override_flag_items)
|
|
|
|
|
DEF_ENUM(rna_enum_property_override_flag_collection_items)
|
|
|
|
|
DEF_ENUM(rna_enum_property_string_search_flag_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_shading_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_navigation_mode_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_node_socket_in_out_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_node_math_items)
|
|
|
|
|
DEF_ENUM(rna_enum_mapping_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_node_vec_math_items)
|
|
|
|
|
DEF_ENUM(rna_enum_node_boolean_math_items)
|
|
|
|
|
DEF_ENUM(rna_enum_node_float_compare_items)
|
Geometry Nodes: Generalized Compare Node
Replace compare floats node with a generalized compare node. The node
allows for the comparison of float, int, string, color, and vector.
The datatypes support the following operators:
Float, Int: <, >, <=, >=, ==, !=
String: ==, !=
Color: ==, !=, lighter, darker
(using rgb_to_grayscale value as the brightness value)
Vector Supports 5 comparison modes for: ==, !=, <, >, <=, >=
Average: The average of the components of the vectors are compared.
Dot Product: The dot product of the vectors are compared.
Direction: The angle between the vectors is compared to an angle
Element-wise: The individual components of the vectors are compared.
Length: The lengths of the vectors are compared.
Differential Revision: https://developer.blender.org/D13228
2021-12-01 09:36:25 -06:00
|
|
|
DEF_ENUM(rna_enum_node_compare_operation_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
DEF_ENUM(rna_enum_node_filter_items)
|
|
|
|
|
DEF_ENUM(rna_enum_node_float_to_int_items)
|
|
|
|
|
DEF_ENUM(rna_enum_node_map_range_items)
|
|
|
|
|
DEF_ENUM(rna_enum_node_clamp_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_ramp_blend_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_prop_dynamicpaint_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_clip_editor_mode_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_icon_items)
|
|
|
|
|
DEF_ENUM(rna_enum_uilist_layout_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_linestyle_color_modifier_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_linestyle_alpha_modifier_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_linestyle_thickness_modifier_type_items)
|
|
|
|
|
DEF_ENUM(rna_enum_linestyle_geometry_modifier_type_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_window_cursor_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_dt_method_vertex_items)
|
|
|
|
|
DEF_ENUM(rna_enum_dt_method_edge_items)
|
|
|
|
|
DEF_ENUM(rna_enum_dt_method_loop_items)
|
|
|
|
|
DEF_ENUM(rna_enum_dt_method_poly_items)
|
|
|
|
|
DEF_ENUM(rna_enum_dt_mix_mode_items)
|
|
|
|
|
DEF_ENUM(rna_enum_dt_layers_select_src_items)
|
|
|
|
|
DEF_ENUM(rna_enum_dt_layers_select_dst_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_context_mode_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_preference_section_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_attribute_type_items)
|
2022-05-03 12:23:17 +02:00
|
|
|
DEF_ENUM(rna_enum_color_attribute_type_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
DEF_ENUM(rna_enum_attribute_type_with_auto_items)
|
|
|
|
|
DEF_ENUM(rna_enum_attribute_domain_items)
|
2022-05-31 19:00:24 +02:00
|
|
|
DEF_ENUM(rna_enum_attribute_curves_domain_items)
|
2022-05-03 12:23:17 +02:00
|
|
|
DEF_ENUM(rna_enum_color_attribute_domain_items)
|
2021-10-11 08:38:02 -05:00
|
|
|
DEF_ENUM(rna_enum_attribute_domain_without_corner_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
DEF_ENUM(rna_enum_attribute_domain_with_auto_items)
|
2021-11-29 13:04:25 -06:00
|
|
|
DEF_ENUM(rna_enum_geometry_component_type_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
|
2021-11-03 13:45:51 -05:00
|
|
|
DEF_ENUM(rna_enum_volume_grid_data_type_items)
|
|
|
|
|
|
2021-08-18 00:22:23 +10:00
|
|
|
DEF_ENUM(rna_enum_collection_color_items)
|
2021-09-29 14:29:32 +02:00
|
|
|
DEF_ENUM(rna_enum_strip_color_items)
|
2021-08-18 00:22:23 +10:00
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_subdivision_uv_smooth_items)
|
|
|
|
|
DEF_ENUM(rna_enum_subdivision_boundary_smooth_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_transform_orientation_items)
|
|
|
|
|
|
2022-04-19 16:28:14 +02:00
|
|
|
DEF_ENUM(rna_enum_velocity_unit_items)
|
|
|
|
|
|
2022-06-08 15:37:46 +02:00
|
|
|
DEF_ENUM(rna_enum_curves_types)
|
|
|
|
|
|
2021-12-02 16:02:34 +11:00
|
|
|
/* Not available to RNA pre-processing (`makesrna`).
|
2021-08-18 00:22:23 +10:00
|
|
|
* Defined in editors for example. */
|
|
|
|
|
#ifndef RNA_MAKESRNA
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_particle_edit_hair_brush_items)
|
|
|
|
|
DEF_ENUM(rna_enum_particle_edit_disconnected_hair_brush_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_keyframe_paste_offset_items)
|
|
|
|
|
DEF_ENUM(rna_enum_keyframe_paste_merge_items)
|
|
|
|
|
|
|
|
|
|
DEF_ENUM(rna_enum_transform_pivot_items_full)
|
|
|
|
|
DEF_ENUM(rna_enum_transform_mode_types)
|
|
|
|
|
|
|
|
|
|
/* In the runtime part of RNA, could be removed from this section. */
|
|
|
|
|
DEF_ENUM(rna_enum_nla_mode_extend_items)
|
|
|
|
|
DEF_ENUM(rna_enum_nla_mode_blend_items)
|
|
|
|
|
DEF_ENUM(rna_enum_keyblock_type_items)
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#undef DEF_ENUM
|