alxbilger / sofa-xml_to_python

Online tool to convert XML scene files from SOFA to Python
https://alxbilger.github.io/sofa-xml_to_python/
MIT License
1 stars 0 forks source link

Problems with conversion #4

Open AndreaCusinato opened 1 week ago

AndreaCusinato commented 1 week ago

Hello, I'm Andrea. I tried to use you converter for .scn to .py file, but when I try to use .py file in SOFA, I have this error:

WARNING] [Qt] QObject::connect: No such slot sofa::gui::qt::RealGUI::fileSaveAs(sofa::simulation::Node*)
[WARNING] [Qt] QObject::connect:  (sender name:   'SimuGraph')
[WARNING] [Qt] QObject::connect:  (receiver name: 'GUI')

[DEPRECATED] [SofaPython3::SceneLoader] Unable to completely load the scene from file '/home/labjets/Scrivania/simulation.py'.  
Python exception:   
  ModuleNotFoundError: No module named 'numpy'

At:
  /home/labjets/Scrivania/simulation.py(4): createScene

[INFO]    [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckCollisionResponse, SceneCheckDeprecatedComponents, SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias, SceneCheckMultithreading]
[INFO]    [SceneCheckerVisitor] Finished validating node "root".
[WARNING] [Node(root)] An animation loop is required, but has not been found. Add an animation loop in the root of your scene to fix this warning. The list of available animation loop components is: [AnimationLoopParallelScheduler, ConstraintAnimationLoop, DefaultAnimationLoop, FreeMotionAnimationLoop, MultiStepAnimationLoop, MultiTagAnimationLoop]. A component of type DefaultAnimationLoop will be automatically added for you.
[WARNING] [RealGUI] Global Bounding Box seems very small; Your viewer settings (based on the bbox) are likely invalid, switching to default value of [-1,-1,-1,1,1,1].This is caused by using component which does not implement properly the computeBBox function.You can remove this warning by manually forcing a value in the parameter bbox="minX minY minZ maxX maxY maxZ" in your root node 

I used this command for use the .py file: ./runSofa /home/labjets/Scrivania/simulation.py I'm using Ubuntu 22.04. I attached my .scn file and .py file generated from you site. How can I solve these errors? scene.txt python.txt

Thank you for the support. Regards, Andrea.

alxbilger commented 1 week ago

It looks like a SofaPython3 problem rather a scene problem. Are you able to run a simple example? For example this one: https://github.com/sofa-framework/SofaPython3/blob/master/examples/basic.py

AndreaCusinato commented 1 week ago

Thank you for your reply! I tried this simple example and it works, without errors

Il giorno mar 19 nov 2024 alle ore 10:44 Alex Bilger < @.***> ha scritto:

It looks like a SofaPython3 problem rather a scene problem. Are you able to run a simple example? For example this one: https://github.com/sofa-framework/SofaPython3/blob/master/examples/basic.py

— Reply to this email directly, view it on GitHub https://github.com/alxbilger/sofa-xml_to_python/issues/4#issuecomment-2485190838, or unsubscribe https://github.com/notifications/unsubscribe-auth/BH6LNPZNE6SYVYB7RMBI4KL2BMCBBAVCNFSM6AAAAABSBQRSW6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBVGE4TAOBTHA . You are receiving this because you authored the thread.Message ID: @.***>