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
Fix material docstrings, improved standard parameters and improved materials application support #488
Conversation
Codecov Report
@@ Coverage Diff @@
## master #488 +/- ##
==========================================
+ Coverage 88.53% 89.00% +0.46%
==========================================
Files 31 33 +2
Lines 6575 7092 +517
Branches 787 834 +47
==========================================
+ Hits 5821 6312 +491
- Misses 535 547 +12
- Partials 219 233 +14
|
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.
Hi @guaje,
Thank you for this fix. See below for some comments. It is almost ready to go.
fury/material.py
Outdated
warnings.warn('Your PBR effect can not be apply due to VTK version. ' | ||
'Please upgrade your VTK version (should be >= 9.0.0).') |
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.
Why this change?
@@ -60,22 +60,30 @@ def manifest_standard(actor, ambient_level=0, ambient_color=(1, 1, 1), | |||
fragment level. | |||
|
|||
""" | |||
prop = actor.GetProperty() | |||
try: |
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.
Why do you need a try
? which actor does not have this feature?
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 was added because contour_from_label
was throwing an exception when trying to access the Property
object. See test_material
and test_manifest_standard
.
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.
ok, I will look into it
fury/material.py
Outdated
warnings.warn( | ||
'Unknown interpolation. Ignoring "{}" interpolation option. ' | ||
'And using the default ("{}") option.'.format( | ||
interpolation, 'gouraud'), UserWarning) |
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.
not sure the warning will be written correctly this way. I need to test it
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.
What do you mean? It's created according to this
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.
As you can see below, the format does not work correctly (it does not work well with multiline) :
In [1]: from fury import actor, material
In [2]: act = actor.axes()
In [3]: material.manifest_standard(act, interpolation="test")
/Users/koudoro/Software/fury/fury/material.py:78: UserWarning: Unknown interpolation. Ignoring "test" interpolation option. And using the default ("gouraud") option.
interpolation, 'gouraud'), UserWarning)
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 see, I'll look into it.
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.
@guaje I see that there is no tutorial in this PR. I suppose that this is on purpose?
npt.assert_array_almost_equal(actual, desired, decimal=2) | ||
|
||
material.manifest_standard(test_actor) | ||
window.record(scene, out_path=tmp_fname, size=(200, 200), |
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.
Interesting that you prefer using record than snapshot. Snapshot returns directly the framebuffer as a numpy array.
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.
Thanks, I didn't think of it. However, I found this problem (#467) when using window.snapshot()
.
@guaje Can you explain how I would have to change the following code to see the PBR effect?
|
Please also make another PR to improve |
This PR includes many improvements for the material module. Among many things it: