[Closed] Error: Duplicate Job Name
Hi all
Im a beginner in the scripts world , and im trying to do a tool to send jobs to backburner , i woul like to know if there are any form to get a specific job name and do an incremental , this is my little copy paste code max script .
posicion=findString maxFilePath "05_iluminacion"
pre=substring maxFilePath 1 (posicion-1)
final=pre+"06_render\\"
base=findstring maxfilename "base"
prefile=substring maxfilename 1 (base+4) + ".tga"
base2="base\\"
--render framerange: animationrange
s0=findstring maxfilename "shot"
s1= substring maxfilename 1 (s0 +6)
s2= "base_01"
archivosalida=final+base2+prefile
mngr = NetRender.GetManager()
if mngr.connected == false do (
mngr.connect #automatic "255.255.255.0" platform:#32
)
job = mngr.newJob()
job.name = s1+s2
job.includemaps = true
job.frameoutputname = archivosalida
job.Submit()
thank you so much of your help in advance
I was working on somthing similiar a few weeks ago. Have a look at this. you should be able to find what you need from it or it might just be what you needed. I made this version just to figure out how to get the jobs info and incrment the job name if needed. I also must mention that parts of this code have been borrowed from other scripts that have been posted here on cgsociety and I can’t seem to remember who I got it from. So if any one see’s some of there code I here please let me know so I can thank you and add you to the script.
note: that you will need to have your scene saved with a file name and a render output path stored before you run the script or you will get an error. I never fixed that becuse I integrated this into a larger script.
--------------------------------------------------------------------------------
-- Network Rendering
-- version 1.0
-- max version 2011
-- written by Michael Burgoyne
-- [www.burgoynedesign.com]( http://www.burgoynedesign.com)
-- last updated 02/28/11
--------------------------------------------------------------------------------
--
-- Simplified dialog to submit jobs to backbuner.
--
--------------------------------------------------------------------------------
global GetJobsInfo
try destroyDialog GetJobsInfo catch()
global m=#()
global jbs=#()
global job=#()
global MyPlatform = #32
global netaddress="10.0.0.3" -- the ip of your manager
numb = 0
global jobName = ((filterString maxFileName "_" )[1]+ "_" + fileName + "_" + passName)
global fileName = getFilenameFile rendOutputFilename
global passName = "pass name"
global render_Output = getFilenamePath rendOutputFilename
rollout GetJobsInfo " Network Render"
(
--UI ELEMENTS
group "Platform"
(
radiobuttons rBtn "" labels:#("32 bit", "64 bit") columns:1 align:#left
)
group "Job Name"
(
edittext OldJb "" text:jobName across:2 width:240--get this frome the renderpasses job vairable
button incJobBtn "+" align:#right
)
group "Manager"
(
edittext Naddress"" text:netaddress across:2 width:200
button btn01 "Connect" align:#right
)
group "Options"
(
checkbox inMaps "Include Maps" enabled:false
)
group "Jobs"
(
listbox jbList "" enabled:false
)
button submitBtn "Submit" enabled:false
on submitBtn pressed do
(
if c1 = true then
(
if rendTimeType == 1 then
(
singleFrame = slidertime as string
sframe = filterString singleFrame "f"
oneFrame = sframe[1] as number
theStartFrame = oneFrame
theEndFrame = oneFrame
)
if rendTimeType == 2 then
(
theRange = animationRange as string
nFames = filterString theRange "( ) f interval"
startFrame = nFames[1] as number
endFrame = nFames[2] as number
theStartFrame = startFrame
theEndFrame = endFrame
)
if rendTimeType == 3 then
(
theStartFrame = rendStart
theEndFrame = rendEnd
)
jobName = OldJb.text
m.getcontrol()
jobSub = m.newjob()
print jobSub
jobSub.name = jobName
jobSub.fromFrame = theStartFrame
jobSub.toFrame = theEndFrame
---add checkbox for tincluding maps
if inMaps.checked == true then
(
jobSub.includeMaps = true --turn on "Include Maps"
)
else
(
jobSub.includeMaps = false --turn off includemaps
)
jobSub.frameOutputName = render_Output
jobSub.submit() --this uses all servers for the job
m.disconnect()
)
)
on incJobBtn pressed do
(
numb +=1
OldJb.text = jobName +"_" + numb as string
)
on rBtn changed state do
(
if state == 1 do MyPlatform = #32
if state == 2 do MyPlatform = #64
)
fn connectman server=
(
m=netrender.getmanager()
c1 = m.connect #manual server platform:MyPlatform
)
fn getjobs=
(
Job=m.getjobs()
jbs=#()
for j=1 to job.count do append jbs job[j].name
return jbs
)
on btn01 pressed do (
submitBtn.enabled = true
inMaps.enabled = true
jbList.enabled = true
netaddress = Naddress.text
jobName = OldJb.text
x=connectman netaddress
if x==true then
(
getjobs()
for i=1 to jbs.count do format "Job : % - %
" i jbs[i]
jbList.items = for j in job collect j.name
for o=1 to jbs.count do
(
if OldJb.text == job[o].name then
(
messagebox "Duplicate job in the que"
)
)
--m.disconnect()
)
else
(
messagebox "Cannot connect."
)
)
)--close rollout
createDialog GetJobsInfo 300 410 lockWidth:true lockHeight:true style:#(#style_toolwindow, #style_sysmenu, #style_resizing)
Okay I found it. So I borrowed a lot from Joshua Newmans script on this thread
http://forums.cgsociety.org/showthread.php?f=98&t=879640&highlight=backburner+jobs
There is also a lot of reasources here that might help:
http://forums.cgsociety.org/search.php?searchid=2848531
No problem, glad I could help. I have also since posted a less buggy version on script spot if anyone is interested.
http://www.scriptspot.com/3ds-max/scripts/simplified-net-render
Just FYI if you have mixed bit version jobs (32bit and 64bit) you will need to connect to the manager as both separately, build a list of jobs, and then test. When you connect to the manager through script you will only get the information for jobs of the bit version in which you connect. If you have a 32bit job called “Test Job” and connect as 64bit “Test Job” won’t be returned, however trying to submit a job called “Test Job” will error as it does already exist.
-Eric
Heh, looks like “How To Avoid Duplicate Job Name?” is still mind-blowing question that stay blured for years, lol. How else to explain the lack of good/simple solutions?
In the docs – nothing, and online – the Eric reply is the first one (not simple but working) solution I found.
So, don’t take me wrong, its just hard to me to believe that no one hasn’t an how-to idea. I just presume that the folks not share too much then come to net-render.
Ok, if you make me to believe that this is a really hard subject, then I’ll share what I do. Ah, and of course, if I do that, it will be after more replies here. This way will give a chance to anyone to prove that am wrong about the good will of the folks