xjorma / EarthMeshHoudini

Generate real world meshes in Houdini using the Google API.
Apache License 2.0
208 stars 21 forks source link

KeyError: 'content' #14

Open joreeves opened 2 months ago

joreeves commented 2 months ago

Occasionally get this error for no reason. If I change some of the settings sometimes it goes away.

image

Piminski commented 2 months ago

Started getting similar issues as well. As you mentioned changing the parameters can resolve it but I cannot describe yet what exactly is the cause, seems to be min dist and/or max error...

It may be something has changed on the Google side....

joreeves commented 2 months ago

I've found the problem. It's an edge case where there is only 1 child which has no "content" in it. I've created a pull request.

Piminski commented 2 months ago

image I downloaded your new HDA and test hip file but I get this error

joreeves commented 2 months ago

@Piminski With the updates I made the "scripts" folder needs to be placed relative to your houdini file. Sorry I should've stated that (I guess that's a downside to moving the scripts outside of Houdini). Could you try opening the EarthMesh_Test.hip file and let me know if you get the same error there?

xjorma commented 2 months ago

I will take a look.

On Thu, Jun 27, 2024 at 9:13 PM Josiah Reeves @.***> wrote:

@Piminski https://github.com/Piminski With the updates I made the "scripts" folder needs to be placed relative to your houdini file. Sorry I should've stated that (I guess that's a downside to moving the scripts outside of Houdini). Could you try opening the EarthMesh_Test.hip file and let me know if you get the same error there?

— Reply to this email directly, view it on GitHub https://github.com/xjorma/EarthMeshHoudini/issues/14#issuecomment-2195916180, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFPHGHUSJN6XX2FET5K7KLTZJS2FLAVCNFSM6AAAAABJ6R3WY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJVHEYTMMJYGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

xjorma commented 2 months ago

I submitted a blind fix.

Sorry, @joreeves. I will investigate a bit more. Your fix is certainly more tested than mine. Your code is definitely cleaner, tests more edge cases elegantly, and it's a good idea to have Python as an external file (I dislike the fact that everything is embedded in a binary file in Houdini or Touchdesigner).

However, I wanted more time to see if external files are really a good idea for the end-user (ie; script folder relative path). Additionally, there are too many refactors. Your code is definitely better and easier to maintain, but I also have some local changes to make it work with Houdini Engine (within Unreal, for example).

Can someone validate the fix? or provide me a screen shot with the parameter that cause the issue? (don't forget to make sure your key is not visible)

joreeves commented 2 months ago

@xjorma all good. It may not be the best solution to have external files. I prefer them that way for tracking on github but obviously it means having to keep the files relative to the hda which is not ideal. Maybe there's a better solution out there that combines both.

joreeves commented 2 months ago

@xjorma I believe I found a good solution for this. I will create a new pull request. Feel free to use it if you like or re-implement if you'd prefer.

xjorma commented 2 months ago

@joreeves cool let me know

Piminski commented 2 months ago

@joreeves Thank you for your efforts. I am a bit new to github so I might be doing things wrong. I cloned the repo locally using command line but I seem to be getting the old version, I do not understand how to get your version for testing. I tried git clone on the pull request as well. Any advice is appreciated. I tried chatgpt but she was not helpful ;)

joreeves commented 2 months ago

@Piminski try this (assuming on windows):

First make sure there isn't a folder named EarthMeshHoudini in the location you want to clone to. Open a cmd prompt. You can run cd PATH/TO/FOLDER to change your directory you are installing to.

Then try running git clone https://github.com/joreeves/EarthMeshHoudini.git

If cloning isn't working you can also download a zip directly from github. Just click on the "code" button then select "Download ZIP" image

Piminski commented 2 months ago

@joreeves Thank you!

I think I have managed to get it working! Meshes are currently loading, hurrah!

One thing I was thinking is that the HDA starts loading meshes immediately so if the latitude changes it loads before one can change the longitude. I have been doing workarounds by disabling the node or removing the API key but I though an "load Mesh" button would be great. I even made a very basic/stupid HDA wrapping the Earthmesh in a subnet with a switch to a null. Maybe this a separet issue but as I mentioned I am not used to the git process yet.

Thanks to you and David again, this tool is so very useful.

joreeves commented 2 months ago

@Piminski Yeah, I noticed that as well and a button is a good idea. If you want to avoid it automatically loading for now a workaround I've been using is switching Houdini from "Auto Update" to "Manual" or your method sounds good as well.

Piminski commented 1 month ago

Hey @joreeves

It was all working well but for some reason it has stopped working. I had a functioning setup using the Earthmesh2:0 hda where I cached everything out to bgeo.sc files, when I now try to regenerate it gives the same error I described before. I have the scripts folder in the project folder relative to the hip file.

I am sorry to bother you.

Have you experienced anything similar? Has anything changed? Any advice is appreciated?

Screenshot 2024-07-22 175208 Screenshot 2024-07-22 175840

joreeves commented 1 month ago

Hey, I haven’t changed anything. I’m guessing something in googles api probably changed. I can take a look later and submit a fix.

On Mon, Jul 22, 2024 at 6:01 PM Piminski @.***> wrote:

Hey @joreeves https://github.com/joreeves

It was all working well but for some reason it has stopped working. I had a functioning setup using the Earthmesh2:0 hda where I cached everything out to bgeo.sc files, when I now try to regenerate it gives the same error I described before. I have the scripts folder in the project folder relative to the hip file.

I am sorry to bother you.

Have you experienced anything similar? Has anything changed? Any advice is appreciated?

Screenshot.2024-07-22.175208.png (view on web) https://github.com/user-attachments/assets/c2f96e12-0a18-49c2-a5ce-d8c8bd82dd90 Screenshot.2024-07-22.175840.png (view on web) https://github.com/user-attachments/assets/2999728f-3f7f-4fa3-9ea7-5020ae779c63

— Reply to this email directly, view it on GitHub https://github.com/xjorma/EarthMeshHoudini/issues/14#issuecomment-2244059713, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATS7Q7P3XYEYK3ECVBRBGB3ZNWTPTAVCNFSM6AAAAABJ6R3WY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBUGA2TSNZRGM . You are receiving this because you were mentioned.Message ID: @.***>

joreeves commented 1 month ago

Hey @Piminski so I think it might be an installation issue. Sorry I changed things around a few times back when i was making these fixes. If you are using the latest version (which I believe you are) the scripts folder no longer needs to be relative to your project. It should live in a stationary folder. Here's the install instructions:

Could you check to see if you have the EarthMesh.json file in your $HOME/houdiniXX.X/packages folder? And if so, where does the EARTHMESH_PATH variable point to. That's where the scripts should live. Let me know if that helps.

Piminski commented 1 month ago

Thank you @joreeves!

That seemed to fix it. I had the hda inside the documents/Houdini. Now per your instruction it works again. I cannot understand why it worked before but anyways.

The API credential in the json it makes the autostarting-download even more of an issue but I just put a wrong code in there and let it fail when I put the node