Back from vacation and filtering through some saved email threads… and so,
regarding this setting of project via Python…

This is what I currently do:

import maya.cmds as cmdsimport maya.mel as mel
def create_folder( directory ):
    if not os.path.exists( directory ):
        os.makedirs( directory )

maya_dir = '//10.0.100.10/some/path/maya'
create_folder( maya_dir )

mel.eval('setProject \"' + maya_dir + '\"')
for file_rule in cmds.workspace(query=True, fileRuleList=True):
    file_rule_dir = cmds.workspace(fileRuleEntry=file_rule)
    maya_file_rule_dir = os.path.join( maya_dir, file_rule_dir)
    create_folder( maya_file_rule_dir )

I thought it was worth posting, as it answers the initial post by Marcus -
and it doesn’t rely on pymel (which I don’t use). Also, I find the
workspace command unnecessary, as the setProject command creates a
workspace.mel file (with defaults).

What do you guys think about this approach?
Should cmds.workspace() be used for some reason? (I can't see why if you
want defaults)

/ Fredrik
​


On Tue, Jul 8, 2014 at 4:27 PM, Fredrik Averpil <fredrik.aver...@gmail.com>
wrote:

> Yes, thanks for sharing that!
>
> Sent from my iPhone
>
> On tis, jul 8, 2014 at 12:52 em, Marcus Ottosson <konstrukt...@gmail.com>
> wrote:
>
> Thanks Anthony, that's good to know.
>
> If anyone else is getting delivery issues, maybe try and re-post it in the
> groups directly:
> https://groups.google.com/forum/#!topic/python_inside_maya/GYWCJFcf1mo
>
> I'm keen to hear about your ideas and wouldn't want them to get lost in
> cyberspace.
>
> Best,
> Marcus
>
>

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMJvfnoFEYZQf9iuHR6ifmTjZhKrj-RVcDb8HE%2B3fpAGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to