summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/visual_script/visual_script_nodes.cpp4
-rw-r--r--scene/3d/camera.cpp2
-rw-r--r--scene/main/node.cpp12
-rw-r--r--servers/visual/visual_server_scene.h4
4 files changed, 14 insertions, 8 deletions
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;