armory3d / armortools

3D Content Creation Tools
https://armorpaint.org
Other
3.29k stars 336 forks source link

ArmorPaint build & run issues #1671

Closed gattomanzo closed 3 months ago

gattomanzo commented 9 months ago

used today "git clone --recursive https://github.com/armory3d/armortools"

Followed Compiling instructions exactly step by step on Win 11 22h2, on 12th Gen Intel(R) Core(TM) i9-12900HK 2.90 GHz with these results:

../../../base/Sources/NodeShader.ts:172:7 - error TS2451: Cannot redeclare block-scoped variable 's'.

172 let s = '#define HLSL\n'; ~

../../../base/Sources/NodeShader.ts:211:7 - error TS2451: Cannot redeclare block-scoped variable 'index'.

211 let index = 0;


../../../base/Sources/NodeShader.ts:236:7 - error TS2451: Cannot redeclare block-scoped variable 'num'.

236   let num = 0;

../../../base/Sources/NodeShader.ts:354:7 - error TS2451: Cannot redeclare block-scoped variable 's'.

354 let s = '#define METAL\n'; ~

../../../base/Sources/NodeShader.ts:393:7 - error TS2451: Cannot redeclare block-scoped variable 'index'.

393 let index = 0;


../../../base/Sources/NodeShader.ts:417:7 - error TS2451: Cannot redeclare block-scoped variable 'num'.

417   let num = 0;

../../../base/Sources/UIFiles.ts:8:3 - error TS7008: Member '"/storage/emulated/0/Download"' implicitly has an 'any' type.

8 "/storage/emulated/0/Download"


../../../base/Sources/UIFiles.ts:10:3 - error TS7008: Member '"/Users"' implicitly has an 'any' type.

10   "/Users"

Found 8 errors in 2 files.

Errors Files 6 ../../../base/Sources/NodeShader.ts:172 2 ../../../base/Sources/UIFiles.ts:8 Error: kfile did not call resolve, no project created.

Archilles07 commented 9 months ago

Strange! right cuz it builds perfectly fine in linux: image

But throws error in Windows , i guess dependency error?:

image

lydex256 commented 9 months ago

used today "git clone --recursive https://github.com/armory3d/armortools"

Followed Compiling instructions exactly step by step on Win 11 22h2, on 12th Gen Intel(R) Core(TM) i9-12900HK 2.90 GHz with these results:

../../../base/Sources/NodeShader.ts:172:7 - error TS2451: Cannot redeclare block-scoped variable 's'.

172 let s = '#define HLSL\n'; ~

../../../base/Sources/NodeShader.ts:211:7 - error TS2451: Cannot redeclare block-scoped variable 'index'.

211 let index = 0; ~

../../../base/Sources/NodeShader.ts:236:7 - error TS2451: Cannot redeclare block-scoped variable 'num'.

236 let num = 0; ~~~

../../../base/Sources/NodeShader.ts:354:7 - error TS2451: Cannot redeclare block-scoped variable 's'.

354 let s = '#define METAL\n'; ~

../../../base/Sources/NodeShader.ts:393:7 - error TS2451: Cannot redeclare block-scoped variable 'index'.

393 let index = 0; ~

../../../base/Sources/NodeShader.ts:417:7 - error TS2451: Cannot redeclare block-scoped variable 'num'.

417 let num = 0; ~~~

../../../base/Sources/UIFiles.ts:8:3 - error TS7008: Member '"/storage/emulated/0/Download"' implicitly has an 'any' type.

8 "/storage/emulated/0/Download" ~~~~~~

../../../base/Sources/UIFiles.ts:10:3 - error TS7008: Member '"/Users"' implicitly has an 'any' type.

10 "/Users" ~~~~

Found 8 errors in 2 files.

Errors Files 6 ../../../base/Sources/NodeShader.ts:172 2 ../../../base/Sources/UIFiles.ts:8 Error: kfile did not call resolve, no project created.

When this will be fixed?

gattomanzo commented 9 months ago

tryed again to compile today after the update, but got this error:

../../../base/Sources/NodeShader.ts:176:7 - error TS2451: Cannot redeclare block-scoped variable 's'.

176 let s = '#define HLSL\n'; ~

../../../base/Sources/NodeShader.ts:215:7 - error TS2451: Cannot redeclare block-scoped variable 'index'.

215 let index = 0;


../../../base/Sources/NodeShader.ts:240:7 - error TS2451: Cannot redeclare block-scoped variable 'num'.

240   let num = 0;

../../../base/Sources/NodeShader.ts:358:7 - error TS2451: Cannot redeclare block-scoped variable 's'.

358 let s = '#define METAL\n'; ~

../../../base/Sources/NodeShader.ts:397:7 - error TS2451: Cannot redeclare block-scoped variable 'index'.

397 let index = 0;


../../../base/Sources/NodeShader.ts:421:7 - error TS2451: Cannot redeclare block-scoped variable 'num'.

421   let num = 0;

../../../base/Sources/UIFiles.ts:8:3 - error TS7008: Member '"/storage/emulated/0/Download"' implicitly has an 'any' type.

8 "/storage/emulated/0/Download"


../../../base/Sources/UIFiles.ts:10:3 - error TS7008: Member '"/Users"' implicitly has an 'any' type.

10   "/Users"

Found 8 errors in 2 files.

Errors Files 6 ../../../base/Sources/NodeShader.ts:176 2 ../../../base/Sources/UIFiles.ts:8 Error: kfile did not call resolve, no project created.

gattomanzo commented 9 months ago

hi there, recompiled today with no errors (yay!), put the armorpaint.exe into the build/krom folder, but the program won't start and the process suddendly vanishes from taskmanager's processes

i've instead succeeded in compile & run the Windows DXR wip version :D

JelaMiraj commented 9 months ago

Seems like compile errors of some kind may be persisting on Windows...

Today, 2024.01.29, When compiling on Windows 11 using either git bash or powershell on current commit "f98e732" I got this error about "Unsupported shader language.":

../armorcore/Kinc/make --from ../armorcore -g api Using Kinc (cf24a314) from C:\Tools\Material_Editor\ArmorTools\armorcore\Kinc kfile found. Creating Windows project files. Using ArmorCore from C:\Tools\Material_Editor\ArmorTools\armorcore. Creating ArmorCore project files. Exporting asset 1 of 26 (brdf.png). Exporting asset 2 of 26 (color_wheel.png). Exporting asset 3 of 26 (color_wheel_gradient.png). Exporting asset 4 of 26 (cursor.png). Exporting asset 5 of 26 (font.ttf). Exporting asset 6 of 26 (font_mono.ttf). Exporting asset 7 of 26 (icons.png). Exporting asset 8 of 26 (icons2x.png). Exporting asset 9 of 26 (ltc_mag.arm). Exporting asset 10 of 26 (ltc_mat.arm). Exporting asset 11 of 26 (noise256.png). Exporting asset 12 of 26 (shader_datas.arm). Exporting asset 13 of 26 (smaa_area.png). Exporting asset 14 of 26 (smaa_search.png). Exporting asset 15 of 26 (text_coloring.json). Exporting asset 16 of 26 (World_irradiance.arm). Exporting asset 17 of 26 (World_radiance.hdr). Exporting asset 18 of 26 (World_radiance_0.hdr). Exporting asset 19 of 26 (World_radiance_1.hdr). Exporting asset 20 of 26 (World_radiance_2.hdr). Exporting asset 21 of 26 (World_radiance_3.hdr). Exporting asset 22 of 26 (World_radiance_4.hdr). Exporting asset 23 of 26 (World_radiance_5.hdr). Exporting asset 24 of 26 (World_radiance_6.hdr). Exporting asset 25 of 26 (World_radiance_7.hdr). Exporting asset 26 of 26 (World_radiance_8.hdr). Exporting asset 1 of 10 (de.json). Exporting asset 2 of 10 (el.json). Exporting asset 3 of 10 (en_US.json). Exporting asset 4 of 10 (es.json). Exporting asset 5 of 10 (fr.json). Exporting asset 6 of 10 (ja.json). Exporting asset 7 of 10 (pl.json). Exporting asset 8 of 10 (pt_br.json). Exporting asset 9 of 10 (ru.json). Exporting asset 10 of 10 (zh_cn.json). Exporting asset 1 of 9 (license_fonts.md). Exporting asset 2 of 9 (license_icons.md). Exporting asset 3 of 9 (license_kinc.md). Exporting asset 4 of 9 (license_lz4-wasm.md). Exporting asset 5 of 9 (license_nfd.md). Exporting asset 6 of 9 (license_stb.md). Exporting asset 7 of 9 (license_tinydir.md). Exporting asset 8 of 9 (license_v8.md). Exporting asset 9 of 9 (license_zlib.md). Exporting asset 1 of 3 (autosave.js). Exporting asset 2 of 3 (import_tiff.js). Exporting asset 3 of 3 (import_txt.js). Exporting asset 1 of 1 (light.json). Exporting asset 1 of 1 (version.json). Exporting asset 1 of 4 (badge.png). Exporting asset 2 of 4 (default_brush.arm). Exporting asset 3 of 4 (default_material.arm). Exporting asset 4 of 4 (Scene.arm). Exporting asset 1 of 7 (base_color.json). Exporting asset 2 of 7 (generic.json). Exporting asset 3 of 7 (minecraft_mer.json). Exporting asset 4 of 7 (unigine.json). Exporting asset 5 of 7 (unity.json). Exporting asset 6 of 7 (unreal.json). Exporting asset 7 of 7 (xplane.json). Exporting asset 1 of 2 (blender.json). Exporting asset 2 of 2 (touch.json). Exporting asset 1 of 7 (license.md). Exporting asset 2 of 7 (license_cycles_nodes.md). Exporting asset 3 of 7 (license_cgltf.md). Exporting asset 4 of 7 (license_nanosvg.md). Exporting asset 5 of 7 (license_tinyusdz.md). Exporting asset 6 of 7 (license_utif.md). Exporting asset 7 of 7 (license_xatlas.md). Exporting asset 1 of 11 (hello_node.js). Exporting asset 2 of 11 (hello_node_brush.js). Exporting asset 3 of 11 (hello_world.js). Exporting asset 4 of 11 (import_fbx.js). Exporting asset 5 of 11 (import_gltf_glb.js). Exporting asset 6 of 11 (import_stl.js). Exporting asset 7 of 11 (import_svg.js). Exporting asset 8 of 11 (import_usdc.js). Exporting asset 9 of 11 (texture_breakdown.js). Exporting asset 10 of 11 (uv_unwrap.js). Exporting asset 11 of 11 (viewport_celshade.js). Exporting asset 1 of 1 (cube_shared_uvs.arm). Exporting asset 1 of 1 (readme.txt). Exporting asset 1 of 1 (ammo.js). Error: Unsupported shader language. at Function.findType (eval at (eval at (node:kmake/Project:109:27)), :421:10) at new ShaderCompiler (eval at (eval at (node:kmake/Project:109:27)), :386:30) at exportArmorCoreProject (eval at (eval at (node:kmake/Project:109:27)), :1119:23) at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async exportProject (eval at (eval at (node:kmake/Project:109:27)), :1198:10) at async run (eval at (eval at (node:kmake/Project:109:27)), :1240:10) at async make_run (eval at (eval at (node:kmake/Project:109:27)), :1251:3) at async eval (eval at (node:kmake/Project:109:27), :37:2) Error: kfile did not call resolve, no project created.

I'm also a bit uneasy about this potential error in a previous step:

./armorcore/Kinc/make --from base/Tools --kfile extract_locales.js Using Kinc (cf24a314) from C:\Tools\Material_Editor\ArmorTools\armorcore\Kinc kfile found. Creating Windows project files. Error: kfile did not call resolve, no project created.

JelaMiraj commented 9 months ago

I assume checking out main branch current commit is the preferred method to compile and not a specific other branch or tag?

bencresty commented 8 months ago

Unfortunately still the same here. Builds just fine with 0 errors, but doesn't run (windows 11 here). Would've been nice to use this, but guess it's currently impossible.

Asozialix commented 8 months ago

same problem here under windows 10 with direct3d11 as graphics API, what worked for me was to either use

  1. opengl command: ..\armorcore\Kinc\make --from ..\armorcore -g opengl
  2. or the Windows DXR wip (performance might be terrible)
TKyleB commented 8 months ago

same problem here under windows 10 with direct3d11 as graphics API, what worked for me was to either use

  1. opengl command: ..\armorcore\Kinc\make --from ..\armorcore -g opengl
  2. or the Windows DXR wip (performance might be terrible)

This worked for me to getting the program to successfully run. However, when the program launches it is just a black window.

lydex256 commented 8 months ago

same problem here under windows 10 with direct3d11 as graphics API, what worked for me was to either use

1. opengl command: **..\armorcore\Kinc\make --from ..\armorcore -g opengl**

2. or the Windows DXR wip (performance might be terrible)

It works, thx

PickleKid07 commented 8 months ago

same problem here under windows 10 with direct3d11 as graphics API, what worked for me was to either use

  1. opengl command: ..\armorcore\Kinc\make --from ..\armorcore -g opengl
  2. or the Windows DXR wip (performance might be terrible)

This works, Thank you @Asozialix.

nickenchev commented 8 months ago

I'm also unable to start armorpaint when generating the build with direct3d11 as the API, is the solution at this point to reconfigure and rebuild with -g opengl on Windows 11?

radicalaction commented 8 months ago

Same on arch. Neither GL nor VKRT compiles for me

Bromeon commented 7 months ago

Unfortunately still the same here. Builds just fine with 0 errors, but doesn't run (windows 11 here). Would've been nice to use this, but guess it's currently impossible.

Same issue on Windows 10. I tried all three Graphic drivers and recompiled the VS solution after each:

..\armorcore\Kinc\make --from ..\armorcore -g direct3d11
..\armorcore\Kinc\make --from ..\armorcore -g opengl
..\armorcore\Kinc\make --from ..\armorcore -g direct3d12 # after applying DXR patch

then moved ArmorPaint.exe to armorpaint/build/krom each time.

When launching it, a process starts and uses quite a bit of CPU, but no window opens. This happens in all three cases.

Is there something I can do here? I'd really like to try out ArmorPaint 🙂

think-about-3 commented 7 months ago

@Bromeon Maybe I'm wrong. Is it the starting problem that has been known for weeks? Then the script from "SiKo117" (issue number 1678) would help. I've been using the script for some time now. My current script settings: "wait_time=0.2" and "max_runs=100"

seansimonanimation commented 7 months ago

I'm not sure if I'm supposed to post this here or in a new issue, but I'm having a completely different set of obstructions to compiling Armorpaint.

The issue I'm running into is that it's looking for unistd.h (which I have come to find out is a Linux header) on a Windows 11 system. I've tried finding a port which does exist, but when I make the include point to it, a ton of other issues pop up (not pictured).

image

Unrelated, but I did manage to get it to compile and run in WSL, though there was no pen pressure. I'd like to do the native Windows build if I can. Does anyone have any ideas?

think-about-3 commented 7 months ago

@seansimonanimation Yesterday I also had this error message. No more problems today. However, I need 70 startup attempts. So I'll use the recommended script from "SiKo117" (issue number 1678) again. My current script settings: "wait_time=0.2" and "max_runs=100"

MathemanFlo commented 7 months ago

Maybe one could reduce frustration and problems by guiding people to 23.08 This version should build and run more smoothly.

think-about-3 commented 6 months ago

@MathemanFlo Thanks for the tip. But I have no idea how to compile an older version. Without precise step by step instructions I'm lost.

radicalaction commented 6 months ago

@MathemanFlo Yeah, thanks for the tip. It seems to compile well but I don't see ArmorPaint in Deployment after compiling, only Armory, also there is no krom.js that it attempts to run with.

lydex256 commented 6 months ago

Maybe one could reduce frustration and problems by guiding people to 23.08 This version should build and run more smoothly.

Can you give tutorial to clone this branch? (Pls:))

think-about-3 commented 6 months ago

@MathemanFlo
Thanks again for the tip. So it finally worked for me with version 23.08. I had a few unsuccessful attempts with >> git checkout << and >> git reset << at first. But with
>>>>> git clone --recursive --branch 23.08 https://github.com/armory3d/armortools <<<<<
the compilation worked smoothly. The 23.08 starts with one click. And the brush mask works too. The current 1.0 alpha crashes every time I want to activate an image texture for the mask in the brush nodes. I'm happy for now. @radicalaction and @cosM-green Could you please test it like this and give me feedback?

Update (2024-05-14): For the recommended version 23.08 don't forget to extract v8_monolith.7z. ... # Unpack ..\armorcore\v8\libraries\win32\release\v8_monolith.7z using 7-Zip - Extract Here (exceeds 100MB) ..\armorcore\Kinc\make --from ..\armorcore -g direct3d11 ... https://github.com/armory3d/armortools/tree/23.08/armorpaint

Update (2024-06-06): Detailed text in my cloud: "Compile and start ArmorPaint". --> http://e.pc.cd/h2Yy6alK The text is immediately displayed in the browser. It is of course also possible to download the file (pdf).

lydex256 commented 6 months ago

@MathemanFlo Thanks again for the tip. So it finally worked for me with version 23.08. I had a few unsuccessful attempts with >> git checkout << and >> git reset << at first. But with >>>>> git clone --recursive --branch 23.08 https://github.com/armory3d/armortools <<<<< the compilation worked smoothly. The 23.08 starts with one click. And the brush mask works too. The current 1.0 alpha crashes every time I want to activate an image texture for the mask in the brush nodes. I'm happy for now. @radicalaction and @cosM-green Could you please test it like this and give me feedback?

I'll try, but I'm not good at compiling older tags

think-about-3 commented 6 months ago

@cosM-green It works with the recommended instructions. Only the git clone command needs to be changed for 23.08.

Update (2024-05-14): For the version 23.08 don't forget to extract v8_monolith.7z. ... # Unpack ..\armorcore\v8\libraries\win32\release\v8_monolith.7z using 7-Zip - Extract Here (exceeds 100MB) ..\armorcore\Kinc\make --from ..\armorcore -g direct3d11 ... https://github.com/armory3d/armortools/tree/23.08/armorpaint

The goal should look like this (600d7c7): armorpaint-23-08

Update (2024-06-06): Detailed text in my cloud: "Compile and start ArmorPaint". --> http://e.pc.cd/h2Yy6alK The text is immediately displayed in the browser. It is of course also possible to download the file (pdf).

lydex256 commented 6 months ago

@cosM-green It works with the recommended instructions. Only the git clone command needs to be changed for 23.08. The goal should look like this (600d7c7): armorpaint-23-08

Ok, thanks. I'll try tomorrow

radicalaction commented 6 months ago

@think-about-3 No, doesn't work for me. It won't even compile, switching to 23.08 tag with checkout was a better option for me. Thanks anyway!

think-about-3 commented 6 months ago

I used this guide for myself: How to Install ArmorPaint (Build ArmorPaint from source) 2023 https://www.youtube.com/watch?v=SSuldv-Kg_s
I wouldn't have been able to compile it without these detailed instructions. Maybe there will be some positive feedback: >>>git clone --recursive --branch 23.08 https://github.com/armory3d/armortools<<<

Update (2024-05-14): For the recommended version 23.08 don't forget to extract v8_monolith.7z. ... # Unpack ..\armorcore\v8\libraries\win32\release\v8_monolith.7z using 7-Zip - Extract Here (exceeds 100MB) ..\armorcore\Kinc\make --from ..\armorcore -g direct3d11 ... https://github.com/armory3d/armortools/tree/23.08/armorpaint

Update (2024-06-06): Detailed text in my cloud: "Compile and start ArmorPaint". --> http://e.pc.cd/h2Yy6alK The text is immediately displayed in the browser. It is of course also possible to download the file (pdf).

KingOfCaves commented 6 months ago

@seansimonanimation Pretty much running into the exact same issue but with 'streams.h' on Windows 10. Went through a bunch of hoops to get the baseclasses that come with the Win7 SDK, only for it to lead to more issues and errors.

rider64_FYAdPDCQFZ

TheBeardOfTruth commented 4 months ago

Working on an AUR package for armorpaint v0.9 (there is a git package but it's broken, either way 0.9 stable may be seen as preferable to current 1.0 alpha which has some build issues).

armorpaint 0.9 does not build on linux due to not building with -Wint-conversion and some very dubious code in zui

../../../armorcore/Sources/zui/zui_ext.c:501:38: error: incompatible pointer to integer conversion passing 'char[1]' to parameter of type 'int' [-Wint-conversion]
  501 |                                 zui_text(label, ZUI_ALIGN_RIGHT, "");
      |                                                                  ^~

../../../armorcore/Sources/zui/zui_nodes.c:411:25: error: incompatible pointer to integer conversion assigning to 'int' from 'void *' [-Wint-conversion]
  411 |                         but_handle->position = but->default_value;
      |                                              ^ 

../../../armorcore/Sources/zui/zui_nodes.c:577:153: error: incompatible pointer to integer conversion passing 'zui_node_socket_t **' (aka 'struct zui_node_socket **') to parameter of type 'int' [-Wint-conversion]
  577 |                 float to_y = to == NULL ? current->input_y : wy + ZUI_NODE_Y(to) + ZUI_INPUT_Y(canvas, to->inputs, to->inputs_count, link->to_socket) + ZUI_OUTPUTS_H(to->outputs, to->outputs_count) + ZUI_BUTTONS_H(to);
      |                                                                                                                                                                       ^

../../../armorcore/Sources/zui/zui_nodes.c:629:108: error: incompatible pointer to integer conversion passing 'zui_node_socket_t **' (aka 'struct zui_node_socket **') to parameter of type 'int' [-Wint-conversion]
  629 |                                                         float sy = wy + ZUI_NODE_Y(node) + ZUI_INPUT_Y(canvas, inps, node->inputs_count, k) + ZUI_OUTPUTS_H(outs, node->outputs_count) + ZUI_BUTTONS_H(node);
      |                                                                                                                                                             ^

../../../armorcore/Sources/zui/zui_nodes.c:718:106: error: incompatible pointer to integer conversion passing 'zui_node_socket_t **' (aka 'struct zui_node_socket **') to parameter of type 'int' [-Wint-conversion]
  718 |                                         float sy = wy + ZUI_NODE_Y(node) + ZUI_INPUT_Y(canvas, inps, node->inputs_count, j) + ZUI_OUTPUTS_H(outs, node->outputs_count) + ZUI_BUTTONS_H(node);
      |                                                                                                                                             ^

I patched the relevant errors for the AUR build script but I'll provide them here as well

--- "zui_ext (old).c"   2024-06-22 17:40:55.209449819 +0200
+++ zui_ext.c   2024-06-22 17:49:52.774575838 +0200
@@ -498,7 +498,7 @@
            if (show_label) {
                int TEXT_COL = current->ops.theme.TEXT_COL;
                current->ops.theme.TEXT_COL = current->ops.theme.LABEL_COL;
-               zui_text(label, ZUI_ALIGN_RIGHT, "");
+               zui_text(label, ZUI_ALIGN_RIGHT, 0x0); //patch: originally assigned "" (char[1]) which is illegal since char[1] doesn't strictly speaking cast to int.
                current->ops.theme.TEXT_COL = TEXT_COL;
            }
            else {
--- "zui_nodes (old).c" 2024-06-22 17:20:15.573260998 +0200
+++ zui_nodes.c 2024-06-22 18:23:27.557218816 +0200
@@ -408,7 +408,7 @@
            current->_w = w;
            // char **texts = Std.isOfType(but->data, Array) ? [for (s in cast(but->data, Array<Dynamic>)) zui_tr(s)] : zui_enum_texts(node->type);
            zui_handle_t *but_handle = zui_nest(nhandle, buti);
-           but_handle->position = but->default_value;
+           but_handle->position = *((int*)but->default_value); //patch: attempting to assign void pointer to integer is not strictly allowed, unfucked it a bit. Typecast to int then dereference before assigning.
            // but->default_value = zui_combo(but_handle, texts, zui_tr(but->name));
            if (current->is_hovered && but->tooltip != NULL) zui_tooltip(zui_tr(but->tooltip));
        }
@@ -574,7 +574,7 @@
        float from_x = from == NULL ? current->input_x : wx + ZUI_NODE_X(from) + ZUI_NODE_W(from);
        float from_y = from == NULL ? current->input_y : wy + ZUI_NODE_Y(from) + ZUI_OUTPUT_Y(from->outputs, from->outputs_count, link->from_socket);
        float to_x = to == NULL ? current->input_x : wx + ZUI_NODE_X(to);
-       float to_y = to == NULL ? current->input_y : wy + ZUI_NODE_Y(to) + ZUI_INPUT_Y(canvas, to->inputs, to->inputs_count, link->to_socket) + ZUI_OUTPUTS_H(to->outputs, to->outputs_count) + ZUI_BUTTONS_H(to);
+       float to_y = to == NULL ? current->input_y : wy + ZUI_NODE_Y(to) + ZUI_INPUT_Y(canvas, to->inputs, to->inputs_count, link->to_socket) + ZUI_OUTPUTS_H(to->outputs_count, -1) + ZUI_BUTTONS_H(to); //patch: tries to assign zui_node_socket_t** to int, don't know why. fixed the line based on what the function appears to expect. It should compile, may have visual issues.

        // Cull
        float left = to_x > from_x ? from_x : to_x;
@@ -626,7 +626,7 @@
                    else if (to == NULL && node->id != from->id) { // Snap to input
                        for (int k = 0; k < node->inputs_count; ++k) {
                            float sx = wx + ZUI_NODE_X(node);
-                           float sy = wy + ZUI_NODE_Y(node) + ZUI_INPUT_Y(canvas, inps, node->inputs_count, k) + ZUI_OUTPUTS_H(outs, node->outputs_count) + ZUI_BUTTONS_H(node);
+                           float sy = wy + ZUI_NODE_Y(node) + ZUI_INPUT_Y(canvas, inps, node->inputs_count, k) + ZUI_OUTPUTS_H(node->outputs_count, -1) + ZUI_BUTTONS_H(node); //patch: see line 577 for logic, same fix
                            float rx = sx - ZUI_LINE_H() / 2;
                            float ry = sy - ZUI_LINE_H() / 2;
                            if (zui_input_in_rect(rx, ry, ZUI_LINE_H(), ZUI_LINE_H())) {
@@ -715,7 +715,7 @@
            if (current_nodes->link_drag == NULL) {
                for (int j = 0; j < node->inputs_count; ++j) {
                    float sx = wx + ZUI_NODE_X(node);
-                   float sy = wy + ZUI_NODE_Y(node) + ZUI_INPUT_Y(canvas, inps, node->inputs_count, j) + ZUI_OUTPUTS_H(outs, node->outputs_count) + ZUI_BUTTONS_H(node);
+                   float sy = wy + ZUI_NODE_Y(node) + ZUI_INPUT_Y(canvas, inps, node->inputs_count, j) + ZUI_OUTPUTS_H(node->outputs_count, -1) + ZUI_BUTTONS_H(node); //patch see line 577, same fix
                    if (zui_input_in_rect(sx - ZUI_LINE_H() / 2, sy - ZUI_LINE_H() / 2, ZUI_LINE_H(), ZUI_LINE_H())) {
                        // Already has a link - disconnect
                        for (int k = 0; k < canvas->links_count; ++k) {

I do not provide any warranty of merchantability or fitness for any purpose in regards to these patches, the program compiles and appears to work correctly but I haven't the time to really experiment deeply. Since it patches UI elements it may cause some UI issues but I don't think it'll be causing any major problems.

radicalaction commented 4 months ago

@DeusHaeresis real hero.

luboslenco commented 3 months ago

Sorry it's taking so long, hopefully fixed in the coming days.