Hey Justin,

Thanks for the feedback I should have been more concise with the
explanation of SHOW and CGROOT.

The SHOW variable is hard coded to the batch file In question and Is the
name of the top level directory where your tools live. For example if you
had a huge structure for maya tools and your batch file was 5 directories
into your top level folder the for loop steps back through the directories
until it finds the folder name specified with SHOW.
CGROOT is mapped throughout the for loop and is the path to the top level
directory you specified in SHOW.

My CGROOT on my machine would end up being D:/projects/tools/maya_tools for
example.

If we had 3 projects we could set 3 batch files up and simply change the
SHOW variable to use an entirely different set of directories if we wanted
to or even restrict a specific maya setup to only step back a couple of
directories and not give it full access to our entire tools folder.

We use the CGROOT variable on our python path so we can set
CGROOT/dirname/subdir/subsubdir etc.

The built PYTHONPATH at runtime does the same thing as sys.path.append but
we are not specifying it in a script we are giving maya and any other
script we want to run access to these directories specified. It allows us
to easily add directories later without the hassle of any scripts in our
sub folders not having access to them.

Yes you can install pyside on your machine but I use the anaconda python
distributable and when I'm using my IDE (pycharm) I can run any UI using
pyqt without having to install pyside and avoid that hassle inside my IDE.
I think it's a personal preference :)

I hope that cleared up a couple of things. I will amend the tut to more
clearly explain your feedback

Cheers,

Ben

On Saturday, 31 October 2015, Justin Israel <[email protected]> wrote:

> Hey Ben,
>
> I had a couple questions...
>
> You make a couple references to the preference of switching to the system
> PyQt4 versus the Maya PySide, for reasons of it being easier to develop
> without a Maya-specific PySide. I wasn't clear on this statement. I don't
> believe there is anything special about the Maya PySide, other than it
> being bundled. Could you just as easily install PySide on your system, the
> same as you would PyQt, and then be able to use PySide inside and outside
> of Maya?  This isn't really a comment on preference or anything. I just
> didn't get the part about it being easier to develop, or that anything was
> special about PySide in Maya.
>
> Also, as a non-windows user that hasn't seen batch file programming in
> many many years, I was a bit unclear as to the behavior of the built
> PYTHONPATH at runtime. I figure this is similar to someone who uses windows
> and knows nothing about batch file syntax.  Is that a hard-coded SHOW
> variable in the batch file, or does it somehow derive from external
> sources? Or is the goal that you would have different batch files for
> different shows, and the only externally derived bit is the CGROOT? I'm
> trying to map this to my osx/linux env experience, where you would launch
> Maya from a shell, with a wrapper that would pick up your shell
> environment. Such as, starting from a shell that is set to SHOW=MyShow, in
> which case that Maya session would be launched under those settings.
> Maybe it might help to describe the behavior of the variables and the
> intended usage of the batch file? As in, how would you end up using it
> across 3 shows?
>
> Justin
>
>
> On Sun, Nov 1, 2015 at 8:47 AM Benjam901 <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
>> Hello all,
>>
>> I have been meaning to start a scripting blog on my portfolio for a while
>> now and have recently finished up a tutorial that covers setting up a
>> localised Maya environment using batch files.
>>
>> The tutorial covers:
>> What it is
>> Why it is useful
>> How we set it up
>> How we can set relative pathing for each users session
>> How we can open our Maya files using our setup (double clicking in
>> windows)
>> Setting up a pinnable shortcut
>> Customising our Maya icons and splash screen
>>
>> If you have 10 mins please take a read and let me know what you think :)
>>
>> Cheers,
>>
>> Ben
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected]
>> <javascript:_e(%7B%7D,'cvml','python_inside_maya%[email protected]');>
>> .
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/1987a6d4-7924-4bff-976c-b08085502bb9%40googlegroups.com
>> <https://groups.google.com/d/msgid/python_inside_maya/1987a6d4-7924-4bff-976c-b08085502bb9%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Python Programming for Autodesk Maya" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/python_inside_maya/UV_fdWrS3YM/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected]
> <javascript:_e(%7B%7D,'cvml','python_inside_maya%[email protected]');>
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0nkVzT9Qmy810Q40_hLRFn1oPc%3DR9noXkTTk11jjnYEA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0nkVzT9Qmy810Q40_hLRFn1oPc%3DR9noXkTTk11jjnYEA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Tel - +46 76245 92 90 (Sweden)
LinkedIn: http://www.linkedin.com/pub/ben-hearn/50/a64/33b

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkWw64YMKAN1LPM3L%3D%3D%3Dg-33YrkzeBWFeam93PY_A_n5cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to