5

I would like to use the MotionBuilder 2013 API to log a message to the MotionBuilder console from C++.

Example image

I would like a message to show up where the "Hello" has been printed. Or if that is impossible somewhere else in motion builder. That message has been displayed with a print statement in python.

In Maya you use: MGlobal::displayInfo(msg);

in 3ds Max you can use:

the_listener->edit_stream->wputs(wcharConverter);
the_listener->edit_stream->flush();

Is there a motion builder version? I have searched the api but cannot seem to find the call. http://docs.autodesk.com/MB/MB2013/ENU/MotionBuilder-SDK-Documentation/index.html

marsh
  • 2,592
  • 5
  • 29
  • 53
  • I am a bit confused. It appears that you are looking at the python editor. I suspect you are not looking for C++ to output to the python editor. I have not worked with MotionBuilder. Is there a similar console / editor for C++? – Jeff Jul 06 '15 at 14:19
  • I am looking for c++ output to the python editor console yes. As I do already with Maya and Max. For example the Maya description for what I want to do is: "This method is used to display an informational message in the script editor." – marsh Jul 06 '15 at 14:22
  • 1
    Based on this link: http://forums.autodesk.com/t5/open-reality/how-to-get-all-objects-on-the-motionbuilder-scene/td-p/4277904, it seems that print is simply sending to stdout (comparing the python and C++ equivalents). I guess it is possible that std::clog could is also utilized here. – Jeff Jul 06 '15 at 14:27
  • 1
    I wouldn't have guessed so. They are generally pointed to the same location. In this case the python parser may be sending the output to stdout and adding it to an output buffer that it renders (in contrast to standard console which has stdout redirected toward it). – Jeff Jul 06 '15 at 14:47

1 Answers1

0

Have you tried FBTrace("Message")?

Check in docs under: C++ API -> Modules -> The Trace utility functions

Hcorg
  • 11,598
  • 3
  • 31
  • 36
  • This does not log it there, though if you start mobu with - console you can see it. Though printf goes to that console as well. So while better then nothing it does not do what I need. – marsh Jul 06 '15 at 13:17
  • You may need to adjust the Python console's trace level in order to display them; the documentation indicates that it is "kFBNO_TRACE by default". Try setting a higher trace level with pythonidelib.SetTraceLevel(). – Daniel Waechter Jul 06 '15 at 19:42
  • While this is entirely my fault I realized that I am actually using the 2013 api. SetTrace does not exist in that version it appears. http://docs.autodesk.com/MB/MB2013/ENU/MotionBuilder-SDK-Documentation/index.html – marsh Jul 06 '15 at 19:58