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.
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.