Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 1 20-09-2016 , 03:44 PM
Registered User
Join Date: Sep 2016
Posts: 1

maya MSceneMessage kBeforeSave callback

I need to register to some maya's MSceneMessage callback, and query the scene paths. I need to get both before and after's maya path. (open , save file)

Here's what I have so far.

def before(*args, **kwargs):
    print 'BEFORE: ' + cmds.file(query = True)

def after(*args, **kwargs):
    print 'AFTER: ' + cmds.file(query = True)

om.MSceneMessage.addCallback(om.MSceneMessage.kBef  oreOpen, before)
om.MSceneMessage.addCallback(om.MSceneMessage.kAft  erOpen, after)

Case scenario1; In scene, OPEN scene
Works as expected.

#BEFORE: ../../
#AFTER: ../../

Case scenario2; In scene, SAVE scene
DOESN'T work as expected.

#BEFORE: ../../
#AFTER: ../../

I also tried 'kBeforeSaveCheck' callback, with same result.

# 2 21-09-2016 , 07:06 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
What exactly are you trying to achieve?

In your second case, you probably want kBeforeSave and kAfterSave.

Imagination is more important than knowledge.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads