Hi,
no idea what I have done wrong, but I can no longer write to the output window of Maya2016 with vs2015. Maya itself can and also mel:trace can, but not me : (
So, any idea?
thanks
Hi,
no idea what I have done wrong, but I can no longer write to the output window of Maya2016 with vs2015. Maya itself can and also mel:trace can, but not me : (
So, any idea?
thanks
Yupp, I run into the same problem some time ago. I had no problems on my dev machine, but it failed completely on other machines. Then I tried:
MStreamUtils::stdOutStream()
And everything worked fine 
Haggi,
great, that worked!
But, since than, do you always have to create that ostream?
And still, ‘printf’ does not work…
Here is an example how I use it:
https://github.com/haggi/appleseed-maya/blob/master/src/utilities/logging.cpp#L57
Ah, I have had just a brief look into that ostream stuff, but obviously std::endl is not included. So, I did it like this:
#include <string>
#include <iostream>
#ifdef __DEFINE_SCI_COUT__
#include <maya/MStreamUtils.h>
#define __CREATE_SCI_COUT__ ostream & sciCout = MStreamUtils::stdOutStream();
#else
#define __CREATE_SCI_COUT__ extern ostream & sciCout;
#endif
#define sciEndl "
"; sciCout.flush();
__CREATE_SCI_COUT__;
Then I can simply convert ‘cout << “bla” << endl;’ into 'sciCout << “bla” << sciEndl;
edit: wow, thats cool! Its not possible to directly cout anything but MString and chars. If I try to print a int, Maya crashes. Thats bad, its the same with MGlobal::displayInfo. I have to create a MString with the data I want to cout first…Holy sh…
Yep, I’ve always had to use cerr instead of cout on Windows to print to Maya’s Output Window.
Try to launch maya from Command Prompt if you r using windows.
I think C++ std::cout sends output data to the stream
So in this case. The command prompt acts as the stream receiver
CMIIW
C:\Program Files\Autodesk\Maya2017\bin>maya.exe
Try it again. Good Luck