Hi Ben,
I just thought I'd mention that there are very few situations that I have
encountered where you need a maya gui session instead of a batch session
(you can even do openGL playblasts from a batch session).  You said that
you are using "certain shaders and the Hypershade functions which need the
maya GUI window open".  Can you tell us exactly what those are?  In some
cases there will be more direct routes than using hypershade functions (for
example, there is a hypershade proc for assigning shaders, but the 'sets'
command will also work), and in other cases you simply need to source the
appropriate hypershade mel script to ensure that the mel proc is
available.  Just a thought.

-chad




On Wed, Nov 25, 2015 at 6:42 AM Ben Hearn <[email protected]> wrote:

> Hey Marcus,
>
> Sorry to keep code from you guys. I am not sure how much I generally
> should post online since it is for work and the code is split up into
> serveal chunks in batch and separate files, but I will make it a bit
> clearer for you guys :) Hope it is a bit clearer now
>
> Also, my reply about sketchy file nodes, things like this happen a lot
> during development when people throw things around quickly or carelessly
> but being able to open it individually and not have it crash really threw
> me on it...
>
>
> *set BATCH_CONVERT=%CGROOT%folder\export_units_wrapper.melset
> MAYA_EXE=C:\Program Files\Autodesk\Maya%MAYA_VERSION%\bin\maya.exe*
>
> The *MAYA_EXE *variable is simply the executable path to Maya2015
> The *BATCH_CONVERT *variable is a mel wrapper that I pass into Maya when
> it boots that runs the python code I want it to :)
>
> mel code:
> *python("import maya_run");*
> *python("maya_run.main()");*
>
> *d is the result of splitting my dictionary up into chunks to process each
> bit individually:*
>
> def linch_dict_divider(raw_dict, num):
>
>       list_result = []
>       len_raw_dict = len(raw_dict)
>       if len_raw_dict > num:
>               base_num = len_raw_dict / num
>               addr_num = len_raw_dict % num
>               for i in range(num):
>                       this_dict = dict()
>                       keys = list()
>                       if addr_num > 0:
>                               keys = raw_dict.keys()[:base_num + 1]
>                               addr_num -= 1
>                       else:
>                               keys = raw_dict.keys()[:base_num]
>                       for key in keys:
>                               this_dict[key] = raw_dict[key]
>                               del raw_dict[key]
>                       list_result.append(this_dict)
>
>       else:
>               for d in raw_dict:
>                       this_dict = dict()
>                       this_dict[d] = raw_dict[d]
>                       list_result.append(this_dict)
>
>       return list_result
>
> --
> 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/CAM2ybkUa3AVtweJkHCkxOVP683y4t_ba6BHBTDEtr22%3DoVM9pQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkUa3AVtweJkHCkxOVP683y4t_ba6BHBTDEtr22%3DoVM9pQ%40mail.gmail.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 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/CAGq9Q7EhH6bwppKLt-D%3DLxJiD8Mrr2YhjDqk-t8LOV8DV%3D_%2B0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to