KirilStrezikozin / BakeMaster-Blender-Addon

Welcome to BakeMaster, a powerful and feature-packed baking solution created for Blender - an open-source 3D Computer graphics software.
Other
34 stars 6 forks source link

BUG: hang when creating a bake job #46

Closed ApeOnFire closed 6 months ago

ApeOnFire commented 11 months ago

This bug report is:

Describe the bug Creating a bake job with more than two objects in it causes Blender to hang.

To Reproduce Steps to reproduce the behavior:

  1. Add a material to the default cube
  2. Duplicate it twice and add all three cubes to the BakeMaster object list.
  3. Switch on Name Matching
  4. Press the Create Bake Job Group button
  5. Add the cubes as low or high poly (doesn't matter)
  6. Blender hangs permanently.

Expected behavior The cubes should be added to a container for further config.

Desktop (please complete the following information):

KirilStrezikozin commented 11 months ago

@ApeOnFire, can't reproduce on Linux and Windows, cubes are added to the bake job group as expected. Have you tried restarting blender, disabling/reenabling BakeMaster addon?

Also, can you please open the blender console before adding cubes to BakeMaster, and monitor any debug info that appears there at the moment of adding a bake job group? Then send a screenshot of them here if any does appear.

image

ApeOnFire commented 11 months ago

@KirilStrezikozin nothing is printed to the console unfortunately.

It is 100% reproducible though. I've restarted blender and the machine multiple times now, reinstalled the BakeMaster add-on and disabled all other community add-ons.

I can test it on another mac later today - I'll report back.

ApeOnFire commented 11 months ago

@KirilStrezikozin tested on another mac and got the same behaviour in v3.6.4.

Interestingly though, the machine still had v3.5.1 on it so I tried that too. This time it crashed blender instantly instead of hanging. The only line printed to the console though was:

[1] 54776 segmentation fault /Applications/Blender.app/Contents/MacOS/Blender

Not a lot of help I guess… sorry I can't provide more info. I'm happy to try other things or test potential fixes for you though - just let me know.

KirilStrezikozin commented 11 months ago

Thanks for your effort. Regarding some testing, how would it be more comfortable for you?:

  1. having a local git repo cloned and enabled as an addon
  2. replacing one of the addon's files with an updated one I'll send
ApeOnFire commented 11 months ago

No worries. Option two would be preferable 👍

KirilStrezikozin commented 11 months ago

ok, I can't certainly say what exactly causes this bug, because the segmentation fault (like the one you've caught in the v3.5.1 version of Blender) is not particularly connected with BakeMaster itself. Instead, some action it produces freezes blender or causes it to crash.

The first thing we'll do until I find a Mac for me is to try to pinpoint the bug's location.

  1. For this, open BakeMaster in blender addon preferences, and navigate to the path on your system where it's stored: image

  2. Open that folder and look for a file named operators.py. Replace it with the operators.py file you'll get after extracting this zip archive.

  3. Now, restart (or open) Blender and try to make a bake job group.

  4. Notice that the dialog menu has the following property: image Execute Create Bake Job Group operator 4 times with this property set to the next value each round.

  5. Report back here which numbers caused blender to hang/crash.

ApeOnFire commented 11 months ago

After running through loads of scenarios I've pinned it down a bit more closely.

This took a while to figure out but hopefully it's useful and might point you in the right direction?

KirilStrezikozin commented 11 months ago

Thanks. Yes, this will definitely help. The behavior is very very strange to me though. I'll try to think about what I can do here and get back to you with another file to test.

ApeOnFire commented 11 months ago

Ok great. There's no hurry from me as I can work around it now. But happy to run more tests as needed.

KirilStrezikozin commented 11 months ago

@ApeOnFire, test out this one: operators.zip

ApeOnFire commented 11 months ago

@KirilStrezikozin it still hangs unfortunately.

I also found another scenario the other day where it hangs:

  1. Add just two objects to BM
  2. Create a bake job by adding one object as LP and the other as HP.

Hangs when you click ok.

This also happens if you use the auto matching:

  1. Name two objects using the "_low" suffix for one and "_high" for the other.
  2. Add them to BM.
  3. Toggle name matching to On.

Hangs when you press the button.

I haven't added a new bug as I'm guessing the root cause is the same.

KirilStrezikozin commented 9 months ago

@ApeOnFire, hi. Please test this new one: operators.zip. That's for the Bake Job Group. Same procedure: replacing operators.py.