FlailingFog / KK-Blender-Porter-Pack

Plugin pack for exporting Koikatsu characters to Blender.
310 stars 29 forks source link

Error with rigify conversion #149

Closed sleepymanakete closed 2 years ago

sleepymanakete commented 2 years ago

When trying to convert the rig to rigify, I get this error due to the skirt bone layer. Python: Traceback (most recent call last): File "C:\Users\inzan\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\KK-Blender-Porter-Pack-master\extras\rigifywrapper.py", line 36, in execute bpy.ops.pose.rigify_generate() File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\modules\bpy\ops.py", line 132, in __call__ ret = _op_call(self.idname_py(), None, kw) RuntimeError: Error: RIGIFY ERROR: Bone 'cf_j_sk_00_00': Input to rig type must be a chain of 2 or more bones. Incorrect armature for type 'chain_rigs' location: <unknown location>:-1

ilcane87 commented 2 years ago

Hi @sleepymanakete, sorry for the late response but I haven't been checking on this project for a while. I don't have enough information to solve the issue like this, can you post the character that causes this error?

sleepymanakete commented 2 years ago

hi! thank you for the response. Here is the character:

https://media.discordapp.net/attachments/447115249997578241/909715995743113226/Koikatu_F_20210928054725402_Eula_Lawrence.png

ilcane87 commented 2 years ago

Uhm, I'm unable to perform the step "2a) Import KK Shader and Textures" on this character, I keep getting the following error, even though I do have the texture it's looking for:

Python: Traceback (most recent call last):
  File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\KK-Blender-Porter-Pack-master\importing\importeverything.py", line 794, in execute
    texture_error = get_and_load_textures(directory)
  File "C:\Users\UserName\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\KK-Blender-Porter-Pack-master\importing\importeverything.py", line 367, in get_and_load_textures
    bpy.data.images[image.name].pack()
KeyError: 'bpy_prop_collection[key]: key "Avatar_Lady_Claymore_Eula_Tex_Hair_Diffuse -712790_ColorMask.png" not found'

How did you get past it? I can't test the Rigify scripts until I do.

sleepymanakete commented 2 years ago

I totally forgot about that error and couldn't figure it out myself, my apologies. I'll link a different character instead. card: https://db.bepis.moe/koikatsu/view/186429

ilcane87 commented 2 years ago

I totally forgot about that error and couldn't figure it out myself

You should probably open a new issue about it, given that the addon is not finding a file that is actually there, it should be an easy fix, and it would help the developers get rid of a recurring bug.

I'll link a different character instead. card: https://db.bepis.moe/koikatsu/view/186429

The Rigify conversion seems to be working fine for me on this character, including the skirt: image I'm using the latest public release of the KKBPP addon (5.1.1), with Blender 3.0.

Considering the kind of error you reported, I assume that you made some changes to the character prior to the Rigify conversion, specifically to the skirt bones. I'll show you what causes that error to occur: image The picture above shows the original armature's skirt bones, and as you can see I selected the 'cf_j_sk_00_00' bone, which is the same that is mentioned in your error report. After you click the "Convert for Rigify" button the first time, on the bone properties, you can see that its Rigify type is "limbs.super_finger", which is an archetype that requires a chain of at least 2 bones to work, so unless that chain is still intact, you'll get your error the second time you press the conversion button. So I assume that in your case it doesn't work because you either disconnected or deleted the subsequent bones in the chain, so you can either restore them or change the Rigify Type to something else that doesn't require a chain, like "basic.super_copy".

As a general rule, the Rigify conversion of this addon should always be performed before applying any changes to the character or armature; you can refer to the steps mentioned in this thread: https://github.com/FlailingFog/KK-Blender-Porter-Pack/issues/78 Note that you can of course make changes to the original armature after it's converted to a Metarig, and then generate the control rig multiple times, it is in fact the recommended workflow when using Rigify, but you need to be aware of how it works; if you're interested, I linked to a useful tutorial playlist in the OP of the topic I mentioned before.

sleepymanakete commented 2 years ago

You should probably open a new issue about it, given that the addon is not finding a file that is actually there, it should be an easy fix, and it would help the developers get rid of a recurring bug.

Ok, I'll make sure to do that soon.

So I assume that in your case it doesn't work because you either disconnected or deleted the subsequent bones in the chain, so you can either restore them or change the Rigify Type to something else that doesn't require a chain, like "basic.super_copy".

I had a look at the meta rig and the script seemed to broke the chain actually for some strange reason. I made no changes to the rig. I guess I'll have to look and see why my rigify is glitched image

ilcane87 commented 2 years ago

Are you sure the skirt bones aren't like that even before using the Rigify conversion? Because rather than a Rigify problem that looks like an export/import problem; if that's the case, make sure you are using the latest version of KKBP_Exporter.dll in Koikatsu, and that you are importing the model into Blender using the big button of the CATS plugin, without altering the settings.

sleepymanakete commented 2 years ago

Oh my gosh, thank you! 😭 I was doing file > import pmx instead of using the CATS button. I wasn't aware there was a difference at the time image