MAReader reference node file path

  • Josh Burton

    Josh Burton - 2010-10-18


    Is it possible to get the path to a reference file in the MAReader module?

  • Matthias Baas

    Matthias Baas - 2010-10-18

    Have a look inside the ma file, the referenced files should appear as "file" statements which you can handle in the onFile() method.

    (by the way, I also tried to reply to your email, but my reply bounced. Apparently, your user name doesn't exist…?)

  • Josh Burton

    Josh Burton - 2010-10-19

    Thanks for the reply,

    I've had a look at the onFile method but I'm a little confused as to how to use it. What are the options I need to pass to it?

    Also I've been trying to use the setAttr method to set an attribute on a node in the .ma file, but it doesn't actually make the change in the file. Am I misunderstanding the use of setAttr? Or is there another function I need to call to save the changes to the file?


  • Matthias Baas

    Matthias Baas - 2010-10-19

    Well, the documentation page of the module should clarify these things.
    The MAReader only supports reading a file (hence the class name). You cannot use it to write or modify a ma file (so calling setAttr on the Node class only stores that in memory but doesn't write it back into the file).
    The onFile() method (like all the other callbacks) are methods that get called by the parser, you are not supposed to call them yourself. It's only a mechanism to pass the information from the file to your application. So you have to create a derived class and implement the onFile() method which will get called for every "file" statment in the ma file. This is how you find out what other files the ma file references.

    I hope that cleared things up a bit…


Log in to post a comment.