Tommy L Posted November 14, 2011 Share Posted November 14, 2011 Is it possible (using plugins if necessary) to include X-Ref on/off in scene state? Or something similar? I have a scene which has 12 cameras and each camera needs to render a different condition in the scene. Scene state combined with Batch render gets me most of the way there, but the solution is completely undone if I cant control what XRefs are turned on for which camera. Any help much appreciated, Tom. Link to comment Share on other sites More sharing options...
Fernando Lino Posted November 15, 2011 Share Posted November 15, 2011 I think using layers is the way to go. Link to comment Share on other sites More sharing options...
Tommy L Posted November 15, 2011 Author Share Posted November 15, 2011 i dont want to keep all the geometry in the file. Link to comment Share on other sites More sharing options...
datacrasher Posted November 15, 2011 Share Posted November 15, 2011 Tom Are you talking about combining the scene together if so i would use video post or another program like combustion if you have access to it Tony Link to comment Share on other sites More sharing options...
Fernando Lino Posted November 15, 2011 Share Posted November 15, 2011 I did some tests in the past, I got almost the same rendertimes turning off layers or xrefs. Link to comment Share on other sites More sharing options...
Tommy L Posted November 15, 2011 Author Share Posted November 15, 2011 Tom Are you talking about combining the scene together if so i would use video post or another program like combustion if you have access to it Tony Tony, you are quite active on this forum but Ive yet to see any reason for you to be so. Link to comment Share on other sites More sharing options...
Tommy L Posted November 15, 2011 Author Share Posted November 15, 2011 I did some tests in the past, I got almost the same rendertimes turning off layers or xrefs. Yes, its not rendertime Im worried about. I have high res car models being deconstructed to elements (about 200mb per .max file) and reconstructed. Each is driven by a particle system and carries its own animated material. if they are all in the file (12 of them) then the .max file becomes unmanageable. Link to comment Share on other sites More sharing options...
Cyberstyle Posted November 15, 2011 Share Posted November 15, 2011 (edited) Are you able to set up a container for each car and inherit the container into your scene. If you use the global object properties overide of each container it will be recognised in the scene states, so you could switch each one on/off dependant on what camera is rendering. I get that you'd still need to inherit all the containers in the scene at once but there may be a better way to handle the data than what an x-ref can provide due to the extra features and functionality of the container. Edited November 15, 2011 by Cyberstyle Link to comment Share on other sites More sharing options...
Crazy Homeless Guy Posted November 15, 2011 Share Posted November 15, 2011 (edited) I have been thinking about this for the last hour and I think I have a solution that might work... I don't have Max in front of me right now so I am not sure if the standard batch script rendering dialog allows you to load pre-render scripts but I know Sergey's Batch Camera Render does. If the Max default one does not support pre-render scripts, download Sergo's and use it. Just make sure to use the1.9.x version and not the 2.0. The next step would be writing 12 Max Scripts that tell max what xref's to turn on, and which to turn off. Writing the scripts should be fairly simple, and only require monitoring the listener to see what is happening when you enable and disable the Xfref's. To acquire the code you need simply open the Max Script listener and watch what lines it spits out as you turn on and off the Xref's manually. Then just copy and paste the lines that were generated into Notepad, and save it as something that makes sense.. LoadCar01.ms, LoadCar02.ms, LoadCar03.ms... Now assign the Max Scripts you just saved out to the pre-render script roll-out in whatever batch render dialog you are using (Segey's or default.) If all goes well this script will run turning on and off the proper Xref's as the job goes to render. Since I am not at a computer with Max on it so I can't look into this and see if it would actually work, but in my head it makes sense. Edited November 15, 2011 by Crazy Homeless Guy Link to comment Share on other sites More sharing options...
Tommy L Posted November 15, 2011 Author Share Posted November 15, 2011 Thanks Travis, just the kind of answer I was looking for. Ill give it a shot. I really think batch render and scene state are vastly under-developed tools in Max that have huge benefits on pipeline. I guess because its not node based these are the only tools that offer any kind of procedural render toolset, but it really feels like a workaround when I use them together. I have been thinking about this for the last hour and I think I have a solution that might work... I don't have Max in front of me right now so I am not sure if the standard batch script rendering dialog allows you to load pre-render scripts but I know Sergey's Batch Camera Render does. If the Max default one does not support pre-render scripts, download Sergo's and use it. Just make sure to use the1.9.x version and not the 2.0. The next step would be writing 12 Max Scripts that tell max what xref's to turn on, and which to turn off. Writing the scripts should be fairly simple, and only require monitoring the listener to see what is happening when you enable and disable the Xfref's. To acquire the code you need simply open the Max Script listener and watch what lines it spits out as you turn on and off the Xref's manually. Then just copy and paste the lines that were generated into Notepad, and save it as something that makes sense.. LoadCar01.ms, LoadCar02.ms, LoadCar03.ms... Now assign the Max Scripts you just saved out to the pre-render script roll-out in whatever batch render dialog you are using (Segey's or default.) If all goes well this script will run turning on and off the proper Xref's as the job goes to render. Since I am not at a computer with Max on it so I can't look into this and see if it would actually work, but in my head it makes sense. Link to comment Share on other sites More sharing options...
Justin Hunt Posted November 15, 2011 Share Posted November 15, 2011 I know it wont help you but after seeing the logic of how Katana http://www.thefoundry.co.uk/articles/2011/10/27/294/katana-10-launches/ works its workflow is exactly what you are after. Pitty is doesn't work with Max and is $$$$$$$$$$$$$$$$$$$$. jhv Link to comment Share on other sites More sharing options...
Tommy L Posted November 16, 2011 Author Share Posted November 16, 2011 I can use the Preset option in batch to pull a render preset which includes the Pre-Render script function in Scripts panel of the (thats a mouthful) render panel. Now I just need to write a script. It will be my first. Call me a klutz, but I cant see the maxscript generating in the listener as I make commands (ie, turn off xref)? Link to comment Share on other sites More sharing options...
Justin Hunt Posted November 16, 2011 Share Posted November 16, 2011 turn On the Macro Recorder in the lister window, just remeamber to turn if OFF once you have the code you need jhv Link to comment Share on other sites More sharing options...
Tommy L Posted November 16, 2011 Author Share Posted November 16, 2011 (edited) Are you able to set up a container for each car and inherit the container into your scene. If you use the global object properties overide of each container it will be recognised in the scene states, so you could switch each one on/off dependant on what camera is rendering. I get that you'd still need to inherit all the containers in the scene at once but there may be a better way to handle the data than what an x-ref can provide due to the extra features and functionality of the container. I missed this, thanks for the contribution. Im using Max 2010. I had a bad experience last time I used containers, frankly, I just didnt get it. This may be an occasion that merits time spent testing containers, but Im just so slammed with work I may just hire a scriptwriter to make a tool that matches Travis's solution. EDIT: Just did some reading on containers. I think its an elegant solution in another job. This one is unwieldy because of the particle systems in each of the XRefs. If I pull all the XReffed files in as inherited containers, its going to be attempting to periodically update 12 particle systems, which will not work. Edited November 16, 2011 by Tommy L Link to comment Share on other sites More sharing options...
Tommy L Posted November 16, 2011 Author Share Posted November 16, 2011 turn On the Macro Recorder in the lister window, just remeamber to turn if OFF once you have the code you need jhv MacroRecorder seems to ignore what happens in the XRef window. Link to comment Share on other sites More sharing options...
notamondayfan Posted November 16, 2011 Share Posted November 16, 2011 Sounds complex! It it were me I could avoid scene states and simply have 1 camera, 1 lighting setup in each file, then only enable the needed xrefs for each file. I also stumbled over this http://www.scriptspot.com/3ds-max/scripts/tags/xref which if you look into the script you can see xrefs are controlable by scripting to an extent, but sadly it's over my head to offer any real advice. Link to comment Share on other sites More sharing options...
Crazy Homeless Guy Posted November 16, 2011 Share Posted November 16, 2011 (edited) Hi Tom, I didn't realize that the MaxScript listner doesn't record the XREF info. I did a bit of tinkering this morning and found somehting that should work. So... I think you can look at the code below and decipher it. Right now it is set up for 3 Xref's, with the first being enabled, and the second 2 being disabled. Just save it to a .ms file, and assign it as a pre-render. x01 = xrefs.getXRefFile 1 x01.disabled = false x02 = xrefs.getXRefFile 2 x02.disabled = true x03 = xrefs.getXRefFile 3 x03.disabled = true I am not a big fan of containers. In concept they sound awesome, but my real world experience with them has proven less than ideal. I find them to be uber slow with large files. Edited November 16, 2011 by Crazy Homeless Guy Link to comment Share on other sites More sharing options...
Tommy L Posted November 16, 2011 Author Share Posted November 16, 2011 Thanks CHG! Ill give it a try. I got in touch with Mark Olsen. Here's what he sent me in an email, Im sure he wont mind me sharing: Hey Tom, The short answer is this: (xrefs.getXRefFile 1).disabled = false; Where the number 1 is the index of the files listed in the xref dialog. The long answer is attached. Usage: turnOnXRef index:1 -this turns on xref number one and opens a message box if index number 1 does not exist turnOnXRef fileName:"13948.max" -this looks for the name of the file in the list and turns it on turnOnXRef index:0 - Opens a message dialog telling you which xrefs exist. This is more of a dugging tool for me. Link to comment Share on other sites More sharing options...
Crazy Homeless Guy Posted November 16, 2011 Share Posted November 16, 2011 Nice. He did it one line. My scripting is usually no more than a few lines pieced together. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now