[Bf-extensions-cvs] [6196b535] 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:49 CET 2019


Commit: 6196b535feeb30d8faedaa8f72b786225292b2f6
Author: Clemens Barth
Date:   Sat Mar 16 09:38:43 2019 +0100
Branches: master
https://developer.blender.org/rBAC6196b535feeb30d8faedaa8f72b786225292b2f6

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_xyz/import_xyz.py

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

diff --git a/io_mesh_xyz/import_xyz.py b/io_mesh_xyz/import_xyz.py
index a9274d29..a0ae78a1 100644
--- a/io_mesh_xyz/import_xyz.py
+++ b/io_mesh_xyz/import_xyz.py
@@ -603,7 +603,7 @@ def import_xyz(Ball_type,
         atom_mesh = bpy.data.meshes.new("Mesh_"+atom.name)
         atom_mesh.from_pydata(atom_vertices, [], [])
         atom_mesh.update()
-        new_atom_mesh = bpy.data.objects.new(atom.name, atom_mesh)
+        new_atom_mesh = bpy.data.objects.new(atom.name + "_mesh", atom_mesh)
         bpy.context.collection.objects.link(new_atom_mesh)
 
         # Now, build a representative sphere (atom)
@@ -635,9 +635,9 @@ def import_xyz(Ball_type,
         ball.scale  = (atom.radius*Ball_radius_factor,) * 3
 
         if atom.name == "Vacancy":
-            ball.name = "Cube_"+atom.name
+            ball.name = atom.name + "_cube"
         else:
-            ball.name = "Ball (NURBS)_"+atom.name
+            ball.name = atom.name + "_ball"
         ball.active_material = atom.material
         ball.parent = new_atom_mesh
         new_atom_mesh.instance_type = 'VERTS'



More information about the Bf-extensions-cvs mailing list