Hey Mark! Happy early birthday...

Maybe you could hook into the "before import check"?

import maya.OpenMaya as om
def catchFileImport(ret, fileObj, *args):
    print "Importing:", fileObj.resolvedFullName()
    om.MScriptUtil.setBool(ret, True)

mid = om.MSceneMessage.addCheckFileCallback(om.MSceneMessage.kBeforeImportCheck,
catchFileImport)

​

Justin


On Wed, Aug 10, 2016 at 9:57 AM Mark Dietel <mdie...@gmail.com> wrote:

> Hey guys,
>
> I'm trying to catch some data about scenes that are imported.
>
> Something like:
>
>
> def import_callback():
>     print "SOMETHING WAS IMPORTED. I WISH I KNEW WHAT IT WAS"
>
> cmds.scriptJob( event=("SceneImported", import_callback) )
>
>
>
>  It feels like a scriptJob callback is the way to go but I don't think it
> can capture the name/path of the file being imported.  Anyone have any
> insight or an alternate approach to calling some python on every import
> (and getting the name/path of the file imported)?
>
> Thanks in advance.
>
> --
> 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/47ea9d82-c3f0-4352-add2-3f34c2b534d0%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/47ea9d82-c3f0-4352-add2-3f34c2b534d0%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 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/CAPGFgA2wSHA1dvhFprY-bGf63xNLcWfrbSZeJGwYxE5SUeH9uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to