Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

MAReader reference node file path

Help
2010-10-18
2013-03-24
  • Josh Burton
    Josh Burton
    2010-10-18

    Hi,

    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?

    Thanks
    Josh

     
  • 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…