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:
-rw-r--r--io_mesh_atomic/pdb_import.py1
-rw-r--r--io_mesh_atomic/xyz_import.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/io_mesh_atomic/pdb_import.py b/io_mesh_atomic/pdb_import.py
index c3b0c150..33df4adc 100644
--- a/io_mesh_atomic/pdb_import.py
+++ b/io_mesh_atomic/pdb_import.py
@@ -1343,6 +1343,7 @@ def import_pdb(Ball_type,
# (e.g. hydrogen)
for atom_type in atom_all_types_list:
material = bpy.data.materials.new(atom_type[1])
+ material.diffuse_color = atom_type[2]
material.use_nodes = True
mat_P_BSDF = material.node_tree.nodes['Principled BSDF']
mat_P_BSDF.inputs['Base Color'].default_value = atom_type[2]
diff --git a/io_mesh_atomic/xyz_import.py b/io_mesh_atomic/xyz_import.py
index 3cd7185c..940a2ff1 100644
--- a/io_mesh_atomic/xyz_import.py
+++ b/io_mesh_atomic/xyz_import.py
@@ -486,6 +486,7 @@ def import_xyz(Ball_type,
# Take the first atom
atom = atoms_of_one_type[0]
material = bpy.data.materials.new(atom.name)
+ material.diffuse_color = atom.color
material.use_nodes = True
mat_P_BSDF = material.node_tree.nodes['Principled BSDF']
mat_P_BSDF.inputs['Base Color'].default_value = atom.color