Are you familiar with how Softimage does it?

In a nutshell, whenever a user opens a file, a file with the same name and
a "LOCK" extension is looked up. If none is found, a new one is created and
the users workstation name is written into it, and if one is found, the
user is alerted with the contained workstation name.

You should be able to accomplish the same using the method you described.

Monitoring changes however is probably a different topic and may not be
what you're after, but there are generally two method of accomplishing it;
polling or grabbing a file handle. For polling, you could have a look at
Watchdog, a library for Python. It should help guide you through what it
means to monitor file-system changes.


On 4 August 2014 08:15, Chris Gardner <chrisg.dot....@gmail.com> wrote:

> Hi all,
>
> I'm trying to write a simple lockfile system for maya (hey, user X has
> that file open!) and I'm trying to catch when the current filename
> changes (ie, saveAs, etc).
>
> I'm monitoring the OpenMaya.MSceneMessage.kBeforeSave event, but
> querying cmds.file(query=True, sn=True) gives me the *new* name, as
> does OpenMaya.MFileIO.beforeSaveFilename(). i need both the old and
> new filenames to compare.
>
> Am i barking up the wrong tree, or does anyone have any insights?
>
> Many Thanks,
> chrisg
>
> --
> 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/CAPoKtNek2mMAERcMtNAt_MkdOUaVUg%2BqpES_RCbqZ2KHp7RtoA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
konstrukt...@gmail.com

-- 
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/CAFRtmOC8UATgX3qFR%2B6Thag-X_kfQMCuaP14hpNnN3iXz1qrrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to