I followed the tutorial of DefrostSofaBundle/plugins/SoftRobots/docs/sofapython3/tutorials/CableGripper/cablegripper-tuto.md to create my own cube&floor scene, and I figured out that the tutorial is out-dated in terms of the VisualModel.
From the Line# 54 The tutorial asked me to modify the */CableGripper/myproject/cablegripper.py file like the following:
from stlib3.visuals import ShowGrid
from stlib3.physics.rigid import Floor
from stlib3.physics.rigid import Cube
def createScene(rootNode):
"""This is my first scene"""
ShowGrid(rootNode)
Floor(rootNode,
translation=[0.0,0.0,0.0],
isAStaticObject=True)
Cube(rootNode,
translation=[0.0,0.0,0.0])
return rootNode
However, the terminal log shows that there is no such module called ShowGrid in the visuals package
[ERROR] [SofaPython3::SceneLoader] Unable to completely load the scene from file '/home/jeremy/DefrostSofaBundle/plugins/SoftRobots/docs/sofapython3/tutorials/CableGripper/myproject/cablegripper.py'.
Python exception:
ImportError: cannot import name 'ShowGrid' from 'stlib3.visuals' (/home/jeremy/DefrostSofaBundle/plugins/STLIB/lib/python3/site-packages/stlib3/visuals/__init__.py)
Hence, I checked with the source code here and think the right expression based on the current structure of stlib3 should be like this:
from stlib3.visuals.visualmodel import VisualModel
def createScene(rootNode):
VisualModel.showGrid(rootNode)
Hi,
I followed the tutorial of
DefrostSofaBundle/plugins/SoftRobots/docs/sofapython3/tutorials/CableGripper/cablegripper-tuto.md
to create my own cube&floor scene, and I figured out that the tutorial is out-dated in terms of the VisualModel.From the Line# 54 The tutorial asked me to modify the */CableGripper/myproject/cablegripper.py file like the following:
However, the terminal log shows that there is no such module called ShowGrid in the visuals package
Hence, I checked with the source code here and think the right expression based on the current structure of stlib3 should be like this:
Hope this might help. Thank you.