Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RuntimeMessage class in SDK print to script editor

Message 1 of 4
273 Views, 3 Replies

RuntimeMessage class in SDK print to script editor

Is the RuntimeMessage class for printing errors and warnings in the graph/Maya script editor? I tried writing some simple node which I thought would print to the Maya script editor but I am not sure if this is a correct assumption about what the class is supposed to do? Is there a way to print error messages using the Bifrost SDK if this is not the correct way?


Here is part of my header file with annotation:


void print_console(const bool condition,
                    Amino::String& output,
                    const Amino::RuntimeServices& runtime_services AMINO_ANNOTATE("Amino::JobPort name=_Amino_RuntimeServices"))


and the cpp file:


void SDKTest::print_console(const bool condition,
                    Amino::String& output,
                    const Amino::RuntimeServices& runtime_services) {
    if (condition) {
        output = "output_set";

        Amino::RuntimeMessage message = Amino::RuntimeMessage(Amino::RuntimeMessageCategory::kError, "There was an error");

My output is set so it seems the node is function somewhat, but it doesn't print any errors

Message 2 of 4

Logging is not currently a feature officially exposed to the user, so that's why you are not seeing any log messages. However, you can enable logging to the Maya console by setting the environment variable BIFROST_LOG_RUNTIME_MESSAGES=1.

Message 3 of 4

Ok, it works now after setting the environment variable

Message 4 of 4

Hi again on this topic. You mention logging is not exposed to the user officially right now. I wanted to clarify if that also means it is not possible to induce errors in the graph UI when the user makes some mistake. Basically, I would like to cause my operator to error out like seen in the screenshot, if I determined the user made an error. Logging an error only creates a change in the script editor and in Maya's status bar. But not in the Bifrost Graph Editor itself

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums