diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 142 |
1 files changed, 132 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 0e45d6d4aea..f138964f8e3 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -72,6 +72,12 @@ static EnumPropertyItem audio_device_items[] = { {0, NULL, 0, NULL, NULL} }; +EnumPropertyItem navigation_mode_items[] = { + {VIEW_NAVIGATION_WALK, "WALK", 0, "Walk", "Interactively walk or free navigate around the scene"}, + {VIEW_NAVIGATION_FLY, "FLY", 0, "Fly", "Use fly dynamics to navigate the scene"}, + {0, NULL, 0, NULL, NULL} +}; + #ifdef RNA_RUNTIME #include "DNA_object_types.h" @@ -1958,22 +1964,16 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Node Backdrop", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "syntaxn"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "In/Out Node", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxv"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Converter Node", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR_GAMMA); + prop = RNA_def_property(srna, "color_node", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxb"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Operator Node", ""); + RNA_def_property_ui_text(prop, "Color Node", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -2012,6 +2012,60 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Noodle curving", "Curving of the noodle"); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "input_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "syntaxn"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Input Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "output_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_output"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Output Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "filter_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_filter"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Filter Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "vector_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_vector"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Vector Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "texture_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_texture"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Texture Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "shader_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_shader"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Shader Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "script_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_script"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Script Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "pattern_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_pattern"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Pattern Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "layout_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_layout"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Layout Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) @@ -2093,7 +2147,17 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna) RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + + prop = RNA_def_property(srna, "wire_edit", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Wire Edit", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Edge Select", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "preview_back"); RNA_def_property_array(prop, 4); @@ -2873,6 +2937,51 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update"); } +static void rna_def_userdef_walk_navigation(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "WalkNavigation", NULL); + RNA_def_struct_sdna(srna, "WalkNavigation"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); + RNA_def_struct_ui_text(srna, "Walk Navigation", "Walk navigation settings"); + + prop = RNA_def_property(srna, "mouse_speed", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.01f, 10.0f); + RNA_def_property_ui_text(prop, "Mouse Sensitivity", "Speed factor for when looking around, high values mean faster mouse movement"); + + prop = RNA_def_property(srna, "walk_speed", PROP_FLOAT, PROP_VELOCITY); + RNA_def_property_range(prop, 0.01f, 100.f); + RNA_def_property_ui_text(prop, "Walk Speed", "Base speed for walking and flying"); + + prop = RNA_def_property(srna, "walk_speed_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.01f, 10.f); + RNA_def_property_ui_text(prop, "Speed Factor", "Multiplication factor when using the fast or slow modifiers"); + + prop = RNA_def_property(srna, "view_height", PROP_FLOAT, PROP_UNIT_LENGTH); + RNA_def_property_ui_range(prop, 0.1f, 10.f, 0.1, 2); + RNA_def_property_range(prop, 0.f, 1000.f); + RNA_def_property_ui_text(prop, "View Height", "View distance from the floor when walking"); + + prop = RNA_def_property(srna, "jump_height", PROP_FLOAT, PROP_UNIT_LENGTH); + RNA_def_property_ui_range(prop, 0.1f, 10.f, 0.1, 2); + RNA_def_property_range(prop, 0.1f, 100.f); + RNA_def_property_ui_text(prop, "Jump Height", "Maximum height of a jump"); + + prop = RNA_def_property(srna, "teleport_time", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.f, 10.f); + RNA_def_property_ui_text(prop, "Teleport Duration", "Interval of time warp when teleporting in navigation mode"); + + prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_BOOLEAN); + RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_WALK_GRAVITY); + RNA_def_property_ui_text(prop, "Gravity", "Walk with gravity, or free navigate"); + + prop = RNA_def_property(srna, "use_mouse_reverse", PROP_BOOLEAN, PROP_BOOLEAN); + RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_WALK_MOUSE_REVERSE); + RNA_def_property_ui_text(prop, "Reverse Mouse", "Reverse the mouse look"); +} + static void rna_def_userdef_view(BlenderRNA *brna) { static EnumPropertyItem timecode_styles[] = { @@ -3793,7 +3902,19 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations " "(transform, ui control drag)"); - + + /* View Navigation */ + prop = RNA_def_property(srna, "navigation_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "navigation_mode"); + RNA_def_property_enum_items(prop, navigation_mode_items); + RNA_def_property_ui_text(prop, "View Navigation", "Which method to use for viewport navigation"); + + prop = RNA_def_property(srna, "walk_navigation", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "walk_navigation"); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "WalkNavigation"); + RNA_def_property_ui_text(prop, "Walk Navigation", "Settings for walk navigation mode"); + /* tweak tablet & mouse preset */ prop = RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dragthreshold"); @@ -4128,6 +4249,7 @@ void RNA_def_userdef(BlenderRNA *brna) rna_def_userdef_dothemes(brna); rna_def_userdef_solidlight(brna); + rna_def_userdef_walk_navigation(brna); srna = RNA_def_struct(brna, "UserPreferences", NULL); RNA_def_struct_sdna(srna, "UserDef"); |