io_mesh_atomic: atom objects had no 'diffuse_color'
Property 'material.diffuse_color' is now set such that one can see the color of the atoms in also the 'Solid mode' of the Viewport. Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
b825c2d31a
commit
7f5d0ab6be
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue