[Blender export][Fixed] Problems when no point of view was defined

- The default view wasn't translated.
- Now translated
- Now the render script defaults to 0 rotation if the view is unknown
Fixes #546
This commit is contained in:
Salvador E. Tropea 2024-01-05 07:04:58 -03:00
parent 7ec3a1379c
commit ab17559a29
3 changed files with 7 additions and 1 deletions

View File

@ -117,6 +117,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Rotations are now applied to the current view, not just the top view
- Board/components not visible for small boards (See #484)
- Light type names (extra space) (#505)
- Problems when no point of view was defined (#546)
- update_xml with check_pcb_parity enabled:
- Avoid errors for KiCad 6 using "Exclude from BoM" components.
This limitation isn't found on KiCad 7. (#486)

View File

@ -93,6 +93,8 @@ def do_point_of_view(scene, name):
return (0, 90, 90)
if view == 'X':
return (0, -90, -90)
print(f'Unknown view `{view}`')
return (0, 0, 0)
def srgb_to_linearrgb(c):

View File

@ -396,7 +396,10 @@ class Blender_ExportOptions(BaseOptions):
self.render_options = BlenderRenderOptions()
# Point of View, make sure we have a list and at least 1 element
if isinstance(self.point_of_view, type):
self.point_of_view = [BlenderPointOfViewOptions()]
pov = BlenderPointOfViewOptions()
# Manually translate top -> z
pov.view = 'z'
self.point_of_view = [pov]
elif isinstance(self.point_of_view, BlenderPointOfViewOptions):
self.point_of_view = [self.point_of_view]