Is it possible to get the path to a reference file in the MAReader module?
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…?)
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?
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…
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.