summaryrefslogtreecommitdiff
path: root/modules/csg
diff options
context:
space:
mode:
Diffstat (limited to 'modules/csg')
-rw-r--r--modules/csg/config.py2
-rw-r--r--modules/csg/csg_shape.cpp11
-rw-r--r--modules/csg/register_types.cpp4
3 files changed, 12 insertions, 5 deletions
diff --git a/modules/csg/config.py b/modules/csg/config.py
index 5e1d916790..38ccc66d91 100644
--- a/modules/csg/config.py
+++ b/modules/csg/config.py
@@ -1,4 +1,4 @@
-def can_build(platform):
+def can_build(env, platform):
return True
def configure(env):
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 82db1871da..5f13474d2c 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -162,6 +162,10 @@ CSGBrush *CSGShape::_get_brush() {
void CSGShape::_update_shape() {
//print_line("updating shape for " + String(get_path()));
+
+ if (parent)
+ return;
+
set_base(RID());
root_mesh.unref(); //byebye root mesh
@@ -349,6 +353,10 @@ void CSGShape::_notification(int p_what) {
Node *parentn = get_parent();
if (parentn) {
parent = Object::cast_to<CSGShape>(parentn);
+ if (parent) {
+ set_base(RID());
+ root_mesh.unref();
+ }
}
if (use_collision && is_root_shape()) {
@@ -371,6 +379,7 @@ void CSGShape::_notification(int p_what) {
}
if (p_what == NOTIFICATION_EXIT_TREE) {
+
if (parent)
parent->_make_dirty();
parent = NULL;
@@ -2011,7 +2020,7 @@ void CSGPolygon::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_depth", "get_depth");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "spin_degrees", PROPERTY_HINT_RANGE, "1,360,0.1"), "set_spin_degrees", "get_spin_degrees");
ADD_PROPERTY(PropertyInfo(Variant::INT, "spin_sides", PROPERTY_HINT_RANGE, "3,64,1"), "set_spin_sides", "get_spin_sides");
- ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "path_node"), "set_path_node", "get_path_node");
+ ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "path_node", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Path"), "set_path_node", "get_path_node");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "path_interval", PROPERTY_HINT_EXP_RANGE, "0.001,1000.0,0.001,or_greater"), "set_path_interval", "get_path_interval");
ADD_PROPERTY(PropertyInfo(Variant::INT, "path_rotation", PROPERTY_HINT_ENUM, "Polygon,Path,PathFollow"), "set_path_rotation", "get_path_rotation");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_faces"), "set_smooth_faces", "get_smooth_faces");
diff --git a/modules/csg/register_types.cpp b/modules/csg/register_types.cpp
index 020724ee59..0dea09808a 100644
--- a/modules/csg/register_types.cpp
+++ b/modules/csg/register_types.cpp
@@ -30,8 +30,8 @@
#include "register_types.h"
-#include "csg_shape.h"
#include "csg_gizmos.h"
+#include "csg_shape.h"
void register_csg_types() {
@@ -51,9 +51,7 @@ void register_csg_types() {
EditorPlugins::add_by_type<EditorPluginCSG>();
#endif
#endif
-
}
void unregister_csg_types() {
-
}