Code Monkey home page Code Monkey logo

gdprocmesh's People

Contributors

bastiaanolij avatar capnm avatar instinctbas avatar leopoldek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdprocmesh's Issues

(Linux) Incompatible with 3.1?

Using the current 3.1 release on linux, I can build the module just fine and the demo loads as well.
However, checking the actual procmeshes, I do not see any script (should be the .gdns, correct?) assigned.

And when creating a new mesh and assigning the .gdns as the script, Godot freezes and in the console I see these errors spammed continuously (same when trying to assign it to existing meshes in the demo):

ERROR: surface_remove: Index p_idx=26404876 out of size (surfaces.size()=0)
   At: scene/resources/mesh.cpp:892.
ERROR: surface_get_name: Index p_idx=26404875 out of size (surfaces.size()=0)
   At: scene/resources/mesh.cpp:958.
Removing unused surface 
ERROR: surface_remove: Index p_idx=26404875 out of size (surfaces.size()=0)
   At: scene/resources/mesh.cpp:892.
ERROR: surface_get_name: Index p_idx=26404874 out of size (surfaces.size()=0)
   At: scene/resources/mesh.cpp:958.
Removing unused surface 
ERROR: surface_remove: Index p_idx=26404874 out of size (surfaces.size()=0)
   At: scene/resources/mesh.cpp:892.
ERROR: surface_get_name: Index p_idx=26404873 out of size (surfaces.size()=0)
   At: scene/resources/mesh.cpp:958.
Removing unused surface 
ERROR: surface_remove: Index p_idx=26404873 out of size (surfaces.size()=0)
   At: scene/resources/mesh.cpp:892.
ERROR: surface_get_name: Index p_idx=26404872 out of size (surfaces.size()=0)
   At: scene/resources/mesh.cpp:958.

And yes, the p_idx is crazy large and always decreasing. I did not try and wait for it to become 0 ;)
Also, Godot's memory usage starts blowing up, which would no doubt eventually lead to a crash.

I did change the .gdnlib file, but only added an X11.64=[ ] to the dependencies tag. And I also changed the godot-cpp submodule to the 3.1 release (the gdprocmesh repo checks out a slightly older version).

Not really sure what is causing this, if it is an error in the gdprocmesh or Godot itself, or related to linux, etc.

Collision shapes

Often you want to use a simplified mesh to use as a collision shape. Godot already has a number of functions to create a collision shape from mesh data but I think in this case it makes far more sense to make that part of the procedural mesh logic.

My current line of thought is renaming the current output node to "surface output" and creating a new output type called "collision output".

Our GDProcMesh will now build the visible mesh from all "surface output" nodes. The question is, how to trigger building the collision shape....

One thing that I've been thinking off is to add one more layer to the structure so GDProcMesh simply becomes a container of our data object and will have the logic to update the ArrayMesh as the procedural data changes. Similarly we introduce a GDProcShape that can use the same data object but obtains the collision data.

Food for thought.

Using a procedural mesh in a CSGMesh messes with normals / problem in generation of normals?

New day, new issue ;)
However, I have a feeling that this one might not actually be related to gdprocmesh, but I'm not certain.

I created a procedural mesh with two outputs, then copied the MeshArray, then created a new CSGMesh and pasted the MeshArray as its Mesh. The geometry seems to work perfectly fine (as does the interaction with other CSG nodes, so that's awesome).

However, for some reason, the material (of one of the submeshes) becomes "shredded with lines":
Screenshot from 2019-05-03 14-04-12

As you can see, where the CSGMesh becomes cut out by a CSGCylinder, the wall actually looks better. At first I thought this was a problem with the display of the CSGMesh in the editor (as that tends to show a blue wireframe on top of the actual mesh), but it is just the same when viewed in the final scene.

I'm not entirely sure what is the cause of this. Could be the UVs in combination with the triplanar setting, but I'm not certain. As I said, I also don't know if this is even a gdprocmesh problem or related to the CSGMesh, or the triplanar mapping, etc.
All I do know is that I expected the CSGMesh to look exactly like the original MeshArray, but it doesn't.

If you are certain this has nothing to do with the module, I'll open an issue about this on the main Godot tracker. I don't really want to spam this issue across multiple repos if we can exclude some causes first ;)
Maybe you have a better idea what this could be related to if it isn't gdprocmesh.

Can't compile on OSX

I got the cpp submodule to compile but the whole gdprocmesh module couldn't create an osx library...
I checked in "gdprocmesh/demo/addons/gdprocmesh/bin"
I only found the win64 folder... (I didn't even compile a windows cpp library)

Got this error message when I tried compiling:

19PHOBOSS98:gdprocmesh kim$ scons platform=osx target=release
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/gdlibrary.os -c -g -O3 -arch x86_64 -fPIC -I. -Isrc -Igodot-cpp/godot_headers -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen src/gdlibrary.cpp
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:4:
godot-cpp/include/core/Defs.hpp:6:6: warning: scoped enumerations are a C++11
extension [-Wc++11-extensions]
enum class Error {
^
godot-cpp/include/core/Defs.hpp:67:48: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <typename T, typename ValueT, typename... Args>
^
godot-cpp/include/core/Defs.hpp:84:64: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <typename KV, typename KeyT, typename ValueT, typename... Args>
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:7:
godot-cpp/include/core/Array.hpp:44:17: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class... Args>
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:8:
godot-cpp/include/core/Basis.hpp:15:11: error: union member 'elements' has a
non-trivial default constructor
Vector3 elements[3];
^
godot-cpp/include/core/Vector3.hpp:32:2: note: because type 'godot::Vector3' has
a user-provided default constructor
Vector3();
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:8:
godot-cpp/include/core/Basis.hpp:16:11: error: union member 'x' has a
non-trivial default constructor
Vector3 x, y, z;
^
godot-cpp/include/core/Vector3.hpp:32:2: note: because type 'godot::Vector3' has
a user-provided default constructor
Vector3();
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:8:
godot-cpp/include/core/Basis.hpp:16:14: error: union member 'y' has a
non-trivial default constructor
Vector3 x, y, z;
^
godot-cpp/include/core/Vector3.hpp:32:2: note: because type 'godot::Vector3' has
a user-provided default constructor
Vector3();
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:8:
godot-cpp/include/core/Basis.hpp:16:17: error: union member 'z' has a
non-trivial default constructor
Vector3 x, y, z;
^
godot-cpp/include/core/Vector3.hpp:32:2: note: because type 'godot::Vector3' has
a user-provided default constructor
Vector3();
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:10:
In file included from godot-cpp/include/core/Dictionary.hpp:4:
In file included from godot-cpp/include/core/Variant.hpp:13:
In file included from godot-cpp/include/core/PoolArrays.hpp:7:
godot-cpp/include/core/GodotGlobal.hpp:30:17: warning: variadic templates are a
C++11 extension [-Wc++11-extensions]
template <class... Args>
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:10:
In file included from godot-cpp/include/core/Dictionary.hpp:4:
godot-cpp/include/core/Variant.hpp:131:4: error: delegating constructors are
permitted only in C++11
Variant((unsigned int)p_short) {}
^~~~~~~
godot-cpp/include/core/Variant.hpp:134:4: error: delegating constructors are
permitted only in C++11
Variant((signed int)p_char) {}
^~~~~~~
godot-cpp/include/core/Variant.hpp:137:4: error: delegating constructors are
permitted only in C++11
Variant((unsigned int)p_char) {}
^~~~~~~
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:11:
In file included from godot-cpp/include/core/CoreTypes.hpp:10:
godot-cpp/include/core/Dictionary.hpp:20:17: warning: variadic templates are a
C++11 extension [-Wc++11-extensions]
template <class... Args>
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:12:
In file included from godot-cpp/include/core/Ref.hpp:5:
In file included from godot-cpp/include/gen/Reference.hpp:11:
godot-cpp/include/gen/Object.hpp:89:17: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class... Args> Variant call(const String method, Args....
^
godot-cpp/include/gen/Object.hpp:92:17: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class... Args> Variant call_deferred(const String meth...
^
godot-cpp/include/gen/Object.hpp:95:17: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class... Args> Variant emit_signal(const String signal...
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:12:
godot-cpp/include/core/Ref.hpp:15:15: warning: in-class initialization of
non-static data member is a C++11 extension [-Wc++11-extensions]
T *reference = nullptr;
^
In file included from src/gdlibrary.cpp:1:
In file included from godot-cpp/include/core/Godot.hpp:21:
godot-cpp/include/gen/NativeScript.hpp:44:17: warning: variadic templates are a
C++11 extension [-Wc++11-extensions]
template <class... Args> Object *new_(Args... args){
^
In file included from src/gdlibrary.cpp:1:
godot-cpp/include/core/Godot.hpp:147:34: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class R, class... args>
^
godot-cpp/include/core/Godot.hpp:152:34: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class R, class... args>
^
godot-cpp/include/core/Godot.hpp:162:14: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <int... I>
^
godot-cpp/include/core/Godot.hpp:165:21: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <int N, int... I>
^
godot-cpp/include/core/Godot.hpp:167:15: warning: alias declarations are a C++11
extension [-Wc++11-extensions]
using type = typename __construct_sequence<N - 1, N - 1, I...>::type;
^
godot-cpp/include/core/Godot.hpp:170:14: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <int... I>
^
godot-cpp/include/core/Godot.hpp:172:15: warning: alias declarations are a C++11
extension [-Wc++11-extensions]
using type = __Sequence<I...>;
^
godot-cpp/include/core/Godot.hpp:176:34: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class R, class... As>
^
godot-cpp/include/core/Godot.hpp:181:15: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <int... I>
^
godot-cpp/include/core/Godot.hpp:187:25: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class... As>
^
godot-cpp/include/core/Godot.hpp:191:15: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <int... I>
^
godot-cpp/include/core/Godot.hpp:197:34: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class R, class... As>
^
godot-cpp/include/core/Godot.hpp:208:81: error: expected '(' for function-style
cast or type construction
...obj, arg, typename __construct_sequence<sizeof...(As)>::type{});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
godot-cpp/include/core/Godot.hpp:213:34: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class R, class... As>
^
godot-cpp/include/core/Godot.hpp:215:21: warning: alias declarations are a C++11
extension [-Wc++11-extensions]
using MethodType = _WrappedMethod<T, R, As...>;
^
godot-cpp/include/core/Godot.hpp:221:34: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class R, class... As>
^
godot-cpp/include/core/Godot.hpp:226:34: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class R, class... A>
^
godot-cpp/include/core/Godot.hpp:231:34: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class R, class... A>
^
godot-cpp/include/core/Godot.hpp:427:25: warning: variadic templates are a C++11
extension [-Wc++11-extensions]
template <class T, class... Args>
^
29 warnings and 8 errors generated.
scons: *** [src/gdlibrary.os] Error 1
scons: building terminated because of errors.
19PHOBOSS98:gdprocmesh kim$

Build issues on Linux

12c5f35
SConstruct.txt

Errors

CC @karroffel

clang6/linux:

clang++ -o src/gdprocmesh.os -c -fPIC -g -O3 -std=c++14 -fPIC -I. -Isrc -Igodot-cpp/godot_headers -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen src/gdprocmesh.cpp
src/gdprocmesh.cpp:50:25: error: non-const lvalue reference to type 'godot::String' cannot bind to a
      temporary of type 'godot::String'
        if (p_name.begins_with(String("nodes/"))) {
                               ^~~~~~~~~~~~~~~~
godot-cpp/include/core/String.hpp:73:27: note: passing argument to parameter 's' here
        bool begins_with(String &s) const;
                                 ^
src/gdprocmesh.cpp:88:25: error: non-const lvalue reference to type 'godot::String' cannot bind to a
      temporary of type 'godot::String'
        if (p_name.begins_with(String("nodes/"))) {
                               ^~~~~~~~~~~~~~~~
godot-cpp/include/core/String.hpp:73:27: note: passing argument to parameter 's' here
        bool begins_with(String &s) const;
                                 ^
src/gdprocmesh.cpp:441:24: error: non-const lvalue reference to type 'godot::String' cannot bind to
      a temporary of type 'godot::String'
                if (name.begins_with(String("Surface_"))) {
                                     ^~~~~~~~~~~~~~~~~~
godot-cpp/include/core/String.hpp:73:27: note: passing argument to parameter 's' here
        bool begins_with(String &s) const;
                                 ^
In file included from src/gdprocmesh.cpp:1:
In file included from src/gdprocmesh.h:4:
godot-cpp/include/core/Godot.hpp:59:10: warning: returning reference to local temporary object
      [-Wreturn-stack-address]
                return a;
                       ^
godot-cpp/include/core/Godot.hpp:196:35: note: in instantiation of member function
      'godot::_ArgCast<const godot::Ref<godot::GDProcNode> &>::_arg_cast' requested here
                *ret = (obj->*f)( _ArgCast<As>::_arg_cast(*args[I])... );
                                                ^
godot-cpp/include/core/Godot.hpp:223:10: note: in instantiation of function template specialization
      'godot::_WrappedMethod<godot::GDProcMesh, int, const godot::Ref<godot::GDProcNode> &,
      int>::apply<0, 1>' requested here
        method->apply(var, obj, arg, typename __construct_sequence<sizeof...(As)>::type {});
                ^
godot-cpp/include/core/Godot.hpp:240:35: note: in instantiation of function template specialization
      'godot::__wrapped_method<godot::GDProcMesh, int, const godot::Ref<godot::GDProcNode> &, int>'
      requested here
        return (__godot_wrapper_method) &__wrapped_method<T, R, As...>;
                                         ^
godot-cpp/include/core/Godot.hpp:278:43: note: in instantiation of function template specialization
      'godot::___get_wrapper_function<godot::GDProcMesh, int, const godot::Ref<godot::GDProcNode> &,
      int>' requested here
        method.method = (__godot_wrapper_method) ___get_wrapper_function(method_ptr);
                                                 ^
src/gdprocmesh.cpp:248:2: note: in instantiation of function template specialization
      'godot::register_method<int (godot::GDProcMesh::*)(const godot::Ref<godot::GDProcNode> &,
      int)>' requested here
        register_method("add_node", &GDProcMesh::add_node);
        ^
1 warning and 3 errors generated.
scons: *** [src/gdprocmesh.os] Error 1
scons: building terminated because of errors.

gcc6/linux

g++ -o src/gdprocmesh.os -c -fPIC -g -O3 -std=c++14 -fPIC -I. -Isrc -Igodot-cpp/godot_headers -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen src/gdprocmesh.cpp
src/gdprocmesh.cpp: In member function 'godot::Variant godot::GDProcMesh::_get(godot::String)':
src/gdprocmesh.cpp:50:25: error: cannot bind non-const lvalue reference of type 'godot::String&' to an rvalue of type 'godot::String'
  if (p_name.begins_with(String("nodes/"))) {
                         ^~~~~~~~~~~~~~~~
In file included from godot-cpp/include/core/Vector3.hpp:6:0,
                 from godot-cpp/include/core/AABB.hpp:4,
                 from godot-cpp/include/core/CoreTypes.hpp:6,
                 from godot-cpp/include/core/Godot.hpp:11,
                 from src/gdprocmesh.h:4,
                 from src/gdprocmesh.cpp:1:
godot-cpp/include/core/String.hpp:73:7: note:   initializing argument 1 of 'bool godot::String::begins_with(godot::String&) const'
  bool begins_with(String &s) const;
       ^~~~~~~~~~~
src/gdprocmesh.cpp: In member function 'bool godot::GDProcMesh::_set(godot::String, godot::Variant)':
src/gdprocmesh.cpp:88:25: error: cannot bind non-const lvalue reference of type 'godot::String&' to an rvalue of type 'godot::String'
  if (p_name.begins_with(String("nodes/"))) {
                         ^~~~~~~~~~~~~~~~
In file included from godot-cpp/include/core/Vector3.hpp:6:0,
                 from godot-cpp/include/core/AABB.hpp:4,
                 from godot-cpp/include/core/CoreTypes.hpp:6,
                 from godot-cpp/include/core/Godot.hpp:11,
                 from src/gdprocmesh.h:4,
                 from src/gdprocmesh.cpp:1:
godot-cpp/include/core/String.hpp:73:7: note:   initializing argument 1 of 'bool godot::String::begins_with(godot::String&) const'
  bool begins_with(String &s) const;
       ^~~~~~~~~~~
src/gdprocmesh.cpp: In member function 'void godot::GDProcMesh::_update()':
src/gdprocmesh.cpp:441:24: error: cannot bind non-const lvalue reference of type 'godot::String&' to an rvalue of type 'godot::String'
   if (name.begins_with(String("Surface_"))) {
                        ^~~~~~~~~~~~~~~~~~
In file included from godot-cpp/include/core/Vector3.hpp:6:0,
                 from godot-cpp/include/core/AABB.hpp:4,
                 from godot-cpp/include/core/CoreTypes.hpp:6,
                 from godot-cpp/include/core/Godot.hpp:11,
                 from src/gdprocmesh.h:4,
                 from src/gdprocmesh.cpp:1:
godot-cpp/include/core/String.hpp:73:7: note:   initializing argument 1 of 'bool godot::String::begins_with(godot::String&) const'
  bool begins_with(String &s) const;
       ^~~~~~~~~~~
In file included from src/gdprocmesh.h:4:0,
                 from src/gdprocmesh.cpp:1:
godot-cpp/include/core/Godot.hpp: In instantiation of 'static T godot::_ArgCast<T>::_arg_cast(godot::Variant) [with T = const godot::Ref<godot::GDProcNode>&]':
godot-cpp/include/core/Godot.hpp:196:44:   required from 'void godot::_WrappedMethod<T, R, As>::apply(godot::Variant*, T*, godot::Variant**, godot::__Sequence<I ...>) [with int ...I = {0, 1}; T = godot::GDProcMesh; R = int; As = {const godot::Ref<godot::GDProcNode>&, int}]'
godot-cpp/include/core/Godot.hpp:223:2:   required from 'godot_variant godot::__wrapped_method(godot_object*, void*, void*, int, godot_variant**) [with T = godot::GDProcMesh; R = int; As = {const godot::Ref<godot::GDProcNode>&, int}; godot_object = void]'
godot-cpp/include/core/Godot.hpp:240:9:   required from 'godot_variant (* godot::___get_wrapper_function(R (T::*)(As ...)))(godot_object*, void*, void*, int, godot_variant**) [with T = godot::GDProcMesh; R = int; As = {const godot::Ref<godot::GDProcNode>&, int}; godot::__godot_wrapper_method = godot_variant (*)(void*, void*, void*, int, godot_variant**); godot_object = void]'
godot-cpp/include/core/Godot.hpp:278:66:   required from 'void godot::register_method(const char*, M, godot_method_rpc_mode) [with M = int (godot::GDProcMesh::*)(const godot::Ref<godot::GDProcNode>&, int)]'
src/gdprocmesh.cpp:248:51:   required from here
godot-cpp/include/core/Godot.hpp:59:10: warning: returning reference to temporary [-Wreturn-local-addr]
   return a;
          ^
scons: *** [src/gdprocmesh.os] Error 1
scons: building terminated because of errors.

Changing node names does not change property inspector

The name of the input node is reflected in the name of the input property, the name of the output node becomes the name of the surface we update.
Changing these names does not get reflected in the property manager until you re-select the resource.

Stick with surface array or introduce a new input/output?

So right now nodes that work on a surface output (or input) use a surface array required for ArrayMesh to work as the final output.

The nice thing about this is that it is nice and simple and means everything is usable from within Godot but I've been thinking about letting go of this approach.

It makes sense to create a new data object that contains all the data that makes up a mesh with a final "convert to surface array" function to generate the final output. This allows us to add in a lot of meta data such as edges, selections, n-polygons, etc. on which to make modifiers act.

This data object can off course be a GDNative object with an exposed interface as well making it possible to use the object within Godot as well (and keeping the door open to having GDProcNode nodes written in GDScript) but it also means having to provide a class in our input types. Though we could always make the assumption that Variant::OBJECT always refers to our data object.

Food for thought.

Update to 3.1.1?

I wanted to switch to 3.1.1 (since it fixed a bug that affected my project), therefore I had to recompile this as well. However, there is now an error during compilation of gdprocmesh:

g++ -o src/input/gdprocinmesh.os -c -fPIC -g -O3 -std=c++17 -fPIC -I. -Isrc -Igodot-cpp/godot_headers -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen src/input/gdprocinmesh.cpp
src/input/gdprocinmesh.cpp:3:10: fatal error: godot-cpp/src/gen/__icalls.hpp: No such file or directory
 #include "godot-cpp/src/gen/__icalls.hpp"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scons: *** [src/input/gdprocinmesh.os] Error 1
scons: building terminated because of errors.

This happens after checking out and compiling the latest master of godot-cpp (which I assume would be 3.1.1, unfortunately, they are not using tags to make this easy).

(PS: My other issue can still be closed, I cannot do that ;) )

Can't compile on Linux

First steps work well

cd godot-cpp
scons platform=x11 generate_bindings=yes use_custom_api_file=yes custom_api_file=../api.json
cd ..

but on

scons platform=x11

this is the backtrace:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/gdprocmesh.os -c -fPIC -I. -Isrc -Igodot-cpp/godot_headers -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen src/gdprocmesh.cpp
src/gdprocmesh.cpp: In member function 'void godot::GDProcMesh::_update()':
src/gdprocmesh.cpp:645:64: error: call of overloaded 'PoolVector3Array(godot::Variant&)' is ambiguous
} else if (((PoolVector3Array) arr[ArrayMesh::ARRAY_VERTEX]).size() == 0) {
^
In file included from godot-cpp/include/core/Variant.hpp:13,
from godot-cpp/include/core/Dictionary.hpp:4,
from godot-cpp/include/core/CoreTypes.hpp:10,
from godot-cpp/include/core/Godot.hpp:11,
from src/gdprocmesh.h:4,
from src/gdprocmesh.cpp:1:
godot-cpp/include/core/PoolArrays.hpp:566:2: note: candidate: 'godot::PoolVector3Array::PoolVector3Array(const godot::Array&)'
PoolVector3Array(const Array& array);
^~~~~~~~~~~~~~~~
godot-cpp/include/core/PoolArrays.hpp:563:2: note: candidate: 'godot::PoolVector3Array::PoolVector3Array(const godot::PoolVector3Array&)'
PoolVector3Array(const PoolVector3Array &p_other);
^~~~~~~~~~~~~~~~
src/gdprocmesh.cpp:649:59: error: call of overloaded 'PoolIntArray(godot::Variant&)' is ambiguous
} else if (((PoolIntArray) arr[ArrayMesh::ARRAY_INDEX]).size() == 0) {
^
In file included from godot-cpp/include/core/Variant.hpp:13,
from godot-cpp/include/core/Dictionary.hpp:4,
from godot-cpp/include/core/CoreTypes.hpp:10,
from godot-cpp/include/core/Godot.hpp:11,
from src/gdprocmesh.h:4,
from src/gdprocmesh.cpp:1:
godot-cpp/include/core/PoolArrays.hpp:181:2: note: candidate: 'godot::PoolIntArray::PoolIntArray(const godot::Array&)'
PoolIntArray(const Array& array);
^~~~~~~~~~~~
godot-cpp/include/core/PoolArrays.hpp:178:2: note: candidate: 'godot::PoolIntArray::PoolIntArray(const godot::PoolIntArray&)'
PoolIntArray(const PoolIntArray &p_other);
^~~~~~~~~~~~
scons: *** [src/gdprocmesh.os] Error 1
scons: building terminated because of errors.

Option to export only final mesh

When exporting your game it makes sense to export just the ArrayMesh part of the resource and remove the procedural generation. This should be optional as procedural generation using some randomized input may be part of the final game, but in cases where this is not needed and you are just interested in the final result, its just overhead.

Add warning system

While all the nodes check their inputs it would be good to add something where we can check our input and return a validation/warning string. This can then be shown in the interface on the node the warning applies to. Should guide users better.

Vector3 expression node

Hey @Mr-Slurpy ,

Got to play with your expression node finally today. Love it!!
I think we should move it into the transform group instead of the primitive group. It is a node that performs a modification on an input array.

The other thing I was wondering about, and this may be more difficult, but it would be nice if it could have a Vertex3 as an output, or maybe have a version that has a Vertex3 as output. It'll need a larger expression field as it will end up being something like "Vector3(a, sin(b), c)" as an expression (that happened to be what I was using it for).

Editor crashes to desktop when drag n drop gdprocmesh.gdns

Trying out the test project section., doing the following crashes the editor to desktop

Now create a MeshInstance and create an ArrayMesh for this node. You can now drag the gdprocmesh.gdns file into the script property of the ArrayMesh. This will create a simple box as a starting template.

is this no longer compatible/working?

Simplify by only using vec3?

So here is an interesting conundrum. Right now I've duplicated a number of nodes because I need a function to work both on a vec2 and vec3. Seeing our end goal is ultimately to have a 3D mesh I'm contemplating having even the 2d shape nodes output am array of vec3s but with the z component set to 0. That way I don't need the duplication of a lot of nodes.

It could lead to some interesting side effects when a node that expects a 2D shape (like the extrude node) gets a shape where the z components aren't 0 but I don't think thats necessarily bad.

In the same line of thought I'm thinking of always using arrays even when there is a single value, you'll just get an array of size 1. An example of this is the translate node, this gives the option to give an array of translations where so each input vector is translated by a different translation vector..

Food for thought...

Real to int seems to have rounding issues...

In the building model I noticed I'm having issues subtracting 1 to an integer input. I think something gets floor'ed the wrong way.

So take an input of say "5", Subtract 1.0, then input that into an input you end up with it still being 5, or it going down to 3.

I'm not ruling out I screwed something up in the subtract itself, I haven't had time to look at it enough.

Need to add gizmo support

Should find a way to add gizmo's in the 3D viewport depending on the node you have selected in the graph. For instance if you have selected a curve input, being able to modify the curve, if you have a vectors input being able to modify the points in the array, etc. For some it should just be making the current selected node visible somehow even if you can't interact with it.
It'll be tricky but fun :)

Adding a group node

With the more complex models I'm playing with it starts to become very clear that we need more abilities to organize things.

One option I've been thinking about is grouping nodes together into a group node. A group node simply becomes a container of subnodes that are executed as a unit.

There are two things that I'm not sure how best to solve.

  1. we need a way to define what the inputs and outputs of the group node are. When the group node is used in the main graph those become the ins and outs you connect on. Inside however these need to be linked up to the subnodes held within
  2. we need a way to edit the sub graph.

Now this does tie into another discussion that was had where we were thinking about introducing a layer between the arraymesh and the graph and thus making the graph easier to reuse, and it is this inbetween layer that you edit in the graph editor.

So you end up with a tree like so:

+ ArrayMesh/GDProcMesh
  + GDProcGraph
    + GDProcInReal
    + GDProcInReal
    + GDProcBox
    + GDProcGraph
      + GDGraphInput
      + GDProcTransform
      + GDGraphOutput
    + GDProcOutput

So for our main graph:
The two InReal inputs are connected to the x and y of the ProcBox
The ProcBox's output is connected to the input of the ProcGraph
The ProcGraph's output is connected to the ProcOutput to output our mesh.

For our sub graph
The GraphInput is connected to the ProcTransform (which results in the ProcBox output being connected)
The ProcTransform is connected to the GraphOutput (which results in the mesh being the input for our main ProcOutput)

Demo crashes on current godot tip

Just FYI, maybe something needs updating โ€ฆ

compile godot3 tip godotengine/godot@29f2571

cd gdprocmesh
git log -1
commit 7b4537817fac388376c44352cfd8748ab07733b9 (HEAD -> master, origin/master, origin/HEAD)
Author: Bastiaan Olij <[email protected]>
Date:   Thu Aug 30 21:44:26 2018 +1000

    Added a ground plane

git submodule update
godot3 --gdnative-generate-json-api api.json

cd godot-cpp
scons platform=x11 generate_bindings=yes use_custom_api_file=yes custom_api_file=../api.json

cd ..
scons platform=linux

cd demo
godot3 -e
ERROR: load_interactive: Condition ' err != OK ' is true. returned: Ref<ResourceInteractiveLoader>()
   At: core/io/resource_format_binary.cpp:997.
ERROR: _load: Failed loading resource: res://.import/window01.obj-5c85cf881c5e79c77eaca22190b2a88e.mesh
   At: core/io/resource_loader.cpp:190.
ERROR: _load: Failed loading resource: res://Examples/window01.obj
   At: core/io/resource_loader.cpp:190.
ERROR: load_interactive: Condition ' err != OK ' is true. returned: Ref<ResourceInteractiveLoader>()
   At: core/io/resource_format_binary.cpp:997.
ERROR: _load: Failed loading resource: res://.import/window01.obj-5c85cf881c5e79c77eaca22190b2a88e.mesh
   At: core/io/resource_loader.cpp:190.
ERROR: _load: Failed loading resource: res://Examples/window01.obj
   At: core/io/resource_loader.cpp:190.
WARNING: _parse_ext_resource: Couldn't load external resource: res://Examples/window01.obj
   At: scene/resources/scene_format_text.cpp:174.

Thread 1 "godot3" received signal SIGSEGV, Segmentation fault.
Object::get_script_instance_binding () at core/object.cpp:1918
1918		if (!_script_instance_bindings[p_script_language_index]) {


(gdb) l
1913		//it's up to the script language to make this thread safe, if the function is called twice due to threads being out of syncro
1914		//just return the same pointer.
1915		//if you want to put a big lock in the entire function and keep allocated pointers in a map or something, feel free to do it
1916		//as it should not really affect performance much (won't be called too often), as in far most caes the condition below will be false afterwards
1917	
1918		if (!_script_instance_bindings[p_script_language_index]) {
1919			void *script_data = ScriptServer::get_language(p_script_language_index)->alloc_instance_binding_data(this);
1920			if (script_data) {
1921				atomic_increment(&instance_binding_count);
1922				_script_instance_bindings[p_script_language_index] = script_data;


(gdb) bt
#0  Object::get_script_instance_binding () at core/object.cpp:1918
#1  0x0000555555b26a5d in NativeScriptLanguage::get_instance_binding_data () at modules/gdnative/nativescript/nativescript.cpp:1310
#2  0x00007fffe0820fd9 in godot::Mesh::___get_from_variant (a=...) at godot-cpp/include/gen/Mesh.hpp:23
#3  godot::Ref<godot::Mesh>::Ref (p_variant=..., this=0x7fffffffc1e0) at godot-cpp/include/core/Ref.hpp:159
#4  godot::GDProcInMesh::set_input (this=this@entry=0x55555e843f10, p_input=...) at src/input/gdprocinmesh.cpp:85
#5  0x00007fffe081a83c in godot::GDProcMesh::_set (this=<optimized out>, p_name=..., p_value=...) at src/gdprocmesh.cpp:153
#6  0x00007fffe081c79d in godot::_WrappedMethod<godot::GDProcMesh, bool, godot::String, godot::Variant>::apply<0, 1> (args=<optimized out>, obj=<optimized out>, 
    ret=0x7fffffffc440, this=<optimized out>) at godot-cpp/include/core/Godot.hpp:196
#7  godot::__wrapped_method<godot::GDProcMesh, bool, godot::String, godot::Variant> (method_data=<optimized out>, user_data=<optimized out>, num_args=<optimized out>, 
    args=<optimized out>) at godot-cpp/include/core/Godot.hpp:223
#8  0x0000555555b2aae8 in NativeScriptInstance::set () at modules/gdnative/nativescript/nativescript.cpp:584
#9  0x0000555557750c5c in Object::set () at core/object.cpp:413
#10 0x000055555709693f in ResourceInteractiveLoaderText::poll () at scene/resources/scene_format_text.cpp:598
#11 0x000055555795c242 in ResourceFormatLoader::load () at core/io/resource_loader.cpp:142
#12 0x000055555795babb in ResourceLoader::_load () at core/io/resource_loader.cpp:177
#13 0x000055555795bde0 in ResourceLoader::load () at core/io/resource_loader.cpp:219
#14 0x00005555570961b9 in ResourceInteractiveLoaderText::poll () at scene/resources/scene_format_text.cpp:432
#15 0x000055555795c242 in ResourceFormatLoader::load () at core/io/resource_loader.cpp:142
#16 0x000055555795babb in ResourceLoader::_load () at core/io/resource_loader.cpp:177
#17 0x000055555795bde0 in ResourceLoader::load () at core/io/resource_loader.cpp:219
#18 0x00005555570961b9 in ResourceInteractiveLoaderText::poll () at scene/resources/scene_format_text.cpp:432
#19 0x000055555795c242 in ResourceFormatLoader::load () at core/io/resource_loader.cpp:142
#20 0x000055555795babb in ResourceLoader::_load () at core/io/resource_loader.cpp:177
#21 0x000055555795bde0 in ResourceLoader::load () at core/io/resource_loader.cpp:219
#22 0x00005555561008eb in EditorNode::load_scene () at editor/editor_node.cpp:2817
#23 0x0000555556101870 in EditorNode::_sources_changed () at editor/editor_node.cpp:549
#24 0x000055555592e8b4 in MethodBind1<bool>::call () at core/method_bind.gen.inc:729
#25 0x00005555577434fc in Object::call () at core/object.cpp:968
#26 0x000055555774f7db in Object::emit_signal () at core/object.cpp:1254
#27 0x0000555557750825 in Object::emit_signal () at core/object.cpp:1307
#28 0x000055555609964e in EditorFileSystem::_notification () at editor/editor_file_system.cpp:1074
#29 0x0000555557740804 in Object::notification () at core/object.cpp:978
#30 0x0000555556903018 in SceneTree::_notify_group_pause () at scene/main/scene_tree.cpp:957
#31 0x0000555556905bf4 in SceneTree::idle () at scene/main/scene_tree.cpp:510
#32 0x00005555557942c4 in Main::iteration () at main/main.cpp:1800
#33 0x000055555577d9b1 in OS_X11::run () at platform/x11/os_x11.cpp:2785
#34 0x000055555576f42c in main () at platform/x11/godot_x11.cpp:55


(gdb) info threads
  Id   Target Id         Frame 
* 1    Thread 0x7ffff7faa800 (LWP 1169) "godot3" Object::get_script_instance_binding () at core/object.cpp:1918
  2    Thread 0x7ffff7fa9700 (LWP 1174) "godot3" 0x00007ffff5f776d6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x555558f15168)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  3    Thread 0x7fffe9d13700 (LWP 1175) "amdgpu_cs:0" 0x00007ffff5f749f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x555559027624)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  4    Thread 0x7fffe8fb3700 (LWP 1176) "disk_cache:0" 0x00007ffff5f749f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55555902b818)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  5    Thread 0x7fffe3df5700 (LWP 1177) "si_shader:0" 0x00007ffff5f749f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555590305dc)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  6    Thread 0x7fffe35f4700 (LWP 1178) "si_shader_low:0" 0x00007ffff5f749f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555590306e8)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  7    Thread 0x7fffe2df3700 (LWP 1179) "gallium_drv:0" 0x00007ffff5f749f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555590e5ae4)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  8    Thread 0x7fffe8699700 (LWP 1180) "godot3" 0x00007ffff5f776d6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x5555591564b8)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  9    Thread 0x7fffe82b6700 (LWP 1181) "godot3" 0x00007ffff5f78c60 in __GI___nanosleep (requested_time=0x7fffe82b5d70, remaining=0x7fffe82b5d70)
    at ../sysdeps/unix/sysv/linux/nanosleep.c:28
  10   Thread 0x7fffe8275700 (LWP 1182) "godot3" 0x00007ffff51129d0 in __GI___nanosleep (requested_time=requested_time@entry=0x7fffe8274d60, 
    remaining=remaining@entry=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
  11   Thread 0x7fffe20b9700 (LWP 1183) "godot3" 0x00007ffff5f78c60 in __GI___nanosleep (requested_time=0x7fffe20b8c00, remaining=0x7fffe20b8c00)
    at ../sysdeps/unix/sysv/linux/nanosleep.c:28
  12   Thread 0x7fffe2058700 (LWP 1184) "godot3" 0x00007ffff5f776d6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x55555a7c0b58)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  13   Thread 0x7fffe2572700 (LWP 1185) "godot3" 0x00007ffff5f78c60 in __GI___nanosleep (requested_time=0x7fffe2571d80, remaining=0x7fffe2571d80)
    at ../sysdeps/unix/sysv/linux/nanosleep.c:28


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.