Add MMD Texture Error #359

Closed
opened 2025-08-13 06:07:09 +00:00 by Ghost · 7 comments
Ghost commented 2025-08-13 06:07:09 +00:00 (Migrated from git.disroot.org)

Log:

Python: Traceback (most recent call last):
File "C:\Users\mylun\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\cats_blender_plugin\extern_tools\mmd_tools_local\operators\material.py", line 141, in execute
fnMat.create_texture(self.filepath)
File "C:\Users\mylun\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\cats_blender_plugin\extern_tools\mmd_tools_local\core\material.py", line 224, in create_texture
texture = self.__create_texture_node("mmd_base_tex", filepath, (-4, -1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mylun\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\cats_blender_plugin\extern_tools\mmd_tools_local\core\material.py", line 322, in __create_texture_node
self.__update_shader_nodes()
File "C:\Users\mylun\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\cats_blender_plugin\extern_tools\mmd_tools_local\core\material.py", line 547, in __update_shader_nodes
if not (node_shader.outputs["Shader"].is_linked or node_shader.outputs["Color"].is_linked or node_shader.outputs["Alpha"].is_linked):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'bpy_prop_collection[key]: key "Color" not found'

===== > < =====

Blender Version:
4.5.1

Cats Version:
4.5.1.3

Log: Python: Traceback (most recent call last): File "C:\Users\mylun\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\cats_blender_plugin\extern_tools\mmd_tools_local\operators\material.py", line 141, in execute fnMat.create_texture(self.filepath) File "C:\Users\mylun\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\cats_blender_plugin\extern_tools\mmd_tools_local\core\material.py", line 224, in create_texture texture = self.__create_texture_node("mmd_base_tex", filepath, (-4, -1)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\mylun\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\cats_blender_plugin\extern_tools\mmd_tools_local\core\material.py", line 322, in __create_texture_node self.__update_shader_nodes() File "C:\Users\mylun\AppData\Roaming\Blender Foundation\Blender\4.5\extensions\user_default\cats_blender_plugin\extern_tools\mmd_tools_local\core\material.py", line 547, in __update_shader_nodes if not (node_shader.outputs["Shader"].is_linked or node_shader.outputs["Color"].is_linked or node_shader.outputs["Alpha"].is_linked): ~~~~~~~~~~~~~~~~~~~^^^^^^^^^ KeyError: 'bpy_prop_collection[key]: key "Color" not found' ===== > < ===== Blender Version: 4.5.1 Cats Version: 4.5.1.3
Ghost commented 2025-08-13 09:14:16 +00:00 (Migrated from git.disroot.org)

I am unable to re-produce this error, please can tell me what steps your took to get this?

Thanks

I am unable to re-produce this error, please can tell me what steps your took to get this? Thanks
Ghost commented 2025-08-13 09:28:40 +00:00 (Migrated from git.disroot.org)

I imported the model's FBX and tried to click "Add MMD Texture," and this error occurred.
I'm not sure if it's because of an old shader node from the model or if the .blend file doesn't have the Color of Alpha, which is causing the error.

More>
https://streamable.com/fdtt81

I imported the model's FBX and tried to click "Add MMD Texture," and this error occurred. I'm not sure if it's because of an old shader node from the model or if the .blend file doesn't have the Color of Alpha, which is causing the error. More> https://streamable.com/fdtt81
Ghost commented 2025-08-13 09:40:18 +00:00 (Migrated from git.disroot.org)

First of all this is not a Cats issue it's a MMD Tools issue however mmd tools is not designed for your use case. It's designed for PMX (MMD) models.

FBX files typically come with standard Blender materials (Principled BSDF, etc.) that don't have the "Color" and "Alpha" outputs that MMD Tools expects.

the "Add MMD Texture" function is designed for PMX workflows, It's trying to work with MMD specific material nodes that don't exist in FBX imports.

This is why i could not re-produce the issue because your trying to do something the tool is not designed for.

But all that being said, i think you can just change the shader to the MMD one and that should fix the issue.

First of all this is not a Cats issue it's a MMD Tools issue however mmd tools is not designed for your use case. It's designed for PMX (MMD) models. FBX files typically come with standard Blender materials (Principled BSDF, etc.) that don't have the "Color" and "Alpha" outputs that MMD Tools expects. the "Add MMD Texture" function is designed for PMX workflows, It's trying to work with MMD specific material nodes that don't exist in FBX imports. This is why i could not re-produce the issue because your trying to do something the tool is not designed for. But all that being said, i think you can just change the shader to the MMD one and that should fix the issue.
Ghost commented 2025-08-13 09:46:35 +00:00 (Migrated from git.disroot.org)

Ah it appears the shader only appears if you import a MMD (PMX) model in your scene most likely because it only gets created when you import an PMX model. Again MMD Tools is not made for your use case.

But if you import a PMX model into your scene and then remove it, you should see the shader which you can change your model materials too, this should solve this error.

Ah it appears the shader only appears if you import a MMD (PMX) model in your scene most likely because it only gets created when you import an PMX model. Again MMD Tools is not made for your use case. But if you import a PMX model into your scene and then remove it, you should see the shader which you can change your model materials too, this should solve this error.
Ghost commented 2025-08-13 09:55:22 +00:00 (Migrated from git.disroot.org)

Also why are you using that to add textures when that model is clearly not a MMD model you should be doing this (When you click on the folder icon like the one in the video it should allow you to pick your texture, the popup just didn't record.)

https://github.com/user-attachments/assets/29abbbdb-dc8f-4fca-873c-be079c76fb77

Also why are you using that to add textures when that model is clearly not a MMD model you should be doing this (When you click on the folder icon like the one in the video it should allow you to pick your texture, the popup just didn't record.) https://github.com/user-attachments/assets/29abbbdb-dc8f-4fca-873c-be079c76fb77
Ghost commented 2025-08-13 10:03:05 +00:00 (Migrated from git.disroot.org)

Okay, I'll give it a try, but it worked before, so I think it's the right thing to do. Thank you very much.

Okay, I'll give it a try, but it worked before, so I think it's the right thing to do. Thank you very much.
Ghost commented 2025-08-13 10:07:52 +00:00 (Migrated from git.disroot.org)

MMD Tools devs might of changed how it works (I swear it used to create the shader when you opened blender) but that's on the MMD Tool devs not the Cats Devs,

We keep MMD Tools up to date and i know there made alot of changes in the last few months. Also it could be because the Blender Devs are getting more stricter on how code works, so the original code could of been a problem but blender wasn't catching it before and now it is.

There a bunch of reasons why this could be happening now but it's nothing to do with Cats it self.

I can add a check which could solve the error, but i am not sure if any more checks need to be added for this and not sure if the end result of adding the texture would look crappy or not.

MMD Tools devs might of changed how it works (I swear it used to create the shader when you opened blender) but that's on the MMD Tool devs not the Cats Devs, We keep MMD Tools up to date and i know there made alot of changes in the last few months. Also it could be because the Blender Devs are getting more stricter on how code works, so the original code could of been a problem but blender wasn't catching it before and now it is. There a bunch of reasons why this could be happening now but it's nothing to do with Cats it self. I can add a check which could solve the error, but i am not sure if any more checks need to be added for this and not sure if the end result of adding the texture would look crappy or not.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Kneelawk/Cats-Blender-Plugin#359
No description provided.