Notifications
Clear all

[Closed] Confused by Net Render Syntax

I’ve only been using Maxscript for a day, so I’m sorry if this is an obvious question, but I’m totally bewildered by the help file’s description of how to do stuff with Net Render.

I’m writing a script that will automate a tedious process I have to do a lot; rotating, renaming and rendering the same scene over and over. I have most of the other stuff working, but getting it to connect to Manager (kind of important) is still greek to me.

I need to:

  1. Open the Net Render settings
  2. Connect to the servers
  3. Rename the job
  4. Verify that “Use Maps” is on
  5. Submit the job

My main problem with the Help file is that they seem to be pulling variables out of midair, which makes it hard to follow. If someone could point me to a tutorial or something, I’d be very grateful.

29 Replies

A little more info is needed to help you. Do you want to use the net render interface to submit the jobs or 3dsmaxcmd.exe or some other method? I have used the netrender interface in the past, but now I use the 3dsmaxcmd.exe to submit jobs using the HiddenDOSCommand. Are you using a mixed renderfarm 32bit/64bit machines (this is very important and is undocumented in the help)?

-Eric

Good gravy, Monkey. Is there any part of Max you aren’t an expert in? Every time I post one of these idiot beginner questions you’re all over it

I’m afraid I don’t know what 3dsmaxcmd.exe is. My experience with Net Render thus far has all been the direct approach, using the Render Scene dialogue to open the Network Job Assignment window. I can say, however, that we’re only using 32-bit servers.

Ok, well since you want to use “include maps” you will need to use the NetRender Interface (for more info on this check the Maxscript Help for netrender interface should be the second returned option). So now we will start, there are a few things you need to do to submit jobs: 1) You must connect to the manager before you can submit or modify jobs.
2) You need to create the parameters for your jobs, prior to submitting.
3) Submit the job.
So here we go:

/*Get and then connect to the manager*/
mngr = NetRender.GetManager() -- get an instance of the manager
if mngr.connected == false do ( -- check if you are already connected
  mngr.connect #automatic "255.255.255.0" platform:#32-- connect to the manager if not already connected and force 32bit mode
  --platform is an undocumented parameter used to connect to the manager for access to 32bit or 64bit jobs. You can only connect to one at a time.
)
/*Now that we have access to the manager we need to prepare the job for submission*/
job = mngr.newJob() -- create a new job
job.name = "New Job" -- assign a name to the job. this should be a unique name, replace this string with what you want.
/*From here you can set just about anything else you need.*/
job.includemaps = true -- set includemaps to true for the job
job.frameoutputname = @"\\path\path\Someoutputname.ext" -- here you supply the output information for this job. Replace the string with what you want.
/*Once done setting your render parameters you need to simply submit the job*/
job.Submit()

So there you go let me know if you have any more questions.

-Eric

1 Reply
(@mustan9)
Joined: 11 months ago

Posts: 0

Thanks Pixel_monkey!

Copy/pasted and it works. Just saved me some time.

Thanks a lot! Hopefully that will work nicely

One last thing. Do you know of a way to add a Browse button to the rollout? I want the user to be able to choose the directory the render will be going to.

use a regular button and in its ‘on <button> pressed’ event, use getSaveFileName() or getSavePath() (see help file) to get the filename/folder to save to, store that in a variable that gets used when the actual render is executed

Okay, I ran a test sequence last night for good measure. All you guys’ advice worked great, but I’m still hitting roadblocks. I think setting the output name in the nework code is causing problems. I’m having trouble dynamically adding the file extension to the code, which means that the manager doesn’t know what kind of file to make, which means they aren’t rendering. Also, the script I was using to rotate the model (selObj.object.rotation.z_rotation + 45) Doesn’t seem to work. I’ve also tried

rot_obj = eulerangles 0 0 45
rotate selObj.object rot_obj

with the same lack of success.

I hate to keep pestering you guys for advice, but I’m pretty lost here.

Could you post the portion of the code that shows what you are doing? It should be as simple as just adding it as part of the string in the frameoutputname parameter. Now if you need to set specific settings for the output then that needs to be handled through that plugins interface. So what format(s) are you wanting to use and what settings need to be set?

-Eric

What is .object? .object is not a parameter of most objects so that is probably where your issue is coming from. Again post the code you are trying to use so we can see how you are setting selObj and what you are trying to access. Also, are you trying to rotate around World or Local Z? This code works here for rotating around world Z:

 rot_obj = eulerangles 0 0 45                
  rotate selObj rot_obj

-Eric

Thanks Eric. Saves me some setup time for my new test project.

Page 1 / 3