Skip to content

Sofa Python3 There is a problem with the printing information #610

@Weslie31

Description

@Weslie31

When I tried using print and msg_info to output messages during use, I couldn't see the printed messages either in the SOFA GUI or in the Conda console. Below is part of the code.
def main():
# Required import for python
import SofaImGui
Sofa.MessageHandler.addHandler(Sofa.ConsoleMessageHandler())
.......
liver_node = root.Liver
if liver_node:
force_field = liver_node.getObject('topForce')
dofs = liver_node.getObject('dofs')
Sofa.msg_info(liver_node, f"时间 {current_time:.2f}s: 外力添加")
I am sure the code runs properly. When running in the GUI, I saw the liver model deform correctly.
The environment is: SOFA, SOFA Python3, and related plugins installed directly in a Conda environment, and SOFA is launched using the Conda console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions