Open rintrint opened 4 months ago
I don't know what is the purpose of BoneConverterPoseMode
. And what is the different between BoneConverter
and BoneConverterPoseMode
. In my case, I can deprecate BoneConverterPoseMode
. So I'm not sure it is necessary or not.
Here is my test case. The behavior is as expected when deprecating BoneConverterPoseMode
. The leg issue is due to the IK settings. Enabling rotation and setting it to 0.01 can temporarily fix it. Finding a suitable value for mmd_ik_limit_override
takes some time.
https://bowlroll.net/file/315881 https://bowlroll.net/file/316794
rintrint, your fix doesn't work on Blender version 4.2.3 according to #180 It will simply crash. More error information on the issue mentioned above.
rintrint, your fix doesn't work on Blender version 4.2.3 according to #180 It will simply crash. More error information on the issue mentioned above.
The VPD file and model I tested work fine. Could you provide more details about which VPD and model you used? Where did you download them from? That way I can test it myself.
I think we don't need to open a new issue since this hasn't been merged into the main branch yet. Let's just discuss it here.
The problem is fixed now.
Blender itself provides context.temp_override for safe context overriding in Blender 3.0+. However, the script was using its own custom implementation FnContext.temp_override_objects, which tried to handle multiple context properties at once and could cause instability.
I removed FnContext.temp_override_objects from importer because I discovered that the bone and shape key modifications don't actually require context override. The crashes were happening because doing complex bone modifications within a context override block is risky.
The fix was simple - just remove the context override and directly call self.__assignToArmature(obj). The bone transformations work fine without it since they're just property modifications, not operator calls.
I kept FnContext.temp_override_objects in the exporter since it's working properly there, with proper state backup and restoration. The exporter's usage is also simpler - just reading states rather than modifying them extensively.
This demonstrates that sometimes the best solution is to remove unnecessary complexity rather than trying to fix it.
The reason why I didn't experience crashes before is because I clicked on the MMD root (the cross-shaped empty object at the feet). Generally, this is the most correct approach, unless you want to discard shape keys for some reason.
Thanks! This fixes the issue. I never seen a python plugin that crashes Blender entirely without even giving it a chance to spit out error messages.
This appears to be a Blender API issue. I have reported it to the Blender developers.
As title.