Go Back   NewTek Discussions > LightWave 3D For Developers > LScript Discussions

Reply
 
Thread Tools Display Modes
Old 09-27-2009, 07:46 AM   #1
Hieron
Super Member
 
Join Date: Aug 2006
Location: Netherlands
Posts: 710
Script that renders all frames in a scene?

Yes, F10 in script form

The reason for such a thing is given in this thread:http://www.newtek.com/forums/showthr...692#post930692

Basically it is to circumvent LW keeping track of the radiosity cache in memory as it does with F10. With F9 one can get great results with a GI trick, F10 ruins it since it relies and reverting back to the base static cache per frame.

Would this be possible?


(saving of images would be done by one of the buffer savers in Image Filters I guess)
Hieron is offline   Reply With Quote
Old 09-27-2009, 09:02 AM   #2
Matt
Valiant Knight
 
Matt's Avatar
 
Join Date: Feb 2003
Location: Leamington Spa, England
Posts: 10,960
I'm looking at this now ...
__________________
www.pixsim.co.uk - video tutorials, scripts 'n' stuff
Matt is online now   Reply With Quote
Old 09-27-2009, 09:03 AM   #3
UnCommonGrafx
Wandering about
 
UnCommonGrafx's Avatar
 
Join Date: Feb 2003
Location: Indy
Posts: 4,531
You mean like using lwsn? A background renderer?

Look up Faulknermano's site, I believe, for a background renderer. Or google "Render frame render scene lightwave" for a plugin.

Never mind... got it.
__________________
Robert Wilson
UnCommon Grafx

Last edited by UnCommonGrafx; 09-27-2009 at 09:14 AM. Reason: chuckle, maybe some editable files there.
UnCommonGrafx is offline   Reply With Quote
Old 09-27-2009, 11:43 AM   #4
Matt
Valiant Knight
 
Matt's Avatar
 
Join Date: Feb 2003
Location: Leamington Spa, England
Posts: 10,960
Arrow

Well I sort of got it working, but there is a problem.

If you have 'Render Display' set to 'None' it asks you every frame if you want to turn on the 'Image Viewer'.

If you say no, it doesn't render the frame.

If you say yes, it jumps to the last frame and renders that only, I have no idea why it does this.

AutoConfirm(1) automatically closes the 'Preview' render display, which would work, if you set 'Render Display' to Render2Image, but I can't figure out why it's only rendering the last frame.

Here's the code if anyone can figure it out.

Code:
@name "F9 Frame Render"
@script generic

generic
{
    // Get scene render range info

    first_frame = Scene().renderstart.asNum();
    last_frame  = Scene().renderend.asNum();
    frame_step  = Scene().framestep.asNum();

    // Turn on Auto Confirm (closes render preview window automatically)

    AutoConfirm(1);

    // Loop through frames

    for(loop = first_frame; loop <= last_frame; loop+= frame_step)
    {
        // Go to frame

        GoToFrame( loop );
        
        // Show info

        info("Rendering Frame: " + loop + " / " + last_frame + " Step: " + frame_step);
        
        // Render frame

        RenderFrame();
    }

}
__________________
www.pixsim.co.uk - video tutorials, scripts 'n' stuff

Last edited by Matt; 09-27-2009 at 12:37 PM.
Matt is online now   Reply With Quote
Old 09-27-2009, 11:38 PM   #5
faulknermano
:
 
Join Date: Feb 2003
Location: New Zealand
Posts: 1,907
Just a shot in a dark: but try using Master class scripts with the process callback looking for the RENDER_DONE event. This keeps track of the init and completion of the render.
__________________
"The hardness of God is kinder than the softness of men, and His compulsion is our liberation." - C.S. Lewis

Advert:
Janus - multi-pass rendering
faulknermano is offline   Reply With Quote
Old 09-28-2009, 12:52 AM   #6
walfridson
mjau
 
walfridson's Avatar
 
Join Date: Apr 2004
Location: London
Posts: 1,046
^ what he said

Look at RenderQ.ls Bit undocumented.
__________________
http://walen.se my plugins
walfridson is offline   Reply With Quote
Old 09-28-2009, 03:40 AM   #7
Matt
Valiant Knight
 
Matt's Avatar
 
Join Date: Feb 2003
Location: Leamington Spa, England
Posts: 10,960
Quote:
Originally Posted by faulknermano View Post
Just a shot in a dark: but try using Master class scripts with the process callback looking for the RENDER_DONE event. This keeps track of the init and completion of the render.
Quote:
Originally Posted by walfridson View Post
^ what he said

Look at RenderQ.ls Bit undocumented.
I did think of using a Master script, even looked at RenderQ.ls, I'm not very up on Master Scripts, but will take a look another look.
__________________
www.pixsim.co.uk - video tutorials, scripts 'n' stuff
Matt is online now   Reply With Quote
Old 09-28-2009, 04:37 AM   #8
-EsHrA-
Registered User
 
-EsHrA-'s Avatar
 
Join Date: Feb 2003
Location: nl
Posts: 943
bg render? http://jeremy.lwidof.net/lscript/

mlon
__________________
lw_chanlum [free shader and node x32] <HERE!>
lw_chanlum [advanced node x32, x64, ub and osx] <HERE!>
-EsHrA- is offline   Reply With Quote
Old 09-28-2009, 06:38 AM   #9
Matt
Valiant Knight
 
Matt's Avatar
 
Join Date: Feb 2003
Location: Leamington Spa, England
Posts: 10,960
Actually, I've done it! Doing it as a Master Script worked!
__________________
www.pixsim.co.uk - video tutorials, scripts 'n' stuff
Matt is online now   Reply With Quote
Old 09-28-2009, 07:40 AM   #10
Matt
Valiant Knight
 
Matt's Avatar
 
Join Date: Feb 2003
Location: Leamington Spa, England
Posts: 10,960
Arrow F9 Render Sequence Script v1.0

Okay, here it is.

I did a little video to show how it works, and some of the issues you will find.

Video: F9 Render Sequence Script
QT H.264

Script, attached.

Hope you find it useful, although I have to admit, I'm not entirely sure why you wanted this! But I like the challenge of scripting!

Also, here's a link to the Render2ImageFP plugin I mentioned, which allows you to save to the same image (32 Bit Intel only).

http://www.splotchdog.com/index.php?...d=39&Itemid=39 (Latest version)

(Thread about it, but older version attached)
http://www.newtek.com/forums/showthread.php?t=56117

Cheers
Matt

P.S. Thanks to Bob Hood for not compiling his RenderQ.ls script so I could learn from it!
Attached Files
File Type: zip F9_Render_Sequence_Script.zip (2.5 KB, 212 views)
__________________
www.pixsim.co.uk - video tutorials, scripts 'n' stuff
Matt is online now   Reply With Quote
Old 09-28-2009, 08:41 AM   #11
3DGFXStudios
Space Monkey
 
3DGFXStudios's Avatar
 
Join Date: Sep 2005
Location: Earth
Posts: 1,509
Thanks for the script Matt! This is also really handy for the bug that exists in LW 9.6 (and in HC for sure) that buffers all frames if you're using a background image sequence.
__________________
3DGFXStudios is offline   Reply With Quote
Old 09-28-2009, 01:40 PM   #12
erikals
Registered Nerd
 
erikals's Avatar
 
Join Date: May 2003
Location: Noway
Posts: 5,986
great
thanks Matt

very curious to see how this will turn out...
btw, tested the Render2ImageFP, got a crash the first time i used it, not after though...
might very well do the job.

edit: just tested, both Render2ImageFP and F9 Render Sequence runs great
__________________
400 Lightwave vidz - Larry link - new NT forum icons - FogBugz454a4f

Last edited by erikals; 09-28-2009 at 01:52 PM.
erikals is offline   Reply With Quote
Old 09-28-2009, 02:16 PM   #13
erikals
Registered Nerd
 
erikals's Avatar
 
Join Date: May 2003
Location: Noway
Posts: 5,986
urm,... eh,... Render2ImageFP doesn't actually preview anything, sorry... was sleeping.
so, i guess that one doesn't work...

edit: agh, i keep going back and forth here, using Render2ImageFP now to avoid pop-ups...
not really sure if i'm doing things right...
__________________
400 Lightwave vidz - Larry link - new NT forum icons - FogBugz454a4f

Last edited by erikals; 09-28-2009 at 03:02 PM.
erikals is offline   Reply With Quote
Old 09-28-2009, 04:55 PM   #14
Matt
Valiant Knight
 
Matt's Avatar
 
Join Date: Feb 2003
Location: Leamington Spa, England
Posts: 10,960
Quote:
Originally Posted by erikals View Post
urm,... eh,... Render2ImageFP doesn't actually preview anything, sorry... was sleeping.
so, i guess that one doesn't work...

edit: agh, i keep going back and forth here, using Render2ImageFP now to avoid pop-ups...
not really sure if i'm doing things right...
Render2ImageFP from what I can gather (not actually used it) does the same thing as NT's Render2Image, it renders into the Image Editor, but allows you (apparently) to save over the same image, rather than adding every frame you render.

So it's not so much about not having the Image Viewer popup, as using using NT's Render2Image would put you in the same boat (holding all Frames rendered in memory) it's about being able to render to the Image Editor and replace the last rendered Frame in there, thus saving memory.
__________________
www.pixsim.co.uk - video tutorials, scripts 'n' stuff

Last edited by Matt; 09-28-2009 at 04:57 PM.
Matt is online now   Reply With Quote
Old 09-28-2009, 07:57 PM   #15
adk
Mumbler
 
adk's Avatar
 
Join Date: Feb 2003
Location: Melbourne
Posts: 557
... that's great, cheers a bunch Matt works like a treat with the psd export.

As PSD's would be an extra pain I tried to use DPont's Node Pixel Filter to save out the images. Funny thing is if I press F9 it works, if I use your script however I can't get it to save the images ? Well it actually worked once but I have no idea why it worked in that instance ? Weird.

Here's the setup & scene if anyone is interested. Might need Denis's help.

Thanks again
Attached Thumbnails
Click image for larger version

Name:	Pixel_Node.jpg
Views:	96
Size:	271.9 KB
ID:	77833  
Attached Files
File Type: zip Render.zip (12.9 KB, 54 views)
adk is offline   Reply With Quote
Reply

Bookmarks

Tags
revenge of the lenscap, rotfl


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 01:08 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 2000-2007, NewTek