Net job event to copy files from server to workstation

Post your messages that do not fit in the other rooms here.

Net job event to copy files from server to workstation

Postby caseymcbride » 23 Nov 2016, 18:30

How do I use the Net Job Events to copy frames in an output folder on a server to an identical folder structure on my workstation after a chunk finishes? I'd like to be able to identify who submitted the job, based on username in RenderPal and copy to their workstation for compositing work. I do not have a lot of Python experience but I am well versed using Windows bat commands?

Thanks!
caseymcbride
 
Posts: 7
Joined: 20 Feb 2015, 06:38

Re: Net job event to copy files from server to workstation

Postby caseymcbride » 30 Nov 2016, 06:29

Here is the Python script I came up with... The Python works in Maya to copy the files, however, in RenderPal I get nothing once the job completes. I am running the Python script from Server once netjob completes. I am running the RenderPal Server under my user name so it should have access to my mapped network drives. In this case my workstation folder. Should I get some kind of prompt from RenderPal on my print commands? :?

Code: Select all
import os
import shutil

def copytree(src, dst, symlinks=False, ignore=None):
    for item in os.listdir(src):
        s = os.path.join(src, item)
        d = os.path.join(dst, item)
        if os.path.isdir(s):
            print 'No Folder Exists...Copying Tree'
            shutil.copytree(s, d, symlinks, ignore)
        else:
            print 'Folder Exists...Copying Contents'
            shutil.copy2(s, d)

print '...Copying Files...'

#getting the top folder location of my rendered images on this job from RenderPal
networkLoc = '$(RenderSet.outdir)'

#this is mapped to my shared workstation folder that can be accessed by my username
workstationLoc = 'B:\\ImagesLocation\\'

copytree (networkLoc, workstationLoc)
caseymcbride
 
Posts: 7
Joined: 20 Feb 2015, 06:38

Re: Net job event to copy files from server to workstation

Postby Shoran Support » 01 Dec 2016, 18:52

When running a net job Python event on the server side, all prints go to the output window ("Main program").
User avatar
Shoran Support
RenderPal Team
 
Posts: 1122
Joined: 11 Apr 2008, 00:35
Location: Germany


Return to General discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron