Blender (jusqu'à 2.49)
Python
MESH :  locate vertices on a edge .
    Début   Index
précédentScript Python
Script Python suivant
#------------------
# ME is supposed to be a mesh
#------------------
ME=Blender.Object.GetSelected()[0].getData()
#------------------
# for the example, get the two first vertices of ME 
#------------------
A=ME.verts[0]
B=ME.verts[1]   
#------------------
# for the example, a list of values for "percent"
# this will create 4 point on the edges [AB]
#------------------
for percent in [10,20,45,75]  :
  #------------------
  # create a vertex to be added to the mesh
  #------------------
  C=Blender.NMesh.Vert()
  #------------------
  # Calculate the location of C between A and B, in x,y and z axis .
  # like that : C=A+(B-A)*percent
  #------------------
  for n in [0,1,2]:
     C.co[n]=A.co[n]+(B.co[n]-A.co[n])*percent/100.0
  #------------------
  # have an echo in the console
  #------------------
  print C.co
  #------------------
  # Add new vertex to the list
  #------------------
  ME.verts.append(C)
#------------------
# insert the new data of ME  in Blender daat base .
#------------------
ME.update() 
précédentScript Python
 Script Python suivant
Vers le  Haut de page

Les questions concernant cette page  peuvent être posées sur  :
 news://news.zoo-logique.org/3D.Blender

Livre en français
Blender : apprenez, pratiquez, Créez, livre, Ed. Campus Press, coll. Starter Kit
Blender Starter Kit

Forum
FAQ
Lexique
Didacticiels
Compilations
Blender2KT
Débuter
Modelage
Blender python
Materiaux
Lumière
Animation
API python (eng)
Archives nzn
Statistiques
Doc flash Sculptris
Galerie Sculptris

mon site de démos sur youtube