klepto2 Posted November 20, 2023 Share Posted November 20, 2023 Here is a first version of the Polyhaven-extension polyhaven_browser.zip: This is an early release, but nearly everything should be working. Screenshot: Some notes: There might be some errors while converting some materials. this is due the fact that some materials have multiple diffuse files configured and i am currently assuming a "Diffuse" slot and not the other configured maps. This will be fixed and adressed in a later release. The settings dialog is a proof of concept extension which i plan to release as a standalone extension later and which might be a replacement for the current options dialog in the tools section. The scripts still have some garbage included which i will get rid of in a future release. Download: polyhaven_browser.zip Installation: Extract the content of the zip into your UltraEngine installation folder. The file structure in zip reflects the needed structure to get it working. 5 1 Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
Thirsty Panther Posted November 21, 2023 Share Posted November 21, 2023 This is great. A quick and simple way of getting textures and even models into your project. Quote Link to comment Share on other sites More sharing options...
Josh Posted November 24, 2023 Share Posted November 24, 2023 For Steam users, placing libcurl.dll in the program folder will cause the Steamworks library to crash: https://steamcommunity.com/groups/steamworks/discussions/0/6699728899096777474/ There are two ways around this. Recompile libcurl to use a different DLL name. I used a precompiled binary because I could not figure out how to compile libcurl with SSL. Before loading the OpenAI module, copy libcurl.dll to the program directory, then load the OpenAI module, then immediately remove the DLL. Not sure if this will work if the DLL is loaded. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted December 3, 2023 Share Posted December 3, 2023 I came across something else when looking at the OpenAI API. It appears that the executable curl does work with authorization maybe: curl https://api.openai.com/v1/images/edits \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -F image="@sunlit_lounge.png" \ -F mask="@mask.png" \ -F model="dall-e-2" \ -F prompt="A sunlit indoor lounge area with a pool containing a flamingo" \ -F n=1 \ -F size="1024x1024" Curl comes standard on win10 and 11 now. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
klepto2 Posted December 4, 2023 Author Share Posted December 4, 2023 I will try the curl approach later. you can also add a refferer to curl.exe which could be used to fully support some api licenses. Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
Josh Posted December 4, 2023 Share Posted December 4, 2023 Yeah, if you look in OpenAI.lua there are two different calls that use two different approaches. One is using the default content type, and then the other is using JSON. The only tricky part was figuring out how to encode JSON in a command line and then encode that in a Lua file. So, for every quotation mark you have to replace it with \\\" If you use curl instead of curl.exe, it will make the script cross-platform compatible, I think. Interesting stuff, anyways. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted December 12, 2023 Share Posted December 12, 2023 When opening the Poly Haven plugin from the top drop down menu I keep getting a Stack Size error then immediate shutdown. Also the 'settings' option under neath the Poly Haven option on the drop down is of very small scale. Unlike other pop up windows throughout the editor. Quote ITCH.io LE 4.6 Games YouTube Channel Featuring LE 4.6 Link to comment Share on other sites More sharing options...
Josh Posted December 12, 2023 Share Posted December 12, 2023 4 hours ago, Alienhead said: Also the 'settings' option under neath the Poly Haven option on the drop down is of very small scale. Unlike other pop up windows throughout the editor. This is probably because it does not use DPI scaling, but this extension is not part of the editor so this should be reported to the author. I will take a look at the stack size error. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
klepto2 Posted December 13, 2023 Author Share Posted December 13, 2023 The settings are more or less a prototype done shortly before the beta release. I have not used any dpi scaling in the plugin but i plan to include it in a refactored version. the stacksize error is new for me. Looks like a stack error with lua. could probably be a problem with either the dll for fetching the polyhaven api or the small json to lua extension i have added. I will investigate both. Also as Josh said the polyhaven is not an official plugin, so bug reports should be added here: or you could send me a PM. 1 Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
Josh Posted December 15, 2023 Share Posted December 15, 2023 I am unable to produce this error. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted December 17, 2023 Share Posted December 17, 2023 Hi Klepto, just letting you know that I'm getting the "stack size error" as well. I haven't done anything other than install and launch the extension. Quote Link to comment Share on other sites More sharing options...
klepto2 Posted December 18, 2023 Author Share Posted December 18, 2023 10 hours ago, SpiderPig said: Hi Klepto, just letting you know that I'm getting the "stack size error" as well. I haven't done anything other than install and launch the extension. Hi, is it possible to debug the Editor for you? if you have installed VSCode you can go to the Ultraengine directory and run the Open with VSCode.bat and then Run -> Start Debugging. Also does the error occur just by opening the window (Polyhaven) or after selecting a node? Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
SpiderPig Posted December 18, 2023 Share Posted December 18, 2023 3 hours ago, klepto2 said: Also does the error occur just by opening the window (Polyhaven) or after selecting a node? As soon as the Polyhaven window opens the error is there. I'll look into debugging with VSCode tomorrow evening. Hopefully have some more info then. Quote Link to comment Share on other sites More sharing options...
klepto2 Posted December 18, 2023 Author Share Posted December 18, 2023 Ok, you might need to allow access to some specific files. these are the files: in main directory: libcurl.dll then Modules/PolyHavenApiClient.dll and finally: Tools/pbr.exe and all dlls under plugins. Hopefully this will solve the issue. Otherwise i look forward for the debugging results. 1 Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
SpiderPig Posted December 18, 2023 Share Posted December 18, 2023 9 hours ago, klepto2 said: in main directory: libcurl.dll then Modules/PolyHavenApiClient.dll and finally: Tools/pbr.exe and all dlls under plugins. These were blocked, unblocking them didn't help though. All the plugins are unblocked already. Interestingly debugging through VSCode gave no errors. It took about 5 seconds to actually load anything but there was no error. Very odd. Quote Link to comment Share on other sites More sharing options...
klepto2 Posted December 19, 2023 Author Share Posted December 19, 2023 So you was able to browse the items while debugging it? or was there just no error but still no treeview available? I am currently rewriting some internals to not rely on dlls that much. I will provide a small test later which rewrites the first step (treeview populating) using curl and Command an LoadTable instead of the custom dll for accessing the api. If that solves the problems i will rewrite the other api calls as well and remove all dll dependecies execept the pbr exe (this is needed for converting the HDR images and should not cause problems). Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
klepto2 Posted December 19, 2023 Author Share Posted December 19, 2023 Polyhaven.lua In this file i have changed the loading for the types and catagories to use curl and the inernal Command and LoadTable functions instead of the custom api dll. Replace this file in the Scripts\Start\Extensions folder. Hopefully this will resolve the initial problems. I will continue to replace the api calls with native curl requests to get rid of the external dll requirements. Let me know if this resolves some of the issues. Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
SpiderPig Posted December 19, 2023 Share Posted December 19, 2023 42 minutes ago, klepto2 said: So you was able to browse the items while debugging it? or was there just no error but still no treeview available? Everything appeared to work when debugging. The treeview populated and I could browse the assets. 15 minutes ago, klepto2 said: In this file i have changed the loading for the types and catagories to use curl and the inernal Command and LoadTable functions instead of the custom api dll. I don't get the error now and the treeview populates but there are no assets showing and "Unknown exception" is printed in the editors console whenever I click a treeview item. Like before, debugging everything works as it should. Quote Link to comment Share on other sites More sharing options...
klepto2 Posted December 19, 2023 Author Share Posted December 19, 2023 Ok, that inidcates that i need to remove the custom module usage. I will continue with it and upload a modfied version in a few minutes (maybe a bit longer ). 1 Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
klepto2 Posted December 19, 2023 Author Share Posted December 19, 2023 New Version: Everything is now wrapped into pure lua except the pbr conversion. Let me know if this works for you. Polyhaven.lua 1 Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
SpiderPig Posted December 19, 2023 Share Posted December 19, 2023 Seems to be working now. Thanks. Quote Link to comment Share on other sites More sharing options...
klepto2 Posted December 19, 2023 Author Share Posted December 19, 2023 Solution for the Stack-Size error is posted here: Working on proper DPI scaling now. 3 Quote Intel® Core™ i7-8550U @ 1.80 Ghz 16GB RAM INTEL UHD Graphics 620 Windows 10 Pro 64-Bit-Version Link to comment Share on other sites More sharing options...
Josh Posted December 28, 2023 Share Posted December 28, 2023 In the future, there is going to be an AsyncCommand() function that will call _wsystem on a separate thread, so all your curl calls can be made asynchronous, even in Lua. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.