addam / Export-Paper-Model-from-Blender

Python addon for creating paper models in Blender (development version)
https://blenderartists.org/t/export-paper-model/476597
405 stars 53 forks source link

Attribute Error: 'BakeSettings' object has no attribute 'use_pass_ambient_occlusion' #94

Closed Theraa0 closed 2 years ago

Theraa0 commented 2 years ago

I added a UV sphere, marked all the vertical edges as seams, added a material to which I assigned an image as a base and then tried to export it using this add on and every option to include textures, upon which i got this error: Attribute Error: 'BakeSettings' object has no attribute 'use_pass_ambient_occlusion' Thats not tge full error message but it wouldn't let me copy the text for whatever reason. Let me know if you need that, and I'll get it to you somehow. If I try to export it without the material added but still with the include materials option(s) this also occurs. Using a single color texture also does not help. Rebooting or restarting Blender or re-enabling the add-on didn't work either.

DanielFlaum commented 2 years ago

I'm also experiencing this with add-on version 1.2 and Blender 3.0.0. I'll prepare a .blend that reproduces the issue.

DanielFlaum commented 2 years ago

The attached .blend reproduces the issue for me: broken-paper-model.zip.

DanielFlaum commented 2 years ago

I was able to fix this issue by editing my copy of io_export_paper_model.py to remove all mentions of ambient occlusion. But that file doesn't appear in this repository, and I'm not knowledgeable about Blender add-on build processes.

Here, however, is a .zip with my changes: io_export_paper_model_fix.zip. This should be pretty easily adaptable for the plugin author to use.

Theraa0 commented 2 years ago

That works for me, thank you.

In the original file there appears to be a task list which says:

Task: split into four files (SVG and PDF separately)

and it looks to me as if that has already happened in this repo, so applying the fix you provided should not be an issue, however I am unsure if just removing ambient occlusion really is a permanent fix.

addam commented 2 years ago

@DanielFlaum, thank you for the fix. Apparently, the Ambient Occlusion pass was actually removed from Bake render settings.

Still, it is possible to use Ambient Occlusion as a specific Bake Type and I believe this option is useful. Here is a fixed version of the script with only the necessary bits removed while keeping all functionality: io_export_paper_model_fix.zip

@Thera-code, thank you for this bugreport and please excuse that it took me this long before I got to fixing it. The code is now updated both here and in the official repo, so that next Blender release will have the script properly working -- thanks to you.