Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You now can see how the clone objects are created and distributed to the vertices of the existing objects. Here  The cubes on the right were dyed with a little script, adding random colours to the nodes. You should already be able to write this extension.

 

Image Added

 

Here is the entire listing: 

Code Block
themeEclipse
languagepython
linenumberstrue
# Batch script

counter    = 1
objectList = scene.getObjects()

for single_object in objectList:
    vertexList = single_object.getVertices()

    for single_vertex in vertexList:
        vertex_position = single_vertex.getPosition()
        scene.addSphere()

        if (counter < 10):
            cloneObject_name= "Sphere0"+str(counter)

        else:
            cloneObject_name = "Sphere"+str(counter)

        cloneObject = scene.getObject(cloneObject_name)
        cloneObject.setParameter("Position", vertex_position)
        cloneObject.setParameter("Scale", Vector.new(0.2, 0.2, 0.2))
        counter += 1

...