FlailingFog / KK-Blender-Porter-Pack

Plugin pack for exporting Koikatsu characters to Blender.
305 stars 28 forks source link

Trying to export a model to VRC but it aint working #530

Closed Jersey62 closed 1 month ago

Jersey62 commented 1 month ago

I am trying to export a friends card into vrc but i am getting this error

Error: Unknown python error occurred Traceback (most recent call last): File "C:\Users\ts051\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KK-Blender-Porter-Pack-master\exporting\exportprep.py", line 259, in execute main(prep_type, simp_type) File "C:\Users\ts051\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\KK-Blender-Porter-Pack-master\exporting\exportprep.py", line 68, in main if body.material_slots[index].name == body.material_slots[index-1].name: UnboundLocalError: local variable 'index' referenced before assignment

does anyone know why this is happening ?

AnalogKnight commented 1 month ago

I am experiencing the same issue. I found this problem occurs after making any changes to the shader.

Jersey62 commented 1 month ago

I am experiencing the same issue. I found this problem occurs after making any changes to the shader.

So is there anyway to fix the issue ?

Jersey62 commented 1 month ago

Thing is my friend just sent me the blend file with the model inside nothing else so I have no idea if any shader changes were made

AnalogKnight commented 1 month ago

I am experiencing the same issue. I found this problem occurs after making any changes to the shader.

So is there anyway to fix the issue ?

No, at least not at the moment. I'm working on a solution. If I find a solution, I'll post it here.

Jersey62 commented 1 month ago

I am experiencing the same issue. I found this problem occurs after making any changes to the shader.

So is there anyway to fix the issue ?

No, at least not at the moment. I'm working on a solution. If I find a solution, I'll post it here.

Hopefully there is a solution to the issue atleast your trying to find a fix to it cause I kinda tried everything

AnalogKnight commented 1 month ago

I am experiencing the same issue. I found this problem occurs after making any changes to the shader.

So is there anyway to fix the issue ?

No, at least not at the moment. I'm working on a solution. If I find a solution, I'll post it here.

Hopefully there is a solution to the issue atleast your trying to find a fix to it cause I kinda tried everything

done.

Locate: plugins folder/exporting/exportprep.py If you have installed the plugin, it is located: C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\Version\scripts\addons

Place line 64 of the: eye_index=0 to: index=0

I think this is a simple naming error.

But I have to say that I don't know how this plugin works, nor have I read all the code, and I simply think it's a variable naming error. So use it at your own risk before @FlailingFog gives a conclusion. PS:I thought it was a simple question and I unlikely to get it wrong, so created a pull request.

Jersey62 commented 1 month ago

I am experiencing the same issue. I found this problem occurs after making any changes to the shader.

So is there anyway to fix the issue ?

No, at least not at the moment. I'm working on a solution. If I find a solution, I'll post it here.

Hopefully there is a solution to the issue atleast your trying to find a fix to it cause I kinda tried everything

done.

Locate: plugins folder/exporting/exportprep.py If you have installed the plugin, it is located: C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\Version\scripts\addons

Place line 64 of the: eye_index=0 to: index=0

I think this is a simple naming error.

But I have to say that I don't know how this plugin works, nor have I read all the code, and I simply think it's a variable naming error. So use it at your own risk before @FlailingFog gives a conclusion.

I will probably wait a bit before I try it but thank you

FlailingFog commented 1 month ago

done.

Locate: plugins folder/exporting/exportprep.py If you have installed the plugin, it is located: C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\Version\scripts\addons

Place line 64 of the: eye_index=0 to: index=0

I think this is a simple naming error.

But I have to say that I don't know how this plugin works, nor have I read all the code, and I simply think it's a variable naming error. So use it at your own risk before @FlailingFog gives a conclusion. PS:I thought it was a simple question and I unlikely to get it wrong, so created a pull request.

Thanks! I definitely missed that. If the model has the 'KK Eyewhites (sirome)' material the index variable is set and everything will work, but if you don't then it will be undefined and cause the error. I must have only been testing the export with models that had that material present. I'll add a new release with this fix.

Jersey62 commented 1 month ago

done. Locate: plugins folder/exporting/exportprep.py If you have installed the plugin, it is located: C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\Version\scripts\addons Place line 64 of the: eye_index=0 to: index=0 I think this is a simple naming error. But I have to say that I don't know how this plugin works, nor have I read all the code, and I simply think it's a variable naming error. So use it at your own risk before @FlailingFog gives a conclusion. PS:I thought it was a simple question and I unlikely to get it wrong, so created a pull request.

Thanks! I definitely missed that. If the model has the 'KK Eyewhites (sirome)' material the index variable is set and everything will work, but if you don't then it will be undefined and cause the error. I must have only been testing the export with models that had that material present. I'll add a new release with this fix.

thanks for finding a fix to the problem