Files
test2/source/blender/makesrna/RNA_enum_items.hh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

281 lines
9.2 KiB
C++
Raw Normal View History

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup RNA
*
* Notes:
* - This is included multiple times with different #defines for DEF_ENUM.
* - As these are global identifiers, all must confirm to `rna_enum_*_items` convention.
*/
/* Use in cases where only dynamic types are used. */
DEF_ENUM(rna_enum_dummy_NULL_items)
DEF_ENUM(rna_enum_dummy_DEFAULT_items)
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_color_space_convert_default_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)
DEF_ENUM(rna_enum_snap_element_items)
DEF_ENUM(rna_enum_snap_node_element_items)
DEF_ENUM(rna_enum_snap_animation_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_sequence_video_modifier_type_items)
DEF_ENUM(rna_enum_sequence_sound_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)
DEF_ENUM(rna_enum_shrinkwrap_type_items)
DEF_ENUM(rna_enum_shrinkwrap_face_cull_items)
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)
DEF_ENUM(rna_enum_bake_margin_type_items)
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_api_items)
DEF_ENUM(rna_enum_fmodifier_type_items)
DEF_ENUM(rna_enum_motionpath_bake_location_items)
DEF_ENUM(rna_enum_motionpath_display_type_items)
DEF_ENUM(rna_enum_motionpath_range_items)
DEF_ENUM(rna_enum_event_value_items)
DEF_ENUM(rna_enum_event_direction_items)
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_tag_items)
DEF_ENUM(rna_enum_brush_automasking_flag_items)
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)
DEF_ENUM(rna_enum_brush_curves_sculpt_tool_items)
DEF_ENUM(rna_enum_brush_image_tool_items)
DEF_ENUM(rna_enum_grease_pencil_selectmode_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)
DEF_ENUM(rna_enum_wm_job_type_items)
DEF_ENUM(rna_enum_property_type_items)
DEF_ENUM(rna_enum_property_subtype_items)
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)
DEF_ENUM(rna_enum_property_unit_items)
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)
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_socket_type_items)
DEF_ENUM(rna_enum_node_tree_interface_item_type_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)
DEF_ENUM(rna_enum_node_compare_operation_items)
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)
DEF_ENUM(rna_enum_color_attribute_type_items)
DEF_ENUM(rna_enum_attribute_type_with_auto_items)
DEF_ENUM(rna_enum_attribute_domain_items)
DEF_ENUM(rna_enum_attribute_domain_edge_face_items)
DEF_ENUM(rna_enum_attribute_domain_only_mesh_items)
Mesh: Replace auto smooth with node group Design task: #93551 This PR replaces the auto smooth option with a geometry nodes modifier that sets the sharp edge attribute. This solves a fair number of long- standing problems related to auto smooth, simplifies the process of normal computation, and allows Blender to automatically choose between face, vertex, and face corner normals based on the sharp edge and face attributes. Versioning adds a geometry node group to objects with meshes that had auto-smooth enabled. The modifier can be applied, which also improves performance. Auto smooth is now unnecessary to get a combination of sharp and smooth edges. In general workflows are changed a bit. Separate procedural and destructive workflows are available. Custom normals can be used immediately without turning on the removed auto smooth option. **Procedural** The node group asset "Smooth by Angle" is the main way to set sharp normals based on the edge angle. It can be accessed directly in the add modifier menu. Of course the modifier can be reordered, muted, or applied like any other, or changed internally like any geometry nodes modifier. **Destructive** Often the sharp edges don't need to be dynamic. This can give better performance since edge angles don't need to be recalculated. In edit mode the two operators "Select Sharp Edges" and "Mark Sharp" can be used. In other modes, the "Shade Smooth by Angle" controls the edge sharpness directly. ### Breaking API Changes - `use_auto_smooth` is removed. Face corner normals are now used automatically if there are mixed smooth vs. not smooth tags. Meshes now always use custom normals if they exist. - In Cycles, the lack of the separate auto smooth state makes normals look triangulated when all faces are shaded smooth. - `auto_smooth_angle` is removed. Replaced by a modifier (or operator) controlling the sharp edge attribute. This means the mesh itself (without an object) doesn't know anything about automatically smoothing by angle anymore. - `create_normals_split`, `calc_normals_split`, and `free_normals_split` are removed, and are replaced by the simpler `Mesh.corner_normals` collection property. Since it gives access to the normals cache, it is automatically updated when relevant data changes. Addons are updated here: https://projects.blender.org/blender/blender-addons/pulls/104609 ### Tests - `geo_node_curves_test_deform_curves_on_surface` has slightly different results because face corner normals are used instead of interpolated vertex normals. - `bf_wavefront_obj_tests` has different export results for one file which mixed sharp and smooth faces without turning on auto smooth. - `cycles_mesh_cpu` has one object which is completely flat shaded. Previously every edge was split before rendering, now it looks triangulated. Pull Request: https://projects.blender.org/blender/blender/pulls/108014
2023-10-20 16:54:08 +02:00
DEF_ENUM(rna_enum_attribute_domain_only_mesh_no_edge_items)
DEF_ENUM(rna_enum_attribute_domain_point_face_curve_items)
DEF_ENUM(rna_enum_attribute_domain_point_edge_face_curve_items)
DEF_ENUM(rna_enum_attribute_curves_domain_items)
DEF_ENUM(rna_enum_color_attribute_domain_items)
DEF_ENUM(rna_enum_attribute_domain_without_corner_items)
DEF_ENUM(rna_enum_attribute_domain_with_auto_items)
DEF_ENUM(rna_enum_geometry_component_type_items)
DEF_ENUM(rna_enum_node_combsep_color_items)
DEF_ENUM(rna_enum_node_socket_data_type_items)
DEF_ENUM(rna_enum_node_geometry_curve_handle_side_items)
DEF_ENUM(rna_enum_node_geometry_mesh_circle_fill_type_items)
DEF_ENUM(rna_enum_volume_grid_data_type_items)
DEF_ENUM(rna_enum_collection_color_items)
DEF_ENUM(rna_enum_strip_color_items)
DEF_ENUM(rna_enum_subdivision_uv_smooth_items)
DEF_ENUM(rna_enum_subdivision_boundary_smooth_items)
DEF_ENUM(rna_enum_transform_orientation_items)
DEF_ENUM(rna_enum_velocity_unit_items)
DEF_ENUM(rna_enum_curves_type_items)
DEF_ENUM(rna_enum_curve_normal_mode_items)
2021-12-02 16:02:34 +11:00
/* Not available to RNA pre-processing (`makesrna`).
* 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_offset_value_items)
DEF_ENUM(rna_enum_keyframe_paste_merge_items)
DEF_ENUM(rna_enum_transform_pivot_full_items)
DEF_ENUM(rna_enum_transform_mode_type_items)
/* 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)
DEF_ENUM(rna_enum_asset_library_type_items)
#endif
#undef DEF_ENUM