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>2013-03-22 22:41:13 +0400
committerClemens Barth <barth@root-1.de>2013-03-22 22:41:13 +0400
commit9a650c23d07620192f97fee1dfbdaac722b40cde (patch)
tree222d37441ee1373e860307900fc8832503f9a71e /io_mesh_pdb/import_pdb.py
parentdc2a91fe721e5cd44a9bdf6b4f1746b566c31fad (diff)
The new feature: the sticks represented by a skin and subdivision modifier
do also have a material now. - I simply forgot that to include. Blendphys.
Diffstat (limited to 'io_mesh_pdb/import_pdb.py')
-rw-r--r--io_mesh_pdb/import_pdb.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py
index 6692f9f3..d52a7e9f 100644
--- a/io_mesh_pdb/import_pdb.py
+++ b/io_mesh_pdb/import_pdb.py
@@ -794,6 +794,11 @@ def draw_sticks_skin(all_atoms,
new_stick_mesh.modifiers[1].levels = sticks_subdiv_view
new_stick_mesh.modifiers[1].render_levels = sticks_subdiv_render
+ bpy.ops.object.material_slot_add()
+ stick_material = bpy.data.materials.new(ELEMENTS[-1].name)
+ stick_material.diffuse_color = ELEMENTS[-1].color
+ new_stick_mesh.active_material = stick_material
+
# This is for putting the radiu of the sticks onto
# the desired value 'Stick_diameter'
bpy.context.scene.objects.active = new_stick_mesh