Callback to check/fix references when loading scene file?

Callback to check/fix references when loading scene file?

Anonymous
Not applicable
680 Views
3 Replies
Message 1 of 4

Callback to check/fix references when loading scene file?

Anonymous
Not applicable

We have a situation where many of the references in our animators' files refer to files that are local copies they have made.  So when we read their files in, those references are not found, so we have to interactively browse for the correct locations.

I'm wondering if there is a way I can get a callback before each referenced file is loaded, so I can correct the path if needed (I do have enough information to deduce the correct path).  I tried using the MSceneMessage.kBeforeReference callback, but that didn't do what I'm looking for.

Thanks!

 

 

0 Likes
681 Views
3 Replies
Replies (3)
Message 2 of 4

negow
Advocate
Advocate

Have you tried MSceneMessage::addCheckReferenceCallback, with kBeforeLoadReference?

 

- https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=__cpp_ref_class_m_scene_message_html#ac6957b78a...

 

It claims to hand you the reference node itself, which *may* allow you to edit things like the path.

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks, that's very promising, I don't know how I missed that.  I'll check it out!

0 Likes
Message 4 of 4

negow
Advocate
Advocate

Happes to me all the time, there are too many permutations of callbacks and flags to keep track of. 😄