schroef / Save-Render-Presets

Allows user to save render settings per engine
7 stars 1 forks source link

Error when loading EEVEE preset on Blender 4.0.2 #3

Open etherealxx opened 3 days ago

etherealxx commented 3 days ago

Saving preset is fine, but when i load it on a different file, i got this error

Failed to execute the preset: SyntaxError('invalid syntax', ('C:\\Users\\Ethereal\\AppData\\Roaming\\Blender Foundation\\Blender\\4.0\\scripts\\presets\\render-presets/eevee\\eevee_ao_ssr.py', 16, 25, 'eevee.diffuse_options = <bpy_struct, RaytraceEEVEE at 0x0000016B1B38FA88>\n', 16, 26))

Here's a visual representation of said preset: image image

Blender version used: 4.0.2 System Info: Windows 10.0.22631 - dedicated NVIDIA GeForce GTX 1050 Ti (NVIDIA; 32.0.15.5599) - 12th Gen Intel(R) Core(TM) i3-12100F (8 Threads)

schroef commented 3 days ago

Thanks. I'll need to take a look at what causing it. Probably some new setting, but it should catch that automatically

Ps is this a preset which was saved on a different blender version?

schroef commented 3 days ago

What's weird is that this options has been renamed to rayTraceOptionw, but that was done in blender 4.1. I see your version is 4.0.3. guess I need to check that release data then.

What happens if you make the present in your current version and than try to load it. I get the feeling this is a preset which was moved over when going fro. 3.6 to 4.0 or 4.0.3

This is the API change for 4.1 https://docs.blender.org/api/current/change_log.html

As I read in api 4.0 Eevee.diffuse_options was added https://docs.blender.org/api/4.0/change_log.html

I don't see an update log for 4.0.3 So I'm almost 100% sure they change the nameing then already

Try what I mentioned earlier. Ps you can open the preset file and comment out that line to around the error. You can do this by opening in a text editor and add a hashtag or # for the line.

Than load it and perhaps save the present again. See if that solves ir

etherealxx commented 3 days ago

Okay, to clarify:

here's the full preset code, with the lines commented : https://pastebin.com/hkttTAL7

I also tried blender 3.6 (create and import on that version) and this addon works just fine. so it's on 4.0 i guess

Cycles works just fine in 4.0.2

schroef commented 2 days ago

I just checked 4.1 and im seeing the same thing. I think this is a bug in blender itself. It return different prop than it should. It structured different than when the other keys are checked.

The issue is this, see blue highlighted line. it should return data as like all the others. Its kinda weird, i need to dig into this and see why this is. Screenshot 2024-06-28 130318

etherealxx commented 2 days ago

maybe because eevee.ray_tracing_options's type is a custom type? RaytraceEEVEE which is a struct image

it contains several variables inside, kinda like python class, or a dict image

also it says that eevee.ray_tracing_options is read only, which maybe that is what causing the problem? attempting to write to a read only variable when loading a preset?

sorry if i say some nonsense my python understanding is not that good