glider workbench

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Post by looo »

Yes, it works perfectly. I can move the points, create some new line attachment points, create lines in-between and validate.
The glider is displayed with the change in the lines.

But the others menu I mentioned just show an error and the glider disappears.
Please try this code-snippets in the console of FreeCAD. Both methods should create a new scene with a cone. For me both methods work:

Code: Select all

import FreeCAD as App
import FreeCADGui as Gui
from pivy import coin

App.newDocument()
class Container(coin.SoSeparator):
    def __init__(self):
        super(Container, self).__init__()

a = Container()
a += [coin.SoCone()]
sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg += a

Code: Select all

import FreeCAD as App
import FreeCADGui as Gui
from pivy import coin

App.newDocument()
class Container(coin.SoSeparator):
    def __init__(self):
        super(Container, self).__init__()
        self += [coin.SoCone()]

a = Container()
sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg += a
Mx74
Posts: 23
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Post by Mx74 »

And for me both fail with exactly the same error:

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/freecad-daily/Mod/freecad/freecad_glider/tools/_tools.py", line 16, in SoGroup__iadd__
    raise(AttributeError('rhs must be list'))
AttributeError: rhs must be list
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Post by looo »

sry, there are some inconsistency between pivy and a freecad-glider monkey patch, which were not allowing the function to work if freecad-glider workbench was activated. I edited the tests. Please try again.

Code: Select all

import FreeCAD as App
import FreeCADGui as Gui
from pivy import coin

App.newDocument()
class Container(coin.SoSeparator):
    def __init__(self):
        super(Container, self).__init__()

a = Container()
a += [coin.SoCone()]
sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg += [a]

Code: Select all

import FreeCAD as App
import FreeCADGui as Gui
from pivy import coin

App.newDocument()
class Container(coin.SoSeparator):
    def __init__(self):
        super(Container, self).__init__()
        self += [coin.SoCone()]

a = Container()
sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
sg += [a]
Mx74
Posts: 23
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Post by Mx74 »

Both fail too, with the same error message:

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: unsupported operand type(s) for +=: 'SoSeparator' and 'list'
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Post by looo »

ok, I assume this time you haven't opened the glider-workbench before you run the two tests. So this shows, that you are still using the system pivy. So I guess something went wrong with the installation of pivy.

Maybe you can find which pivy is used. Maybe there are two pivy packages installed on your system...

Code: Select all

import pivy
pivy.__file__
Mx74
Posts: 23
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Post by Mx74 »

Oh, yes, sorry, I haven't open the glider workbench before.
Both solution works now.

your last test gives "'/usr/lib/python2.7/dist-packages/pivy/__init__.pyc'"
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Post by looo »

can you have a look if there is another pivy:

Code: Select all

locate pivy |grep __init__.py
or looking into the following directories:
/usr/local/lib/python2.7/site-packages
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/site-packages
~/.local/lib/site-packages
~/.local/lib/dist-packages

The easier way is to redo the pivy installation and post the full output.
Mx74
Posts: 23
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Post by Mx74 »

Only one installation of pivy, this i'm sure as I started again with a fresh install.

Looo... I'm confused.
I had to switch off my computer this morning, and after reboot, now everything works...
I did restart freecad, the session, but not the computer itself. Weird.

I'm really really sorry for the loss of time.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: glider workbench

Post by looo »

no problem. It is known that the installation of this workbench is difficult ;)
Any feedback is welcome.
Mx74
Posts: 23
Joined: Fri Dec 08, 2017 12:39 pm

Re: glider workbench

Post by Mx74 »

Yes, it's not the easiest one :-)
Again many many thanks for your help.

For questions about its use, should I ask here or create another topic?
Or somewhere else?

As you guessed, I'm not a developer, so i can't really help coding, but if I may help help in any way, ask me.
If I'm able to do it, that would be a pleasure.
Post Reply