Skip to content

Commit

Permalink
Draft: workaround to be able to import Draft
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Apr 29, 2020
1 parent bd86e1c commit d7a9f2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Mod/Draft/draftmake/make_bezcurve.py
Expand Up @@ -36,7 +36,8 @@

from draftobjects.bezcurve import BezCurve
if App.GuiUp:
from draftviewproviders.view_bezcurve import ViewProviderBezCurve
# from draftviewproviders.view_bezcurve import ViewProviderBezCurve
from draftviewproviders.view_wire import ViewProviderWire


def make_bezcurve(pointslist, closed=False, placement=None, face=None, support=None, degree=None):
Expand Down Expand Up @@ -104,4 +105,4 @@ def make_bezcurve(pointslist, closed=False, placement=None, face=None, support=N
return obj


makeBezCurve = make_bezcurve
makeBezCurve = make_bezcurve
5 changes: 3 additions & 2 deletions src/Mod/Draft/draftmake/make_bspline.py
Expand Up @@ -36,7 +36,8 @@

from draftobjects.bspline import BSpline
if App.GuiUp:
from draftviewproviders.view_bspline import ViewProviderBSpline
# from draftviewproviders.view_bspline import ViewProviderBSpline
from draftviewproviders.view_wire import ViewProviderWire


def make_bspline(pointslist, closed=False, placement=None, face=None, support=None):
Expand Down Expand Up @@ -108,4 +109,4 @@ def make_bspline(pointslist, closed=False, placement=None, face=None, support=No
return obj


makeBSpline = make_bspline
makeBSpline = make_bspline

2 comments on commit d7a9f2e

@vocx-fc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlopav Draft broken on latest master.

I think the problem is that Bezier and Spline use the same view provider as Wire. However, in the past they had their unique view providers so it was still there in Draft.py to support very old objects. But you said that each object having their own view provider was better; I agree but we also need to check that the correct view provider is loaded.

@carlopav
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @berndhahnebach for the quick fix 👍
I was to bed early yersterday evening...

Please sign in to comment.