-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vpd import #162
base: blender-v4
Are you sure you want to change the base?
Fix vpd import #162
Conversation
I don't know what is the purpose of Here is my test case. The behavior is as expected when deprecating https://bowlroll.net/file/315881 |
rintrint, your fix doesn't work on Blender version 4.2.3 according to #180 |
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.