Render in Background script by structure



  • Just letting everyone know it's on ShareCG. Works like a charm, letting a Superfly render churn in the background while I set up the next promo render.
    https://sharecg.com/v/93441/view/11/Poser/Render-in-Background](https://sharecg.com/v/93441/view/11/Poser/Render-in-Background)



  • @glitterati3d Whoa this seems super useful! Does it use CUDA for the background rendering or is it only able to use the CPU?


  • Poser Ambassadors

    I am mystified by this script, because I am a programmer.

    The isSuperFly function seems to be telling you if SuperFly is available. But since you don't switch to it unless that's already the current render engine, there doesn't seem to be any point to testing whether you have SuperFly or not. If it's already selected (4) then you must have it.

    Further, the SetOptions, which is the only bit of code looking at the superfly variable, doesn't do anything. If r == 4 then not only do you know you have SuperFly but it's the active rendering engine AND the CurrentSuperFlyOptions are already whatever they are. Setting options to the current options is doing nothing. Same for FireFly - return the options to equal what they already are doesn't do anything. Plus you literally don't do anything with the return value from SetOptions, which is misnamed and should be called GetOptions.

    To put it more plainly, your entire script boils down to this:

    poser.Scene().RenderInBackground()

    The rest seems to me superfluous. Am I missing something?

    As well, render in background is already a menu item, and in my system I made a keyboard shortcut for it. What purpose does the script serve given we already have a menu (and a key stroke if desired) to do exactly the same thing?


  • Poser Ambassadors

    Just noticed the "by structure" in the title. So structure is the author?



  • @bagginsbill Correct, structure is the author. I just posted so folks here could put it to use. I don't see Andy online yet this morning.



  • The reason testing for firefly / superfly is there, is because I was leaving it open for further development. I had it in mind to write a full script and adding the extra functions lets other amateur coders play around and maybe learn something - I am aware that the script boils down to the line you posted @bagginsbill - but my primary job is not programmer - the script is free for people to use - or to ignore, learn something from - or - to teach me something, in the way of, "I have a better way of writing this function". Given that pretty much everything can be done from the menu - what is the point of writing any script? This script is just another way to make your shortcut.