Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various things broken in 4.0 #500

Open
soup587 opened this issue Nov 16, 2023 · 7 comments · May be fixed by #561
Open

Various things broken in 4.0 #500

soup587 opened this issue Nov 16, 2023 · 7 comments · May be fixed by #561
Labels
bug Something isn't working

Comments

@soup587
Copy link

soup587 commented Nov 16, 2023

i've found a couple issues with versions above 3.6 which cause the importer to just not function correctly

  • on 4.0 and above, materials aren't set up correctly and are pitch black with a couple random node groups in the imported materials
  • on 4.1 and above, most of a character's meshes don't import, due to the auto_smooth property of meshes being removed
@soup587 soup587 added the bug Something isn't working label Nov 16, 2023
@FlailingFog
Copy link
Owner

FlailingFog commented Jan 13, 2024

Thanks. It looks like two things will need to be done to at least get Blender 4.0 to work.

  • Armature layers were removed in Blender 4.0, and this addon uses those to organize bones
  • The bgl library was removed in Blender 4.0, and this addon uses that to saturate images, so this will need to be replaced with the gpu module or some kind of numpy implementation. I've tried both so far, and have had issues with both of them.

This addon doesn't use the auto_smooth property to my knowledge, so I don't know what could have caused that error in 4.1. The mmd_tools release page says it doesn't support 4.x yet either, so the mmd_tools importer may be using that property

@FlailingFog FlailingFog pinned this issue Jan 13, 2024
@S00pergang
Copy link

Hey uh, will a new version be released? Is this being continued?

@FlailingFog
Copy link
Owner

Hey uh, will a new version be released? Is this being continued?

Short answer:
I couldn't get something to work on Blender 4.0, so I haven't been working on this project for a while. I don't think anyone else is actively working on this project right now.

Longer answer:
I am currently unable to make a color saturation function work on 4.0. This function uses bgl, but the bgl module was removed on 4.0. Without this function, every single color and image on the model would have to be manually corrected every time you import something, and doing that for just one model is a gigantic pain. This function needs to be rewritten to use something other than bgl.

My attempt to perform saturation with a numpy implementation either resulted in the wrong coloring or it resulted in no change to the image (I forgot which it's been a while). My attempt to perform saturation with the gpu module resulted in perfect saturation, but parts of the image became corrupted.

I don't know what I'm doing wrong with the gpu method because I just copy pasted the code, and don't really have the motivation to learn why it isn't working because I want to use the numpy method anyway (this method is more future-proof than the other one), but the numpy method isn't working and I don't have the motivation to learn why that isn't working because the gpu method is almost working so it's kind of a mix between incompetence, indecision, frustration and laziness as to why this hasn't been resolved yet.

The armature layers were also removed in 4.0, so those need to be fixed. I'm guessing it'll be very easy to rewrite, but I don't see a point in doing it until the color saturation is working again.

@MadeEvil
Copy link

Hey uh, will a new version be released? Is this being continued?

Short answer: I couldn't get something to work on Blender 4.0, so I haven't been working on this project for a while. I don't think anyone else is actively working on this project right now.

Longer answer: I am currently unable to make a color saturation function work on 4.0. This function uses bgl, but the bgl module was removed on 4.0. Without this function, every single color and image on the model would have to be manually corrected every time you import something, and doing that for just one model is a gigantic pain. This function needs to be rewritten to use something other than bgl.

My attempt to perform saturation with a numpy implementation either resulted in the wrong coloring or it resulted in no change to the image (I forgot which it's been a while). My attempt to perform saturation with the gpu module resulted in perfect saturation, but parts of the image became corrupted.

I don't know what I'm doing wrong with the gpu method because I just copy pasted the code, and don't really have the motivation to learn why it isn't working because I want to use the numpy method anyway (this method is more future-proof than the other one), but the numpy method isn't working and I don't have the motivation to learn why that isn't working because the gpu method is almost working so it's kind of a mix between incompetence, indecision, frustration and laziness as to why this hasn't been resolved yet.

The armature layers were also removed in 4.0, so those need to be fixed. I'm guessing it'll be very easy to rewrite, but I don't see a point in doing it until the color saturation is working again.

for the saturation issue, you could add in a middle step before importing it to blender. you could create a program that converts the original texture files and fixes the saturation. however given the way the kkbp exporter works on the koikatsu side of things having each and every texture separated based on outfits, this may be challenging. this is moreover an idea incase if you get stuck. take my advice with a grain of salt for now though.

@MoriMorinya
Copy link

MoriMorinya commented May 29, 2024

Hey uh, will a new version be released? Is this being continued?

Short answer: I couldn't get something to work on Blender 4.0, so I haven't been working on this project for a while. I don't think anyone else is actively working on this project right now.
Longer answer: I am currently unable to make a color saturation function work on 4.0. This function uses bgl, but the bgl module was removed on 4.0. Without this function, every single color and image on the model would have to be manually corrected every time you import something, and doing that for just one model is a gigantic pain. This function needs to be rewritten to use something other than bgl.
My attempt to perform saturation with a numpy implementation either resulted in the wrong coloring or it resulted in no change to the image (I forgot which it's been a while). My attempt to perform saturation with the gpu module resulted in perfect saturation, but parts of the image became corrupted.
I don't know what I'm doing wrong with the gpu method because I just copy pasted the code, and don't really have the motivation to learn why it isn't working because I want to use the numpy method anyway (this method is more future-proof than the other one), but the numpy method isn't working and I don't have the motivation to learn why that isn't working because the gpu method is almost working so it's kind of a mix between incompetence, indecision, frustration and laziness as to why this hasn't been resolved yet.
The armature layers were also removed in 4.0, so those need to be fixed. I'm guessing it'll be very easy to rewrite, but I don't see a point in doing it until the color saturation is working again.

for the saturation issue, you could add in a middle step before importing it to blender. you could create a program that converts the original texture files and fixes the saturation. however given the way the kkbp exporter works on the koikatsu side of things having each and every texture separated based on outfits, this may be challenging. this is moreover an idea incase if you get stuck. take my advice with a grain of salt for now though.

There are already plugins for Blender that come with or use an external .exe, theoretically you could add a perquisite of having an older version of Blender like 3.6, adding an option in the addon options to direct the path to said blender.exe and just run the script through that version of Blender (or you could compile Blender 3.6 as a python module which should make you able to use bgl and create an external LUT converter application using it) , then import back, instead of trying to break your head around coding a new solution.

I think for now though there should be at least a script to convert the rigify layers from 3.6 to 4.0 using what's shown in this video.

@FlailingFog
Copy link
Owner

theoretically you could add a perquisite of having an older version of Blender like 3.6, adding an option in the addon options to direct the path to said blender.exe and just run the script through that version of Blender (or you could compile Blender 3.6 as a python module which should make you able to use bgl and create an external LUT converter application using it)

That is incredible, I never even considered that as an option. I just tried it on 4.1 and it successfully generated the image through the 3.6 exe. This would definitely break linux and mac compatibility, but I think this will be the least painful option for porting to 4.1. It should even be possible to automatically get 3.6 with a python script that downloads it from the previous versions link and unzips it to the addon directory.

The standalone module also looks like an interesting option. I might be wrong, but this seems like it would be better for keeping linux/mac compatibility. The prebuilt 3.6 version is on pypi, so I bet I could use that: https://pypi.org/project/bpy/3.6.0/.

Thanks a lot, I'll look into these.

@FlailingFog FlailingFog linked a pull request Jun 2, 2024 that will close this issue
@MadeEvil
Copy link

MadeEvil commented Jul 9, 2024

Hey uh, will a new version be released? Is this being continued?

Short answer: I couldn't get something to work on Blender 4.0, so I haven't been working on this project for a while. I don't think anyone else is actively working on this project right now.
Longer answer: I am currently unable to make a color saturation function work on 4.0. This function uses bgl, but the bgl module was removed on 4.0. Without this function, every single color and image on the model would have to be manually corrected every time you import something, and doing that for just one model is a gigantic pain. This function needs to be rewritten to use something other than bgl.
My attempt to perform saturation with a numpy implementation either resulted in the wrong coloring or it resulted in no change to the image (I forgot which it's been a while). My attempt to perform saturation with the gpu module resulted in perfect saturation, but parts of the image became corrupted.
I don't know what I'm doing wrong with the gpu method because I just copy pasted the code, and don't really have the motivation to learn why it isn't working because I want to use the numpy method anyway (this method is more future-proof than the other one), but the numpy method isn't working and I don't have the motivation to learn why that isn't working because the gpu method is almost working so it's kind of a mix between incompetence, indecision, frustration and laziness as to why this hasn't been resolved yet.
The armature layers were also removed in 4.0, so those need to be fixed. I'm guessing it'll be very easy to rewrite, but I don't see a point in doing it until the color saturation is working again.

for the saturation issue, you could add in a middle step before importing it to blender. you could create a program that converts the original texture files and fixes the saturation. however given the way the kkbp exporter works on the koikatsu side of things having each and every texture separated based on outfits, this may be challenging. this is moreover an idea incase if you get stuck. take my advice with a grain of salt for now though.

There are already plugins for Blender that come with or use an external .exe, theoretically you could add a perquisite of having an older version of Blender like 3.6, adding an option in the addon options to direct the path to said blender.exe and just run the script through that version of Blender (or you could compile Blender 3.6 as a python module which should make you able to use bgl and create an external LUT converter application using it) , then import back, instead of trying to break your head around coding a new solution.

I think for now though there should be at least a script to convert the rigify layers from 3.6 to 4.0 using what's shown in this video.

sorry for the late reply, thats a much better idea than what i was originally thinking lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants