blenderscripts icon indicating copy to clipboard operation
blenderscripts copied to clipboard

KTX_RenderSlot.py issue

Open EugeneDudavkin opened this issue 3 years ago • 8 comments

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

EugeneDudavkin avatar Aug 02 '22 18:08 EugeneDudavkin

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)

kostex avatar Aug 02 '22 20:08 kostex

  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.

EugeneDudavkin avatar Aug 03 '22 06:08 EugeneDudavkin

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.

kostex avatar Aug 03 '22 06:08 kostex

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.

EugeneDudavkin avatar Aug 03 '22 06:08 EugeneDudavkin

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

kostex avatar Aug 03 '22 06:08 kostex

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).

EugeneDudavkin avatar Aug 03 '22 06:08 EugeneDudavkin

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 avatar Aug 03 '22 07:08 kostex

added the refresh button ;-)

kostex avatar Aug 03 '22 10:08 kostex