kostex / blenderscripts

My Blender 3D python scripts
27 stars 6 forks source link

KTX_RenderSlot.py issue #2

Open EugeneDudavkin opened 2 years ago

EugeneDudavkin commented 2 years ago

Hello, if you add more slots (>8) then script give an error

 line 111, in ui
    test_active = bool(scn.ktx_occupied_render_slots.data[i] == '1')
IndexError: string index out of range
kostex commented 2 years ago

you've got to provide more information.. I need to be able to get that same error.. state all your steps, otherwise I can't do anything about it. Just starting fresh and generating a bunch of render layers just works (even on 3.4.0 alpha)

EugeneDudavkin commented 2 years ago
  1. After the Blender starts, Toggle System Console (Window - Toggle System Console).
  2. Go to Rendering workspace, open "Image" tab.
  3. Add Render Slot (by pressing "+" icon, 2-3 slots).
  4. Then select first slot and press F12 (Render Image).
  5. See the error in the console.
kostex commented 2 years ago

thank you.. I can reproduce the error.. will investigate/fix! btw. there is no need to manually add render slots. in the preferences of the addon you can select "advanced mode" and then "Auto Advance" in the render scene properties.

EugeneDudavkin commented 2 years ago

I found the cause.

class OccupiedSlots:
    data = '00000000'

if data length = render slots length, then error disappears. So if we add 2 more zeros to data, and then after blender starts we add 2 more slots, the error will not happen.

kostex commented 2 years ago

yes.. when you "manually" add slots, the addon doesn't get notified about it.. it only gets notified after a render to recalc the amount of slots. I'm looking for a handler to notify my addon when a slot is manually added

EugeneDudavkin commented 2 years ago

Why I do not use "Auto Advance", its because I need to see render image after the end of rendering and for other thing. That's why I made an "additional" addon for your addon (based on your code for checking render slot empty or not). Render_Real+ It checking if render slot is empty - then render, if render slot not empty - then render in the next slot, if slot not empty and it's the last slot - then add new slot and render. And option to rewrite next slot (empty or not).

kostex commented 2 years ago

Updated the addon to catch the error, BUT there's not much else I can do... There is no way for my addon to get notified by blender whenever a user adds a renderslot. (with my knowledge) Only thing I can do is add a "refresh" button to recalc all slots. I'll do that at a later time, have to get back to my current project ;-) Cheers!

kostex commented 2 years ago

added the refresh button ;-)