diff options
-rw-r--r-- | editor/editor_settings.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | modules/gdnative/SCsub | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.cpp | 4 | ||||
-rw-r--r-- | scene/3d/camera.cpp | 2 | ||||
-rw-r--r-- | scene/main/node.cpp | 12 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.h | 4 |
7 files changed, 22 insertions, 16 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 8bec8854ca..818f1b0218 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -370,8 +370,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("editors/3d/grid_color", Color::html("808080")); hints["editors/3d/grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/grid_color", PROPERTY_HINT_COLOR_NO_ALPHA, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - _initial_set("editors/3d/default_fov", 55.0); - _initial_set("editors/3d/default_z_near", 0.1); + _initial_set("editors/3d/default_fov", 70.0); + _initial_set("editors/3d/default_z_near", 0.05); _initial_set("editors/3d/default_z_far", 500.0); // navigation diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 20dda8b695..9636df970a 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -4828,8 +4828,8 @@ void SpatialEditor::_bind_methods() { void SpatialEditor::clear() { - settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 55.0)); - settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.1)); + settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 70.0)); + settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.05)); settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far", 1500.0)); for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { @@ -5072,14 +5072,14 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_fov->set_max(MAX_FOV); settings_fov->set_min(MIN_FOV); settings_fov->set_step(0.01); - settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 55.0)); + settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 70.0)); settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"), settings_fov); settings_znear = memnew(SpinBox); settings_znear->set_max(MAX_Z); settings_znear->set_min(MIN_Z); settings_znear->set_step(0.01); - settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.1)); + settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.05)); settings_vbc->add_margin_child(TTR("View Z-Near:"), settings_znear); settings_zfar = memnew(SpinBox); diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 54d0672a5b..f5a593cf4e 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -245,7 +245,7 @@ if ARGUMENTS.get('gdnative_wrapper', False): gd_wrapper_env = env.Clone() gd_wrapper_env.Append(CPPPATH=['#modules/gdnative/include/']) - # I think this doesn't work on MSVC yet... - gd_wrapper_env.Append(CCFLAGS=['-fPIC']) + if not env.msvc: + gd_wrapper_env.Append(CCFLAGS=['-fPIC']) gd_wrapper_env.Library("#bin/gdnative_wrapper_code", [gensource]) diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 05ff629d1b..95ad7256b3 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -1064,9 +1064,9 @@ void VisualScriptConstant::set_constant_type(Variant::Type p_type) { return; type = p_type; - ports_changed_notify(); Variant::CallError ce; value = Variant::construct(type, NULL, 0, ce); + ports_changed_notify(); _change_notify(); } @@ -1111,7 +1111,7 @@ void VisualScriptConstant::_bind_methods() { } ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt), "set_constant_type", "get_constant_type"); - ADD_PROPERTY(PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), "set_constant_value", "get_constant_value"); + ADD_PROPERTY(PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT | PROPERTY_USAGE_DEFAULT), "set_constant_value", "get_constant_value"); } class VisualScriptNodeInstanceConstant : public VisualScriptNodeInstance { diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 8c7d0c23c3..abc4a03498 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -649,7 +649,7 @@ Camera::Camera() { current = false; force_change = false; mode = PROJECTION_PERSPECTIVE; - set_perspective(65.0, 0.1, 100.0); + set_perspective(70.0, 0.05, 100.0); keep_aspect = KEEP_HEIGHT; layers = 0xfffff; v_offset = 0; diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 506dc85475..d8baa7834d 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2114,8 +2114,16 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const node_tree.push_front(this); if (instanced) { + // Since nodes in the instanced hierarchy won't be duplicated explicitly, we need to make an inventory + // of all the nodes in the tree of the instanced scene in order to transfer the values of the properties + for (List<const Node *>::Element *N = node_tree.front(); N; N = N->next()) { for (int i = 0; i < N->get()->get_child_count(); ++i) { + + // Skip nodes not really belonging to the instanced hierarchy; they'll be processed normally later + if (get_child(i)->data.owner != this) + continue; + node_tree.push_back(N->get()->get_child(i)); } } @@ -2124,6 +2132,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const for (List<const Node *>::Element *N = node_tree.front(); N; N = N->next()) { Node *current_node = node->get_node(get_path_to(N->get())); + ERR_CONTINUE(!current_node); if (p_flags & DUPLICATE_SCRIPTS) { bool is_valid = false; @@ -2136,9 +2145,6 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const List<PropertyInfo> plist; N->get()->get_property_list(&plist); - if (!current_node) - continue; - for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) { if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index d075be76ca..9af5ffb74d 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -120,9 +120,9 @@ public: Camera() { visible_layers = 0xFFFFFFFF; - fov = 65; + fov = 70; type = PERSPECTIVE; - znear = 0.1; + znear = 0.05; zfar = 100; size = 1.0; vaspect = false; |