Following along with the examples, I ran into issues in both the Shadows example and the Special Effects example. Here is where the error is in the Special Effects Example, line 49:
if thorpy.constants.CAN_SHADOWS: #set shadow
thorpy.makeup.add_static_shadow(e_ship, {"target_altitude":5,
"shadow_radius":3,
"sun_angle":40,
"alpha_factor":0.6})
The error I was getting in both examples:
Traceback (most recent call last):
File "C:\Users\Owner\Desktop\ThorpyExamples\0010_Smoke_Fire_debris.py", line 50, in <module>
thorpy.makeup.add_static_shadow(e_ship, {"target_altitude":5,
File "C:\Users\Owner\AppData\Local\Programs\Python\Python38-32\lib\site-packages\thorpy\painting\makeup.py", line 12, in add_static_shadow
shadowel = StaticShadow(element)
File "C:\Users\Owner\AppData\Local\Programs\Python\Python38-32\lib\site-packages\thorpy\elements\_makeuputils\_shadow.py", line 33, in __init__
Element.__init__(self, "", elements, normal_params)
File "C:\Users\Owner\AppData\Local\Programs\Python\Python38-32\lib\site-packages\thorpy\elements\element.py", line 39, in __init__
self.finish()
File "C:\Users\Owner\AppData\Local\Programs\Python\Python38-32\lib\site-packages\thorpy\elements\_makeuputils\_shadow.py", line 125, in finish
painter = self._get_shadow_painter()
File "C:\Users\Owner\AppData\Local\Programs\Python\Python38-32\lib\site-packages\thorpy\elements\_makeuputils\_shadow.py", line 95, in _get_shadow_painter
shadow = self._get_raw_shadow()
File "C:\Users\Owner\AppData\Local\Programs\Python\Python38-32\lib\site-packages\thorpy\elements\_makeuputils\_shadow.py", line 65, in _get_raw_shadow
target_img = self.target.get_image(self.capture_state)
AttributeError: 'StaticShadow' object has no attribute 'target'
So I went to the StaticShadow file and found that it does indeed have a target attribute:
This is my first time posting something like this on github, so bear with me if I didn't do something correct. I wanted to ensure you were aware of the issue and tried to be as thorough as possible. Thorpy version is 1.6.3, Python version is 3.8.2, Pygame is 1.9.6. Operating systems tried on are Windows 10 and Ubuntu 18.04 LTS.
Following along with the examples, I ran into issues in both the Shadows example and the Special Effects example. Here is where the error is in the Special Effects Example, line 49:
The error I was getting in both examples:
So I went to the StaticShadow file and found that it does indeed have a target attribute:
self.target is created in the link method, which is called on the second line of the initialization method above:
This is my first time posting something like this on github, so bear with me if I didn't do something correct. I wanted to ensure you were aware of the issue and tried to be as thorough as possible. Thorpy version is 1.6.3, Python version is 3.8.2, Pygame is 1.9.6. Operating systems tried on are Windows 10 and Ubuntu 18.04 LTS.