absolute-quantum / cats-blender-plugin

:smiley_cat: A tool designed to shorten steps needed to import and optimize models into VRChat. Compatible models are: MMD, XNALara, Mixamo, DAZ/Poser, Blender Rigify, Sims 2, Motion Builder, 3DS Max and potentially more
https://catsblenderplugin.com
MIT License
3.37k stars 452 forks source link

To support Blender4.0 #660

Open existyay opened 5 months ago

existyay commented 5 months ago

如果你想在4.0里面使用该插件 if you want to use the plugin in Blender4.0 我找到了一个方法能使其在其中加载 I just found a way to load it in blender: 根据第一个报错可以看出是try的时候mod.register()无法正常加载导致的 According to the first error, it can be seen that mod.register() cannot be loaded normally during try 报错的文件在 The error file is here: C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\addon_utils.py from line 401 try: 第二个错误直接指出原因 You can find C:\Users(用户)\Your Computer name(电脑名)\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\cats-blender-plugin-0-19-0__init__.py 修改其中的第319行代码 Modify the code from line 319 bpy.context.window_manager.addon_support = {'OFFICIAL', 'COMMUNITY'} 删除Testing delete 'Testing' 该方法使得其能在Blender4.0中使用 但是删除代码的代价尚不可知:主要的Testing的那一部分不能用,或者说是Blender4.0加载插件的方式比2.7和2.8来说少了一部分

Likuid-S commented 5 months ago

I fixed it by myself "Apparently" I went to: "C:\Users\USERNAMEONYOURPC\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\cats-blender-plugin-master" and opened the file: init.py with a text editor then I went to the line 319 and deleted the word 'Testing'

Result: "bpy.context.window_manager.addon_support = {'OFFICIAL', 'COMMUNITY'}"

I don't know if this doesn't break something be careful testing it first!

Yusarina commented 5 months ago

First of all you should not be using the main branch of cats you should be using the dev branch which already has this fix and many other fixes. The main branch should not be used on anything more then blender 3.3.

Second cats won't work well on blender 4.0 both main and dev due to the changes with blender 4.0 and that MMD tools has still not been fully updated to work with blender 4.0.

However there are people who have created there own version including myself who has made it worked as best as there can with blender 4.0 check out the many forks out there.

Lastly the official version of cats will most likely never be updated from now on.

SelftaughtNinja commented 5 months ago

First of all you should not be using the main branch of cats you should be using the dev branch which already has this fix and many other fixes. The main branch should not be used on anything more then blender 3.3.

Second cats won't work well on blender 4.0 both main and dev due to the changes with blender 4.0 and that MMD tools has still not been fully updated to work with blender 4.0.

However there are people who have created there own version including myself who has made it worked as best as there can with blender 4.0 check out the many forks out there.

Lastly the official version of cats will most likely never be updated from now on.

I am wholly new to all this, and I feel like I'm doing something wrong here and am desperate for any assistance you may be willing to offer. I have followed all directions, even going as far as uninstalling everything and doing it all over again just in case I'd missed a step somewhere. Went through all the comments you'd left to others just to be sure and followed the directions you'd given to them there, nothing doing... I've just gotten done attempting to apply this code to various versions of Blender, from 2.6 and up, as well as using the separate works others have created for Blender 4.0 to absolutely no avail. I feel like its more than just bad luck and ready to tear out my hair! May you help me, please?

Yusarina commented 5 months ago

Ok have you tried my version (Which has the most changes and fixes out of any fork).

https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-

Second if you have an issue with my version, create an issue on there and I help you, seeing as I can update my version if it's an issue with cats itself.

SelftaughtNinja commented 5 months ago

Thank you for getting back to me! I tried so many, I don't recall of the top of my head if I have, so I'll try yours specifically and then get right back to you as soon as I'm able to.  I'm trying to use a vroid avatar in vrchat. (Doing the standard export into blender & unity so I can fix/refine the armature.)  I've managed to get the avatar into vrchat finally, but had to skip alot of vital steps in blender due to the CATS plug-in fail I'm experiencing.  Her body is just so stiff and the lip sync has failed to boot.  This is the first time I've done any of this, I'm learning everything on the go, so it's been a bit of a struggle as you can likely imagine! 🙃  Any help you feel comfortable offering me I would be ever so grateful for🙏🥲 Thanks again for your response and I'll be back with result soon 👍🏼 

On Sat, Feb 3, 2024 at 4:22 AM, @.***> wrote:

Ok have you tried my version (Which has the most changes out of any fork)

https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-

Second what is your issue?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Yusarina commented 5 months ago

Hi

Please use Blender 3.6 for a start (MMD tools doesn't fully support 4.0 yet). Second please use my own version as I know what is fixed and what isn't there: https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-/releases/tag/3.6.5.2

First import the model into blender via the Import panel on cats, once done go to MMD Options and click fix mmd model. This should apply most fixes, then click fix materials which is also in MMD options. Once done export the model via the cats panel (At on the top right it be next to import model).

Once done import it into Unity and go from there.

If there is any other issues please open an issue here: https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-/issues and I can help there as I quite active, I don't monitor the official version of cats much anymore and no one else does.

SelftaughtNinja commented 5 months ago

Oh, I cannot thank you enough 🫂 I'll follow your instructions to the letter and post an update with how it all works out 😎 Have a great day/night by you!

On Sat, Feb 3, 2024 at 7:49 AM, @.***> wrote:

Hi

Please use Blender 3.6 for a start (MMD tools doesn't fully support 4.0 yet). Second please use my own version as I know what is fixed and what isn't there: https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-/releases/tag/3.6.5.2

First import the model into blender via the Import panel on cats, once done go to MMD Options and click fix mmd model. This should apply most fixes, then click fix materials which is also in MMD options. Once done export the model via the cats panel (At on the top right it be next to import model).

Once done import it into Unity and go from there.

If there is any other issues please open an issue here: https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-/issues and I can help there as I quite active, I don't monitor the official version of cats much anymore and no one else does.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

SelftaughtNinja commented 5 months ago

Update: It worked 😭😭😭 Working on the model as I type this to you now.  You're awesome!  Can't wait to run around with my little avatar in all its glory, moving parts and all, Thank you so much again 🙇‍♀️

On Sat, Feb 3, 2024 at 8:08 AM, Katherine @.***> wrote: Oh, I cannot thank you enough 🫂 I'll follow your instructions to the letter and post an update with how it all works out 😎 Have a great day/night by you!

On Sat, Feb 3, 2024 at 7:49 AM, @.***> wrote:

Hi

Please use Blender 3.6 for a start (MMD tools doesn't fully support 4.0 yet). Second please use my own version as I know what is fixed and what isn't there: https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-/releases/tag/3.6.5.2

First import the model into blender via the Import panel on cats, once done go to MMD Options and click fix mmd model. This should apply most fixes, then click fix materials which is also in MMD options. Once done export the model via the cats panel (At on the top right it be next to import model).

Once done import it into Unity and go from there.

If there is any other issues please open an issue here: https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-/issues and I can help there as I quite active, I don't monitor the official version of cats much anymore and no one else does.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Yusarina commented 5 months ago

No worries, glad it works!

Nixilliscyte commented 4 months ago

I fixed it by myself "Apparently" I went to: "C:\Users\USERNAMEONYOURPC\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\cats-blender-plugin-master" and opened the file: init.py with a text editor then I went to the line 319 and deleted the word 'Testing'

Result: "bpy.context.window_manager.addon_support = {'OFFICIAL', 'COMMUNITY'}"

I don't know if this doesn't break something be careful testing it first!

Once you've done that and if you still get an error after clicking on the wrench logo "Fix Model Setting" like this :

_C:\Users***\AppData\Roaming\UPBGE\Blender\3.6\scripts\addons\cats-blender-plugin-master\ui\armature.py", line 205, in invoke return context.window_manager.invoke_props_dialog(self, width=dpi_value * 3.25) TypeError: WindowManager.invoke_propsdialog(): error with keyword argument "width" - Function.width expected an int type, not float.**

Just go to your C:\Users*****\AppData\Roaming\UPBGE\Blender\3.6\scripts\addons\cats-blender-plugin-master\ui\armature.py", line 205

And replace : "return context.window_manager.invoke_props_dialog(self, width=dpi_value * 3.25)"

By : "return context.window_manager.invoke_props_dialog(self, width=int(dpi_value * 3.25))"

Yusarina commented 4 months ago

Your gonna hit alot more problems as also this means your using the main branch instead of the dev branch which is not for blender 3.0+

The dev branch has been updated for blender 3.1 to 3.5 however if your using blender 3.6 it still should work.

Or just use my version as advised earlier which contains further fixes and improvements for both 3.6 and 4.0.