[Bf-extensions-cvs] [db317035] master: Concept change for dupliverts (atomic structures): the way of naming a duplivert (mesh and obj) has been changed.

Clemens Barth noreply at git.blender.org
Sat Mar 16 09:38:40 CET 2019


Commit: db317035ef56a37aa53cc22714748fce03cb1462
Author: Clemens Barth
Date:   Sat Mar 16 09:29:12 2019 +0100
Branches: master
https://developer.blender.org/rBAdb317035ef56a37aa53cc22714748fce03cb1462

Concept change for dupliverts (atomic structures): the way of naming a duplivert (mesh and obj) has been changed.

Problem: because of changes that were made with respect to instancing
(see https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API)
the mesh and object appear on the 'same level' in the outliner. Finding the mesh and object
was not easy because of the old 'name convention' in 2.79. Now, the names of mesh and object both
start with the element name (e.g., hydrogen) + an identifier of their nature ("_mesh" and "ball"). The
then appear one after the other in the outliner ... .

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

M	io_mesh_pdb/import_pdb.py

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

diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py
index ffad2267..dd561042 100644
--- a/io_mesh_pdb/import_pdb.py
+++ b/io_mesh_pdb/import_pdb.py
@@ -646,7 +646,7 @@ def draw_atoms_one_type(draw_all_atoms_type,
     atom_mesh = bpy.data.meshes.new("Mesh_"+atom[0])
     atom_mesh.from_pydata(atom_vertices, [], [])
     atom_mesh.update()
-    new_atom_mesh = bpy.data.objects.new(atom[0], atom_mesh)
+    new_atom_mesh = bpy.data.objects.new(atom[0] + "_mesh", atom_mesh)
     bpy.context.collection.objects.link(new_atom_mesh)
 
     # Now, build a representative sphere (atom).
@@ -678,9 +678,9 @@ def draw_atoms_one_type(draw_all_atoms_type,
     ball.scale  = (atom[3]*Ball_radius_factor,) * 3
 
     if atom[0] == "Vacancy":
-        ball.name = "Cube_"+atom[0]
+        ball.name = atom[0] + "_cube"
     else:
-        ball.name = "Ball_"+atom[0]
+        ball.name = atom[0] + "_ball" 
     ball.active_material = atom[1]
     ball.parent = new_atom_mesh
     new_atom_mesh.instance_type = 'VERTS'



More information about the Bf-extensions-cvs mailing list