Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClemens Barth <barth@root-1.de>2022-01-16 12:50:52 +0300
committerClemens Barth <barth@root-1.de>2022-01-16 12:50:52 +0300
commitee7f95212b96c2786a27e4ba4729fff4a504328d (patch)
tree454e6e4339670a9d61815934e4972a9b313e159e
parent7d11bb351e580b738068c398f71d29d60244070a (diff)
... with some addtional changes.
-rw-r--r--io_mesh_atomic/pdb_import.py14
-rw-r--r--io_mesh_atomic/xyz_import.py14
2 files changed, 14 insertions, 14 deletions
diff --git a/io_mesh_atomic/pdb_import.py b/io_mesh_atomic/pdb_import.py
index ab1c63d0..d340d82b 100644
--- a/io_mesh_atomic/pdb_import.py
+++ b/io_mesh_atomic/pdb_import.py
@@ -627,13 +627,17 @@ def camera_light_source(use_camera,
# Create x, y and z for the lamp.
object_lamp_vec = Vector((lamp_dl,lamp_dy_right,lamp_dl))
lamp_xyz_vec = object_center_vec + object_lamp_vec
+ length = lamp_xyz_vec.length
# Eevee
# =====
# As a lamp we use a point source.
lamp_data = bpy.data.lights.new(name="A_lamp_eevee", type="POINT")
- lamp_data.energy = 100000.0 # Watts
+ # We now determine the emission strength of the lamp. Note that the
+ # intensity depends on 1/r^2. For this we use a value of 100000.0 at a
+ # distance of 58. This value was determined manually inside Blender.
+ lamp_data.energy = 100000.0 * ( (length * length) / (58.0 * 58.0) )
lamp = bpy.data.objects.new("A_lamp_eevee", lamp_data)
lamp.location = lamp_xyz_vec
bpy.context.collection.objects.link(lamp)
@@ -655,11 +659,7 @@ def camera_light_source(use_camera,
# tree
lamp.name = "A_lamp_cycles"
- # We now determine the emission strength of the lamp. Note that the
- # intensity depends on 1/r^2. For this we use a value of 5000.0 at a
- # distance of 58 (58x58 = 3364.0). This value was determined only once
- # in the Blender viewport
- length = lamp_xyz_vec.length
+ # See above.
strength = 5000.0 * ( (length * length) / (58.0 * 58.0) )
# Now, we create the material
@@ -1402,7 +1402,7 @@ def import_pdb(Ball_type,
mat_P_BSDF = material.node_tree.nodes['Principled BSDF']
mat_P_BSDF.inputs['Metallic'].default_value = 0.1
mat_P_BSDF.inputs['Specular'].default_value = 0.15
- mat_P_BSDF.inputs['Roughness'].default_value = 0.0
+ mat_P_BSDF.inputs['Roughness'].default_value = 0.05
mat_P_BSDF.inputs['Clearcoat Roughness'].default_value = 0.37
mat_P_BSDF.inputs['IOR'].default_value = 0.8
mat_P_BSDF.inputs['Transmission'].default_value = 0.6
diff --git a/io_mesh_atomic/xyz_import.py b/io_mesh_atomic/xyz_import.py
index d20c1730..d50cacff 100644
--- a/io_mesh_atomic/xyz_import.py
+++ b/io_mesh_atomic/xyz_import.py
@@ -430,13 +430,17 @@ def camera_light_source(use_camera,
# Create x, y and z for the lamp.
object_lamp_vec = Vector((lamp_dl,lamp_dy_right,lamp_dl))
lamp_xyz_vec = object_center_vec + object_lamp_vec
+ length = lamp_xyz_vec.length
# Eevee
# =====
# As a lamp we use a point source.
lamp_data = bpy.data.lights.new(name="A_lamp_eevee", type="POINT")
- lamp_data.energy = 100000.0 # Watts
+ # We now determine the emission strength of the lamp. Note that the
+ # intensity depends on 1/r^2. For this we use a value of 100000.0 at a
+ # distance of 58. This value was determined manually inside Blender.
+ lamp_data.energy = 100000.0 * ( (length * length) / (58.0 * 58.0) )
lamp = bpy.data.objects.new("A_lamp_eevee", lamp_data)
lamp.location = lamp_xyz_vec
bpy.context.collection.objects.link(lamp)
@@ -458,11 +462,7 @@ def camera_light_source(use_camera,
# tree
lamp.name = "A_lamp"
- # We now determine the emission strength of the lamp. Note that the
- # intensity depends on 1/r^2. For this we use a value of 5000.0 at a
- # distance of 58 (58x58 = 3364.0). This value was determined only once
- # in the Blender viewport
- length = lamp_xyz_vec.length
+ # See above.
strength = 5000.0 * ( (length * length) / (58.0 * 58.0) )
# Now, we create the material
@@ -546,7 +546,7 @@ def import_xyz(Ball_type,
mat_P_BSDF = material.node_tree.nodes['Principled BSDF']
mat_P_BSDF.inputs['Metallic'].default_value = 0.1
mat_P_BSDF.inputs['Specular'].default_value = 0.15
- mat_P_BSDF.inputs['Roughness'].default_value = 0.0
+ mat_P_BSDF.inputs['Roughness'].default_value = 0.05
mat_P_BSDF.inputs['Clearcoat Roughness'].default_value = 0.37
mat_P_BSDF.inputs['IOR'].default_value = 0.8
mat_P_BSDF.inputs['Transmission'].default_value = 0.6