MPxData Read/Write ASCII Python

98 views
Skip to first unread message

Dilen Shah

unread,
May 10, 2017, 8:31:53 PM5/10/17
to Python Programming for Autodesk Maya
Hey guy,

I am trying to write MPxData into maya ASCII file using python but I can't seem to figure out he python equivalent of "std::ostream &"

this is the command i am using:
MPxData::writeASCII(std::ostream & out )

If it's not possible with ASCII, binary would also solve my problem.

Any help regarding this would be appreciated.

Thanks,
Dilen.

Justin Israel

unread,
May 10, 2017, 10:49:51 PM5/10/17
to python_in...@googlegroups.com
Looks like there is an example of the usage in the devkit:

They treat the ostream as a reference to a list-like object (not sure what it really is)
 

Thanks,
Dilen.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/eb2c5c30-2a22-492e-b52d-58f57cad4a7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dilen Shah

unread,
May 10, 2017, 10:54:50 PM5/10/17
to Python Programming for Autodesk Maya
Hey Justin,

I have already seen that and it works with char, strings, double or floats. I am looking for MPxData custom data.
I tried using OpenMaya.MStreamUtils but that doesnt accept MPxData either.

So am looking for something different approach to this.

Thanks,
D.

On Thursday, May 11, 2017 at 12:19:51 PM UTC+9:30, Justin Israel wrote:
On Thu, May 11, 2017 at 12:31 PM Dilen Shah <dilen...@gmail.com> wrote:
Hey guy,

I am trying to write MPxData into maya ASCII file using python but I can't seem to figure out he python equivalent of "std::ostream &"

this is the command i am using:
MPxData::writeASCII(std::ostream & out )

If it's not possible with ASCII, binary would also solve my problem.

Any help regarding this would be appreciated.

Looks like there is an example of the usage in the devkit:

They treat the ostream as a reference to a list-like object (not sure what it really is)
 

Thanks,
Dilen.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages