• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

Batch Render in GMAX.

Started by joelyboy911, July 01, 2009, 12:54:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

joelyboy911

I have downloaded the BAT4MAX utilities, and used the features (in GMAX) such as create complex LOD to help my modelling. As I am modelling aircrafts (ATR 42/ATR 72 - see SCAG Creations) there are many different models, as well as other smaller props, that need exporting. However, when I go to the batch export function, I am presented with the usual export screens (each view, night time, NESW etc) but, and this is the crux of the issue, it renders totally white, as if all the texture bitmaps have been deleted or moved. I hope someone can point out what I am doing wrong, or how to fix it.
SimCity Aviation Group
I miss you, Adrian

joelyboy911

SimCity Aviation Group
I miss you, Adrian

Diggis

Sorry joel, I haven't been home to look at this.  As I use Max for the batch rendering I am unsure of how well the GMAX batch rendering works.  I'll also point this to chris for you.

Chrisadams3997

Thanks, updated script attached at the bottom.  The problem is that BAT loses the textures as you describe if the active viewport at render time is shaded in wireframe.  I'd actually put in a line of code to prevent this, but looks like I put in one wrong word (oops &ops) that instead of always changing it to 'smooth + highlights'was changing it to 'wireframe'--thus causing the problem everytime.  Sorry about that, but should work now, just download the update and replace the original script file inside your 'Gmax/gamepacks/BAT/scripts' folder.

Chris

joelyboy911

Excellent. Thank you very much
SimCity Aviation Group
I miss you, Adrian

Chrisadams3997

#5
Well, don't thank me yet, RebaLynn sent me an IM that it's still doing the same thing, but I have figured out why and might have a solution soon.  The maxscript manual gives wrong descriptions for what the commands I was trying to use do exactly:

max wire facet 
-Sets active viewport shading mode to Facets + Highlights 

max wire smooth 
-Sets active viewport shading mode to Wireframe 

The actual effect of each is that they toggle between wireframe and facets+highlights or wireframe and smooth+highlights, respectively.  Therefore, if you're already in smooth+highlights in a scene and use the 'Max wire smooth' command in a script, the scene goes into wireframe, hence our problem.  I'm working on a solution, but I need to do some testing.

Chris

EDIT: Looks like this should work, give it a try, and if you run into any problems, let me know :thumbsup:

joelyboy911

It is true that I hadn't gotten a chance to try it yet, but hopefully this one will do the trick.
SimCity Aviation Group
I miss you, Adrian

RebaLynnTS

#7
I am going to test it out now, and see what I get.

Edit: Getting closer, the first view still has no texture, the rest are fine after that. This only happens on the first thing in the batch. I can work around this for now.
Becca

Look for me at ... Becca At Bat

Chrisadams3997

Interesting... The first file in your batch list you used, if you open it up in Gmax, is it saved with wireframe or smooth turned on in it's active viewport?

RebaLynnTS

Saved with smooth in the active viewport, as all my files are.
Becca

Look for me at ... Becca At Bat

RebaLynnTS

After some more testing, anything with a sinle texture seems to work ok, but anything with more than one, the textures do not render.
Becca

Look for me at ... Becca At Bat

Chrisadams3997

I'd tested with one model (with many textures) and it'd worked, though extensive testing in Gmax just takes too long due to it's render times.  I've only got one computer and I need it available most of the time.  In theory the present version is checking if you're in a wireframe mode before applying the toggle, then toggles it until you're not (in case the first time it goes to another wireframe).  Outside of the script I have tested the code and it seems to work perfectly.  Sometimes inside of a section of code, due to multithreading the code doesn't all play out in the order it's written, which is the only thing I can immediately imagine that could cause different behaivor inside the batch rendering code as opposed to scripting the toggle independent of it.  But, it shouldn't toggle at all for scenes already in smooth.

Just do one thing for me before I go to try additional changes, be certain that you've replaced the original script in the right spot (it should have asked you if you wanted to overwrite the original when you unzipped or moved it there if it is).  Just covering the bases to avoid wild goose chases ;).

I'll also try to run a test tonight while I can spare the computer and see if I can replicate the issue.

Chris

RebaLynnTS

OK, I deleted the script, downloaded a fresh copy. Made sure it was in the right place (it was). Then ran it on 2 items. The first one rendered properly, but the second one had no textures. I was thinking about removing all the other scripts to be sure there are no conflicts, but not sure that is a good idea.
Becca

Look for me at ... Becca At Bat

joelyboy911

I exported 17 ATR-72s and one dairy farm milking shed overnight, on the latest script and it seemed to work fine for all of them. Though some of the ATRs had unexpected LOD discrepancies, however this is most certainly not related to the batch render function.

So I think the issues have been totally solved.
SimCity Aviation Group
I miss you, Adrian

RebaLynnTS

Any clue why I am still having the same problem then?

Could it be that I have not pre-created the LODs?

Should I switch all views to Smooth when I save?

I am at a loss.
Becca

Look for me at ... Becca At Bat

joelyboy911

For me it might be that I never use wireframe view. And I did pre-create all the LODs.
SimCity Aviation Group
I miss you, Adrian

RebaLynnTS

I set everything to smooth, and created all the LODS, and still am having problems. Could my version of GMax be the problem?
Becca

Look for me at ... Becca At Bat

joelyboy911

I have the latest version, which do you use?
SimCity Aviation Group
I miss you, Adrian

RebaLynnTS

Becca

Look for me at ... Becca At Bat

Chrisadams3997

It's hard to say.  LOD's are most certainly utterly disconnected from this issue.  If all of your files are saved in smooth, it should never be a problem theoretically, with or without the small section of the script in question.  While I wasn't aware of different versions of Gmax floating around (as I said, I never even use it anymore since I've got Max), but if a different version is returning different gw values(don't worry what that means :) ), it could trick my solution.

The last thing I'd try for you Reba is removing the corrective code from the script (it won't ever toggle the wire/smooth mode), you'll just have to be careful that all files you'd like to batch render are saved in smooth.  Personally, I always work with a single viewport, so I know which one is active (the only one!).  If you work with multiple viewports on the screen (such as the default), I'm not sure if Gmax saves which viewport was active when you saved (and therefor loads it with that one active) or not, so to be safe save with all of them in smooth, or do some testing to figure out how it loads.

If you want to try that, I'll post a version with that section stripped down for you tomorrow sometime.  I won't have any internet access from thursday through sunday, so if you don't hear from me after that, you know why ;)

Chris