-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored Vispy2D renderer under one module #288
Conversation
…ispy Refactored userspace.py to import vispy as 2D renderer only when selected
… current renderer
|
||
app.run() | ||
exit() | ||
app.run() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is visy specific. I believe if we use another renderer, it will throw an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app.run()
will be executed only when the renderer is set to vispy
.
app.run()
and all other vispy
specific calls is under the if renderer == "vispy"
clause. I think Github's UI is making it confusing to figure out the indents.
Or is it something else that I am missing, can you confirm this @parsoyaarihant ?
Thank you for the review :)
To test the changes, we can directly checkout your branch locally and test it. We dont have to create a new branch in p5py. |
Nice work! I will test this properly in the coming days. For #214 we now need two things:
|
Can you put |
Thanks for the detailed description of what needs to be done. I will start working on it, but due to exams will be little inactive till the month's end. |
… to 3D vispy renderer Moved Shader files in Vispy2DRenderer Userspace.py and utli.py refactored to support the new changes
Now, |
.gitignore
Outdated
@@ -111,3 +111,8 @@ ENV/ | |||
|
|||
# Profiling results | |||
profiling/*.prof | |||
|
|||
.idea/ | |||
test.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is useful for development. But we need to discuss and document this properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have documented this.
p5/core/primitives.py
Outdated
@@ -25,7 +25,7 @@ | |||
from ..pmath import curves | |||
from ..pmath.utils import SINCOS | |||
|
|||
from .shape import PShape | |||
from p5.sketch.Vispy2DRenderer.shape import PShape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont have to use the entire namespace. We can use from ..sketch.Vispy2DRenderer.shape import PShape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes in namespaces were done automatically by pycharm when I moved (refactored) the files. I will change it to relative imports then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix these imports. Then I will merge this PR
@parsoyaarihant before I redo the APIs, can you confirm is this the intended design we are looking for?
Quad method in VispyRenderer Class
|
Great work! Now that the shaders have moved, you may want to modify MANIFEST.in to include the new shader location. |
Yes, this is the design we are looking for |
Cairo has anti-aliasing and Vispy does not. If we write the tests for Vispy, then they will fail with Cairo. |
I have compiled all the examples present at p5's read the docs for testing purposes. In case you need it, they are under check_tests at this branch |
Userspace.py
now only imports and uses vispy as renderer when selected.Base.py
andrenderer2D.py
is refactored.Before working on integrating Cairo and refactoring code, should we work on writing visual tests for p5py?
As sooner or later we will need that and manually checking for bugs when we will start integrating Cairo will become hectic.
This PR is not tested robustly, I just tested it on some 2D and 3D examples, and things were working fine :)