Installing Pyblish on a network


#21

i tested this code on a system that can read from \\studio\dfs\pipeline\pyblish-win

set PYTHONPATH=\\studio\dfs\pipeline\pyblish-win\pythonpath;%PYTHONPATH%
start "" "C:\Program Files\Autodesk\Maya2015\bin\maya.exe" %*

but does not work. and publish menu does not appear on file menu.
what do you think?

but i put \\studio\dfs\pipeline in PYTHONPATH too, in it i have a simple py file that print a statement
in maya when i import it, it works fine.


#22

This is correct. This particular example doesn’t add the default pyblish_maya's userSetup.py to the pythonpath. As mentioned earlier that’s an additional step you can take to use the default setup.

Does import pyblish_maya work in Maya?

If so, try this:

import pyblish_maya
pyblish_maya.setup()

This should also get you the menu item.
That is also what the pyblish_maya userSetup.py does for you on start-up.
For more details on adding that particular path, see this reply above.

Specifically:


#23

Hey Roy

it works with this bat file:

set PYTHONPATH=%PYTHONPATH%;\\studio\DFS\Pipeline\pyblish-win\pythonpath;\\studio\DFS\Pipeline\pyblish-win\lib\pyblish-x\integrations\maya;
set PYBLISHPLUGINPATH=\\studio\DFS\Pipeline\pyblish_plugins;

call "C:\Program Files\Autodesk\Maya2015\bin\maya.exe"
or
start "" "C:\Program Files\Autodesk\Maya2015\bin\maya.exe" %*

and publish menu added to file


#24

That’s it!


#25

Yes
So for starting Pyblish on maya (artist PC) from server installation we have a batch file named maya.bat with this content:

set PYTHONPATH=%PYTHONPATH%;\\studio\DFS\Pipeline\pyblish-win\pythonpath;\\studio\DFS\Pipeline\pyblish-win\lib\pyblish-x\integrations\maya;
set PYBLISHPLUGINPATH=\\studio\DFS\Pipeline\pyblish_plugins;

start "" "C:\Program Files\Autodesk\Maya2015\bin\maya.exe" %*

This is a method that i test and it works.


#26

Hi
I tried this way to run pyblish-standalone on network, it works fine.
create a batch file with this content:

@echo off
set PATH=%PATH%;\\studio\pyblish-win\lib\Python27;\\studio\pyblish-win\bin;
set PYTHONPATH=%PYTHONPATH%;\\studio\pyblish-win\pythonpath;\\studio\pyblish-win\lib\pyblish-x\integrations\maya; 
set PYBLISHPLUGINPATH=%PYBLISHPLUGINPATH%;\\studio\pyblish_plugins\_standalone;
pyblish-standalone --data layer9 helloWorld

i used collect_render.py as test in my plugin directory


#27

He men

as new update on my works on studio, i was working on Directory Structure of pipeline and trying to learn using be and i’m trying to connect pyblish and be and some custom tools together to work better in the pipeline.
just i have some questions about be that i don’t know where should i ask. @marcus :wink:


#28

I think pipeline specific discussions can emerge right here on the forum. I remember there already being a topic here on folder structures somewhere, have a look at that. Maybe there was even one for be.

Either way feel free to set up your own topics if you can’t find the information or topic you’re looking for.


#29

however this is related to work on network but sure
thanks


#30

Hello Again

in first month of my work in the studio we created a good custom directory structure.
beside a directory for our pipeline apps.

in this way and as i tested, we can have our applications in the folder of Pipeline that artists can’t access it but we give them some shortcuts of our wrapper scripts and they can run our application easily on ther PC.

for example running maya that set pyblish and other environment variables in it. and when artists run our shortcut, they will have pyblish ready to run.

my new idea that will implement this week is creating a launcher that have our wrapper scripts for ensuring that artist will run applications based on our customizations.

i will share my new experiences here

good luck!


#31

Sounds great @Mahmoodreza_Aarabi, thanks for sharing!


#32

Are you looking at using be?


#33

Are you looking at using be?

probabely i use it during development our pipeline system.
but not yet.
i should see what is situation about using be
i studied it, but have to know more about it.


#34

Hello again

I had many tests on network
for running pyblish on network people should have read access to our softwares and they can run our softwares

there is a big issue in my work.
i have a launcher.py that have a GUI with our buttons for running maya, nuke or other standalone applications, and every button will run a batch file. problem is that we run launcher.py from a bat file, and when we click on buttons they will run another bat file,
here, there is a conflict (i think) on PYTHONPATH.
with talking to @BigRoy i used this:

def run_maya(self):
    path = os.path.join(self.path, 'maya2016.bat')
    env = os.environ.copy()
    env.pop("PYTHONPATH", None)
    subprocess.call(path, cwd=self.path, env=env)

but after clicking on button i have this error:
\\srv-fs\Pipeline\bin\apps\_launcher.py
WindowsError: [Error 2] The System cannot find the file specified

what is your opinion?


#35

The error seems as if the _launcher.py can’t be run. Is the GUI even working? Or is it the subprocess call that’s giving the error? If it’s the latter I’d expect there to be a larger stack trace defining what in particular is messing up.


#36

Hello @BigRoy

I found the solution and solved it
:smile:

first i should tell you that, no, _launcher will run and GUI will appear, but when i clicked the maya button it does not work.

But, i solved it in this way:
getting Current Working Directory with os.getcwd() does not work in this situation, and in network it returns C:\windows so i had to get it with

self.path = os.path.dirname(os.path.abspath(__file__))
self.cwd = os.path.join(self.path, '..')

and use it. but as i said this code:

def run_maya(self):
    path = os.path.join(self.cwd, 'maya2016.bat')
    env = os.environ.copy()
    env.pop("PYTHONPATH", None)
    subprocess.Popen(path, cwd=self.cwd, env=env)

works fine, thanks.


#37

Good to hear you got it working.