[Closed] backburner spesified server assigning to job
please help with the code for specifying which servers to use for the job
i’ve used the below code but got an error
job.Submit servers:#("server03", "server05")
but
srv_list = m.getservers()
job.submit servers:srv_list
or
job.submit()
are working fine.
needed to use only one server of rendedrfarm, server02 for example.
it’s pretty straight forward. first get all the servers and then collect the one(s) you want into a new array and pass that as the servers argument.
allServers = m.getservers()
selectedServers = for s in allServers where mattchpattern s.name pattern:"server02" collect s
job.submit servers:selectedServers
i’ve got such a result on allServers = m.getservers() command
#(<MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, <MixinInterface:NetServer>, ...)
so mattchpattern was undefined
all servers in renderfarm have names server01, server02 and so on
i mis-spelled ‘matchpattern’ ( was spelt ‘mattchpattern’ )
fix the typo and it will work
EDIT: also check out the ‘NetRender’ interface in the help. it has all the info you need
and is there any way to specify several servers?
for example “cg2001”, “cg3004”, “cg3006”
because now i can use only servers which names are based on “cg200*”
i have pretty much the same problems and i can’t find a documentation about what is in the given
<MixinInterface:NetServer> array…
i've tried to get some servers by a defined group with follow code:
srv_list = render_manager.getservers filter:#group key:"aVaildGroup"
-- returns an empty array ;(
according to the maxscript documentation it should work but i just get an empty array. if i asked how many groups are exsisting with
render_manager.numGroups
i got the right number of groups back. but there is still a problem...
g_name = render_manager.GetGroupName 1 --the name of the first group
-- returns an empty string...
this code does not work! you are not able to GetGroupName out of an index.
so, is there a way to get a server-array or something else i can use just by knowing the groupname which servers belongs to?
thanks in advanced.
Norweschendir
i did not find a solution for getting a given group out of the manager… but for now i will use the following script:
render_m = NetRender.GetManager() --get a NetManager instance
render_m.connect #manual "127.0.0.1" -- connect to the manager
if( render_m.QueryControl #wait ) do --only take control if you have permission
( render_m.getcontrol() ) --takes queue control
render_m.wantControl = true --if another client does QueryControl(), they will get a return value of false
render_m.Lock true --this completely prevents others from getting queue control
job = render_m.newJob() -- creates a new job
job.name = maxfilename -- assign given job name
job_zw = job.name -- remember given job name ;)
-- check if the given jobname is already in use in the farm. if exist the name will be changed
jobs = render_m.getjobs filter:#name key:job.name
bar = 2
while ( jobs.count > 0 ) do -- until the job name is already in use in the farm, change the name
(
job.name = job_zw + "_" + (bar as string)
jobs = render_m.getjobs filter:#name key:job.name
bar = bar + 1
)
job.suspended = true-- submit suspended?
allServers = render_m.getServers()
srv_list = #()
for i in allServers do
(
case i.name of
(
"mowo_pc_091_w7":
( append srv_list i )
"mowo_pc_090_w7":
( append srv_list i )
"mowo_pc_197_w7":
( append srv_list i )
"mowo_pc_198_w7":
( append srv_list i )
default: ()
)
)
job.submit servers:srv_list
render_m.Lock false --others can now get control
render_m.wantControl = true -- other clients can now get QueueControl
render_m.disconnect() -- end this session
i am still locking forward to find a way to get groups…