[Bf-extensions-cvs] [c933c583] master: Fix: issues with the camera and light source

Clemens Barth noreply at git.blender.org
Fri Mar 15 21:23:30 CET 2019


Commit: c933c58356970c0de38a48ead04dae26e8f95ab5
Author: Clemens Barth
Date:   Fri Mar 15 21:20:07 2019 +0100
Branches: master
https://developer.blender.org/rBAc933c58356970c0de38a48ead04dae26e8f95ab5

Fix: issues with the camera and light source

For instance, the old 'RAY_SHADOW' thing of the light source was removed and
the 90° camera rotation is now deactivated. I need to see how one can rotate
the camera around its own axis ... .

===================================================================

M	io_mesh_pdb/import_pdb.py

===================================================================

diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py
index c72b64fb..ffad2267 100644
--- a/io_mesh_pdb/import_pdb.py
+++ b/io_mesh_pdb/import_pdb.py
@@ -575,20 +575,26 @@ def camera_light_source(use_camera,
         # 4 is the size of the matrix.
         camera.rotation_euler  = Matrix.Rotation(angle, 4, axis_vec).to_euler()
 
+        print(camera.rotation_euler)
+
         # Rotate the camera around its axis by 90° such that we have a nice
         # camera position and view onto the object.
         bpy.ops.object.select_all(action='DESELECT')
         camera.select_set(True)
-        bpy.ops.transform.rotate(value=(90.0*2*pi/360.0),
-                                 axis=object_camera_vec,
-                                 constraint_axis=(False, False, False),
-                                 orient_type='GLOBAL',
-                                 mirror=False, proportional='DISABLED',
-                                 proportional_edit_falloff='SMOOTH',
-                                 proportional_size=1, snap=False,
-                                 snap_target='CLOSEST', snap_point=(0, 0, 0),
-                                 snap_align=False, snap_normal=(0, 0, 0),
-                                 release_confirm=False)
+        
+        # This will be done at some point ...
+        #
+        #bpy.ops.transform.rotate(value=(90.0*2*pi/360.0),
+        #                         axis=object_camera_vec,
+        #                         orient_matrix=camera.rotation_euler,
+        #                         constraint_axis=(False, False, False),
+        #                         orient_type='GLOBAL',
+        #                         mirror=False, proportional='DISABLED',
+        #                         proportional_edit_falloff='SMOOTH',
+        #                         proportional_size=1, snap=False,
+        #                         snap_target='CLOSEST', snap_point=(0, 0, 0),
+        #                         snap_align=False, snap_normal=(0, 0, 0),
+        #                         release_confirm=False)
 
     # Here a lamp is put into the scene, if chosen.
     if use_light == True:
@@ -605,10 +611,9 @@ def camera_light_source(use_camera,
         light_xyz_vec = object_center_vec + object_light_vec
 
         # Create the lamp
-        light_data = bpy.data.lights.new(name="A_light", type="POINT")
+        light_data = bpy.data.lights.new(name="A_light", type="SUN")
         light_data.distance = 500.0
         light_data.energy = 3.0
-        light_data.shadow_method = 'RAY_SHADOW'
         lamp = bpy.data.objects.new("A_light", light_data)
         lamp.location = light_xyz_vec
         bpy.context.collection.objects.link(lamp)



More information about the Bf-extensions-cvs mailing list