Interfaces > Core Interfaces > NetRender |
This Core Interface exposes the Network Rendering to MAXScript.
In order to access network rendering through MAXScript, you need to create a manager instance.
The NetManager Mixin Interface returned by the NetRender.GetManager method lets you access network rendering through MAXScript.
The following properties can be used to get information or set certain properties of the manager.
Returns true if connected to the manager. Read-only.
Returns the status of the manager. Various information about the manager can be gathered through netstatus , see netstatus topic. Read-only.
If you have QueueControl, and other computers call QueryControl, this indicates whether you want to maintain control, or relinquish it; their call to QueryControl will return whatever you have set for WantControl
True , if you currently have QueueControl. Read-only.
Returns the number of jobs in the queue. Read-only.
Returns the number of servers. Read-only.
The following methods can be used to query and or control the manager.
<netManager>.setCallback <#progress | #message | #update | #managerdown | #queuecontrol | #querycontrol> <somefunction>
Used to listen to the manager for certain event types that occur during a network render. For each event type, you can call a single function that you define. Each of the 6 callback types is one type of event, and you can install a callback for any of these event or none.
You must define the function to take a different number of arguments depending on the event type.
Requires 2 arguments, they can be:
Called anytime a download/upload is underway, including anytime you fetch information about jobs or servers.
Requires a function defined with 2 integer parameters, ’r;Total’ and ’r;Current’. Total is the total amount to transfer, and Current is the amount tranferred so far.
Called when the manager has a text message for the user. Requires a function defined with 1 string parameter which is the message text.
Called when something has changed, like a job started or finished. Let's you know when you need to make GetUpdate calls, or other refreshing. Requires a function defined with no parameters.
Called when the manager shuts down. Requires a function defined with no parameters.
Called whenever queue control changes. Requires a function defined with no parameters.
Called when you have Queue Control, and another computer wants it, either via the QueueManager, or with the script function <netManager>.QueryControl(). If you want to keep control, set the value <netManager>.WantControl to true, otherwise set it to false. The function must take one argument, which is the name of the machine requesting control. See the function <netManager>.QueueControl() for more information.
<netManager>.GetCallback <#progress | #message | #update | #managerdown | #queuecontrol | #querycontrol>
Returns the name of the function used for that particular callback. Returns an empty array if no callback is assigned. Requires 1 argument, can be:
#progress : Called anytime a download/upload is underway, including anytime you fetch information about jobs or servers
#message : Called when the manager has a text message for the user
#update : Called when something has changed, like a job started or finished. Let's you know when you need to make GetUpdate calls, or other refreshing
#managerdown : Called when the manager dies
#queuecontrol : Called whenever queue control changes
#querycontrol : Called when you have Queue Control, and another computer wants it
platform enums: { #32|#64|#default }
platform default value: #default
Establishes a connection to the manager, allowing access to job states, server states, editing job settings, etc.
The optional platform: argument can be used to specify 32 bit or 64 bit platform. The default is based on the platform of the 3ds Max copy the command is being executed from.
You can either connect to a manager manually by specifying the manager name or ip address of the manager as a string, or automatically by specifying the subnet mask and optional port number,
FOR EXAMPLE: |
or |
or |
in either case, you can specify the optional port number should the manager be using a non-default port number. Will return true if connection was succesful. |
Disconnects the connection established with <netManager>.connect.
Shutsdown the manager. You must have queue control to do this.
This requires either #wait or #dontWait . The function works as follows:
Nobody has queue control: #dontWait returns true , #wait returns true .
Someone has queue control: #dontwait returns false , #wait prompts the current queue controller.
In the last case, the queue controller gets the QueryControl callback, and must indicate if they want control. If that user indicates they want to keep control, then the function returns false , if they will give up control (or the 10 second timeout expires), it returns true . Note that the QueueManager gives a prompt for the user to indicate what they want; in MAXScript, you just get the callback and have to use the wantControl value.
Takes control of the queue. Returns true if control was taken. From that moment on, jobs can be submitted, edited, reprioritized, servers can be removed, until queue control is relinquished.
Locks out others from getting queue control; and if they call QueryControl , it will automatically return false . For example, suppose you got control of the queue through MAXScript using getcontrol() , someone else who has the queuemanager up in readonly mode can request queuecontrol. Setting lock to true , will disallow anyone else to take control until you until you disconnect from the manager, or until you reset the lock to false. Note that the QueueManager always calls QueryControl to check if it can grab the queue.
This function’s usage resembles the Lock() function, in that a boolean value is passed, and you must already have queue control. Setting updates to false will freeze the manager so that it refuses any changes to the queue. It does not affect the callbacks. Fewer Update callbacks will be received, since the job queue is not updating. Use this function when submitting large numbers of changes, and when you want all the changes to take effect at the same time. This will occur when setUpdates() is called with a true value.
Takes 1 argument, a pathname defined as a string, ie "c:\\temp". It verifies that the path exists, returns "The system cannot find the path specified. (0x3)" if the path doesn't exist.
that the manager checks this output path relative to itself, not to your local machine. Thus if you pass "C:\\" and you have not shared you C drive, it will return OK (because the manager checks its own C drive). Thus you should use a network name when calling this function, like "\\\\mymachine\\share\\". Also, if the parameter does not end in \\, the functions assumes you're naming a file (not a directory) and checks whether this file could be created. Always include the \\ at the end if you're checking whether a directory is accessible.
Various functions and properties can be used to access jobs. You can use the GetJobs() function to retrieve an array of all jobs in the queue. The jobs can be filtered in various ways to return an array based on the filter.
WARNING! |
---|
Do not call GetJobs() or GetServers() very often, because these are VERY heavyweight methods. |
<netManager>.getjobs [filter:#suspended | #complete | #waiting | #started | #error | #name | #handle | #index] [key:<name> | <handle> | <index>]
The latter three filter types require a corresponding key argument. If used without a filter, returns an array of all jobs in queue. If no jobs are in the queue, an empty array will be returned.
filter :#suspended: Returns an array of all suspended jobs. Returns an empty array #() if no jobs are suspended
filter :#complete: Returns an array of all completed jobs. Returns an empty array #() if no jobs are complete.
filter :#waiting: Returns an array of jobs that are waiting to be rendered or are being rendered. Will return an empty array #() if no jobs are waiting.
filter :#started: Returns an array of jobs that are actually started and being rendered.
filter :#complete: Returns an array of all completed jobs. Returns an empty array #() if no jobs are complete
filter :#error: Returns an array of all jobs experiencing an error. Returns an empty array #() if no jobs have errors
filter :#name: Pass a name as the Key argument; Returns an array of all jobs with the given name. Returns an empty array #() if the no jobs have that name
filter :#handle: Pass a handle as the Key argument; the job with that handle will be returned (as an array with one element). Returns an empty array #() if the no job has that handle
filter :#index: Pass an integer as the Key argument; the job at that index in the queue will be returned (as an array with one element). Returns an empty array #() if the no job exists at that index
Changes the order of the jobs in the queue. The array must contain the same jobs that are contained in the array from .getjobs(), although they can be in different order. You must also have queuecontrol, use .getcontrol() function to take control before setting the job order.
Creates a new job instance. It requires a valid max file name, ie a max file that exists somewhere on the hard drive or the network. Returns a job definition if the file exists, undefined if the file can’t be found.
Updates the information about the selected job. Remember this involves a network interaction, so it’s a heavyweight operation
Updates the job in the queue with new job settings. Must have queuecontrol. Use <netManager>.getcontrol() to get queue control. Remember this involves a network interaction, so it’s a heavyweight operation.
Submits a new job to be rendered to the queue. Must have queuecontrol. Use <netManager>.getcontrol() to get queue control. if no servers are provided, then all servers will be assigned to the job.
Suspends the selected job. Must have queuecontrol. Use <netManager>.getcontrol() to get queue control.
Will cause the job to resume where it left off when it was suspended. Must have queuecontrol. Use <netManager>.getcontrol() to get queue control.
Will restart the job from the beginning. Must have queuecontrol. Use <netManager>.getcontrol() to get queue control.
Will delete the job from the queue. Must have queuecontrol. Use <netManager>.getcontrol() to get queue control.
Assigns a selected server to the job. Must have queuecontrol. Use <netManager>.getcontrol() to get queue control.
Removes a server from the selected job. Must have queuecontrol. Use <netManager>.getcontrol() to get queue control.
Gets information about a particular server assigned to the job. Requires a server number, 1 based.
Returns true if the output cannot be rendered one frame at a time (like an .MOV file). READ-ONLY.
Returns true if the render cannot be resumed after it is interrupted or suspended.
For example, you cannot render half of an .AVI file, then finish it later. You need to render the whole thing without interruption. Read-only.
Returns an array of cameras in the scene. An empty array #() is returned if no cameras are in the scene.
Returns the log for the job as text. The 'start' and 'numLines' parameters are optional. If you pass no parameters, you get the entire log. If you only pass start, you get every line starting from the given line. If you pass only numLines, then start is assumed to be 0.
Returns any messages from the chosen server assigned to the job. Will return an empty string if no messages from the server. Read-only.
Returns the number of servers assigned to the job. Read-only.
Returns the state of the job. This can be #complete, #suspended, #busy or #waiting . Read-only.
This function gives low-level information that is intended for internal-use-only.
Returns the job’s handle. Read-only.
Many of the following values are read-write, but changes you make to these values will not register with the manager until you call <job>.SendUpdate().
Returns the name of the job. The name can be changed.
Returns the job’s extracted file size. Read-only.
Returns the time at which the job was submitted as a string.
Returns the time at which the job was started as a string. Returns undefined if job hasn’t started. Read-only.
Returns the time at which the job was finished as a sting. Returns undefined if job hasn’t finished. Read-only.
Returns true if notifications are on. Can be changed.
Returns true if notified of failures. Can be changed.
Returns true if notified of progress. Can be changed.
Returns true if notified of progress is on. Can be changed.
Returns an interval at which notifications occur. Can be changed.
Returns the rendering start frame. Can be changed.
Returns the rendering end frame. Can be changed.
Returns the rendering frame interval. Can be changed.
Returns the width of the rendered frame. Can be changed.
Returns the height of the rendered frame. Can be changed.
The number of completed frames for the job. Read-only.
Returns true if there is a video post sequence. Read-only.
Returns true if the job was submitted with include maps on. Can be changed.
Returns true if skip rendered frames was set to on when job was submitted. Can be changed.
Returns true if use all servers was set to on when job was submitted. Can be changed
Returns true if the job is suspended. Read-only. To suspend the job use <job>.suspend().
Returns true if the job is finished. Read-only.
Returns true if the job was submitted with ignore share on. Can be changed.
Returns true if the job was submitted with skip output test on. Can be changed.
Returns true if the job was submitted to render non sequential frames. Can be changed.
Returns false if the job is a max job. Read-only.
Returns false if the job file is compressed. Read-only.
Returns true if the job was submitted with gamma correction on. Can be changed.
Returns a float value of the incoming gamma value. Can be changed.
Returns a float value of the outgoing gamma value. Can be changed.
Returns a float value of the render pixel aspect ratio. Can be changed.
Returns a string with the name of the camera view being rendered. Will return an empty string if view being rendered is an non camera view, ie perspective, front, user, etc... Can be changed. Use <job>.getcameras() function to get a list of valid cameras in the scene to change to.
Returns true if a job was submitted with the render elements active. Note that this will return true even there aren’t any elements to be rendered. Can be changed.
Returns the number of objects in the scene as an integer. Read-only.
Returns the number of faces in the scene as an integer. Read-only.
Returns the number of lights in the scene as an integer. Read-only.
Returns the scene start time in frames, so if your scene is set to use MM:SS:Ticks, this will still return a value in frames.
Returns the scene end time in frames.
Returns true if the job was submitted with videocolorcheck on. Can be changed.
Returns true if the job was submitted with force 2 sided on. Can be changed.
Returns true if the job was submitted with render hidden objects on. Can be changed.
Returns true if the job was submitted with render render atmospheric effects on. Can be changed.
Returns true if the job was submitted with superblack on. Can be changed.
Returns true if nth serial numbering is on this property is accessible through the preferences \ rendering dialog.
Returns true if Dither Paletted was enabled when the job was submitted. Can be changed.
Returns true if Dither True Color was enabled when the job was submitted. Can be changed.
Returns true if Render Fields was enabled when the job was submitted. Can be changed.
Returns true if displacements was enabled when the job was submitted. Can be changed.
Returns true if render effects was enabled when the job was submitted. Can be changed.
Returns either #odd or #even depending on what the field order was set to when job was submitted. Can be changed.
Returns the number of render elements in the scene. Read-only.
Returns the name of the user, as a string, that submitted the job. Note that if a job is submitted through MAXScript using <job>.submit(), and the max file was last saved by another user on a different computer, the username will be that of the other user. Read-only
Returns the name of the computer, as a string, that the job was submitted from. Note that if a job is submitted through MAXScript using <job>.submit(), and the max file was last saved by another user on a different computer, the computername will be that of the computer on which the max file was last saved. Read-only
Returns the shared folder as a string where all jobs are stored on the manager.
Returns a string of frames to render, ie "1,3,5-12" . Can be changed.
Returns the name and path of the output file. Can be changed
Returns the output gamma of the rendered frames.
Returns the device name if a device is specified at render time.
Returns information as a data structure about the nth element in the. The <element> structure is defined below. Returns undefined if no element at the index number, eg: el = jobs[1].getrenderelement 1 -- retrieves the 1st element in the 1st job in the queue. With this you can find out if the element is enabled, if filtering is enabled, if atmosphere is applied, if shadows are applied, the element name and the element output filename. The following are the properties that are valid for an element.
Returns true if the element is enabled. Can also set it’s state.
Returns true if filtering is enabled. Can also set it’s state.
Returns true if atmosphere is applied. READ-ONLY
Returns true if shadows are applied. READ-ONLY
Returns the elements name. Name can be changed.
Returns the element’s output file name. Output name and path can be changed, however, changing the filetype will change the extension of the image but not the actual file type, eg: the current output returned is "\\ej4sf\frames\foo_diffuse.tga" , changing the extension to .bmp will just result in the tga file having a .bmp extension instead of the .tga extension.
Sets the selected render element to the new values assigned to the element. In order for the change to take effect in the job, you need to do a <job>.sendupdate() to update the job itself in the queue.
Returns information, as a data structure, about the nth frame. The index is 1 based. The <frame> structure is defined below.
Returns the state of the frame. The state can be #waiting , #assigned or #complete .
Returns the actual frame number. Read-only.
Returns the serverhandle. Should return undefined when frame hasn’t been rendered yet. Read-only.
Returns the name of the server that is assigned to that frame. Should return undefined if the frame isn’t assigned yet. Read-only.
Returns the time it took for the frame to render. Should return undefined if the frame isn’t assigned yet. Read-only.
Various functions and properties can be used to access rendering servers. You can use the getservers() function to retrieve an array of all servers managed by the manager. The servers can be filtered in various ways to return an array based on the filter.
WARNING! |
---|
Do not call GetJobs() or GetServers() very often, because these are VERY heavyweight methods! |
<netManager>.GetServers [filter:#idle | #busy | #absent | #suspended | #error | #group | #job | #handle | #index] [key:<string> | <integer> | <job> ]
If used without a filter, GetServers () will return an array of all servers managed by the manager. If there are no servers, the function will return an empty array.
filter:#idle: Returns an array of all idle servers
filter:#busy: Returns an array of all servers busy rendering a job
filter:#absent: Returns an array of all servers that are absent, ie that were connected to the manager at one point but that are either down or the server service or serverapp is not running on it.
filter:#suspended: Returns an array of all suspended servers
filter:#error:Returns an array of all servers experiencing an error
filter:#group: Returns an array of servers in a group. Requires that the key option is used, the key can be a group name as a string or a group number as an integer (1 based). An empty array is returned if no groups are defined.
filter:#job: Returns an array of servers that are assigned to the specified job. Requires that the key option be used, the key must be a job definition.
filter:#handle: Returns the server with a given handle (as an array with one item). Requires that the key option be used, the key must be a server handle.
filter:#index: Returns the server at a given index in the server list (as an array with one item). Requires that the key option be used, the key must be an integer (the index).
Gets an update on the state of the server. Returns Ok if successful.
Updates the server with new settings. Must have queuecontrol.
Deletes the server from the manager. Must have queuecontrol.
Resets the performance metric to 0.0. Must have queuecontrol and must do <server>.sendupdate() to update the server.
Returns the server’s handle. Read-only
Returns the state of the server, this can be #idle, #absent, #busy
Returns the name of the server. Read-only
Returns the total number of frames rendered by the server. Read-only
Returns the total time that the server has been up. The value returned is in hours.
Returns the performance index of the server. Read-only
Returns the priority, as an integer, of the server when the user is logged in.
Returns the priority level, as an integer, of the server when the system is logged out.
Note that this is only valid if running serversvc and the user is not logged in on the system. If running serversvc and a user is logged in on the system then the attendedpriority values are in effect. Can be changed.
Returns an array of 7 bitarrays. Each bitarray is a day, each bit is an hour, each bit within that bit array means that the server is available at that hour. A bit array of #{1, 3..5, 15..24} means that the server is available from 12 midnight to 1am, from 3am to 5am and from 3pm to midnight.
Returns the handle ofthe job it is working on. Will return a value of 0 if no job is being worked on by that server.
Returns the frame index of the job that the server is working on.
Returns the time at which the frame being rendered was started.
Returns the number of servers in the nth group.
Returns the name of the nth group.
Creates a named group of servers. It takes 2 arguments: an array of servers and a string to define the group name.
Both manager and servers have a netstatus property. All properties are Read-only.
Returns the amount of space in megs on a specified disk. The index is 1 based. Disks 1 and 2 are the a: and b: drives.
Currently, this only returns correct results for one disk, your workdisk (given by . workdisk ). You actually need to pass (workdisk+1).
To maintain compatibility with UNIX/Linux, a NetStatus object will always report exactly 1 disk, which is the work disk. Thus, the NetStatus.SpaceOnDisk() value will not actually be correct, though it is still possible to determine the amount of free space on the working disk (which is the information most users will usually want):
Returns the number of dropped packets.
Returns the number of bad packets.
Returns the number of TCP requests
Returns the number of UDP packets
Returns the time at which the system was started.
Returns the amount of memory of the system.
Returns the number of processors in system machine
Returns the login name of the user logged in on the computer or the login name used by the service.
Returns the name of the computer.
Returns the disk where max is setup.
Returns a bitarray of which disks exist (1=A, 2=B, 3=C etc.) .
To maintain compatibility with UNIX/Linux, a NetStatus object will always report exactly 1 disk, which is the work disk. Thus, the NetStatus.Disks() value will not actually be correct, though it is still possible to determine the amount of free space on the working disk (which is the information most users will usually want)
Returns the MAC address of the system’s network card. If the computer is a network server, this is its handle.
The following properties are no longer supported in 3ds Max 5 and higher because of the introduction of the Backburner technolgy:
In 3ds Max 4, it returns an integer, a value of 1 indicates win95, a value of 2 indicates WinNT.
In 3ds Max 4, it returns an integer. When the platformID indicates a WinNT system, a value of 5 or higher here indicates Win2k.
In 3ds Max 4, it returns an integer. Win98 is indicated by a minor build greater than 0 for win95
In 3ds Max 4, it returns the build number, this only applies to winnt and win2k. Not supported under win95, win98 or win ME.
In 3ds Max 4, it returns the service pack number of the OS as a string.
In 3ds Max 4, it returns the tempdir for the system.