Zdravim
potreboval bych poradit.Musim vytvorit datovou kostku v Blenderu.Datova kostka se sklada z cca 300000 dalsich malych kosticek.
Napsal jsem skript ktery vytvori kostku o rozmeru jedna a posune ji na pozici o roznerech LocX LocY LocZ.To posunuti se pocita ke stredu kosticky a udela jiny rozmer kostky(SizeX SizeY Size Z).Jde mi ted o to ze velikosti kosticek a jejich polohu mam ulozeny v txt souboru.(pro polohu jeden soubor pro velikost druhy).Potreboval bych nejak tyto hodnoty nacist do skriptu tim padem nejak priradit promenne LocX...a SizeX...Ty promenne se budou cist ze souborů.Nevite nahodou co stim? Moc by mi to pomohlo.
tady je skript:
import Blender
from Blender import NMesh
me=NMesh.New()
#me=NMesh.GetRaw()
v=NMesh.Vert(1.0,0.0,0.0)
me.verts.append(v)
v=NMesh.Vert(1.0,1.0,0.0)
me.verts.append(v)
v=NMesh.Vert(0.0,1.0,0.0)
me.verts.append(v)
v=NMesh.Vert(0.0,0.0,0.0)
me.verts.append(v)
f=NMesh.Face()
f.v.append(me.verts[0])
f.v.append(me.verts[1])
f.v.append(me.verts[2])
f.v.append(me.verts[3])
me.faces.append(f)
v=NMesh.Vert(1.0,0.0,1.0)
me.verts.append(v)
v=NMesh.Vert(1.0,1.0,1.0)
me.verts.append(v)
v=NMesh.Vert(0.0,1.0,1.0)
me.verts.append(v)
v=NMesh.Vert(0.0,0.0,1.0)
me.verts.append(v)
f=NMesh.Face()
f.v.append(me.verts[4])
f.v.append(me.verts[5])
f.v.append(me.verts[6])
f.v.append(me.verts[7])
me.faces.append(f)
v=NMesh.Vert(0.0,0.0,0.0)
me.verts.append(v)
v=NMesh.Vert(0.0,0.0,1.0)
me.verts.append(v)
v=NMesh.Vert(1.0,0.0,1.0)
me.verts.append(v)
v=NMesh.Vert(1.0,0.0,0.0)
me.verts.append(v)
f=NMesh.Face()
f.v.append(me.verts[8])
f.v.append(me.verts[9])
f.v.append(me.verts[10])
f.v.append(me.verts[11])
me.faces.append(f)
v=NMesh.Vert(0.0,0.0,0.0)
me.verts.append(v)
v=NMesh.Vert(0.0,0.0,1.0)
me.verts.append(v)
v=NMesh.Vert(0.0,1.0,1.0)
me.verts.append(v)
v=NMesh.Vert(0.0,1.0,0.0)
me.verts.append(v)
f=NMesh.Face()
f.v.append(me.verts[12])
f.v.append(me.verts[13])
f.v.append(me.verts[14])
f.v.append(me.verts[15])
me.faces.append(f)
v=NMesh.Vert(1.0,0.0,0.0)
me.verts.append(v)
v=NMesh.Vert(1.0,0.0,1.0)
me.verts.append(v)
v=NMesh.Vert(1.0,1.0,1.0)
me.verts.append(v)
v=NMesh.Vert(1.0,1.0,0.0)
me.verts.append(v)
f=NMesh.Face()
f.v.append(me.verts[16])
f.v.append(me.verts[17])
f.v.append(me.verts[18])
f.v.append(me.verts[19])
me.faces.append(f)
v=NMesh.Vert(1.0,1.0,0.0)
me.verts.append(v)
v=NMesh.Vert(1.0,1.0,1.0)
me.verts.append(v)
v=NMesh.Vert(0.0,1.0,1.0)
me.verts.append(v)
v=NMesh.Vert(0.0,1.0,0.0)
me.verts.append(v)
f=NMesh.Face()
f.v.append(me.verts[20])
f.v.append(me.verts[21])
f.v.append(me.verts[22])
f.v.append(me.verts[23])
me.faces.append(f)
NMesh.PutRaw(me, "cube")
Blender.Redraw()
import Blender
from Blender import NMesh
a=Blender.Object.Get("Mesh")
a.SizeX=4
a.SizeY=2
a.SizeZ=1
a=Blender.Object.Get("Mesh")
a.LocX=7
a.LocY=0
a.LocZ=1
NMesh.PutRaw(me, "cube")
Blender.Redraw()
a tady cast souradnic stredu kostky a velikost kostky
souradnice stredu kostky
-6.0190 -6.0190 -7.8710
-8.7970 -8.7970 -6.9450
-8.3340 -8.3340 -6.4820
-7.8710 -8.7970 -6.9450
-8.7970 -7.8710 -6.9450
-7.8710 -7.8710 -6.9450
-8.7970 -8.7970 -6.0190
-7.8710 -8.7970 -6.0190
-8.7970 -7.8710 -6.0190
-7.8710 -7.8710 -6.0190
-6.4820 -8.3340 -6.4820
-6.9450 -8.7970 -6.9450
-6.0190 -8.7970 -6.9450
-6.9450 -7.8710 -6.9450
-6.0190 -7.8710 -6.9450
-6.9450 -8.7970 -6.0190
-6.0190 -8.7970 -6.0190
-6.9450 -7.8710 -6.0190
-6.0190 -7.8710 -6.0190
-8.7970 -6.9450 -6.9450
-8.3340 -6.4820 -6.4820
-7.8710 -6.9450 -6.9450
-8.7970 -6.0190 -6.9450
-7.8710 -6.0190 -6.9450
-8.7970 -6.9450 -6.0190
-7.8710 -6.9450 -6.0190
-8.7970 -6.0190 -6.0190
-7.8710 -6.0190 -6.0190
-6.4820 -6.4820 -6.4820
-6.9450 -6.9450 -6.9450
-6.0190 -6.9450 -6.9450
-6.9450 -6.0190 -6.9450
-6.0190 -6.0190 -6.9450
-6.2505 -6.2505 -7.17650
-5.7875 -6.2505 -7.17650
-6.2505 -5.7875 -7.17650
velikost hran kostky
1.852 1.852 1.852
3.704 3.704 3.704
1.852 1.852 1.852
1.852 1.852 1.852
0.926 0.926 0.926
1.852 1.852 1.852
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
1.852 1.852 1.852
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
1.852 1.852 1.852
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
1.852 1.852 1.852
0.926 0.926 0.926
0.926 0.926 0.926
0.926 0.926 0.926
Fórum › Python
Python a Blender
![](img/forum_vlakno_help_vyreseno.png)
![](img/forum_nove_psp_new.png)
Přidej příspěvek
Toto téma je starší jak čtvrt roku – přidej svůj příspěvek jen tehdy, máš-li k tématu opravdu co říct!
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
Aktuálně jsou podporována videa ze serverů YouTube, Vimeo a Dailymotion.
×![](/img/smile/1.gif)
![](/img/smile/2.gif)
![](/img/smile/3.gif)
![](/img/smile/4.gif)
![](/img/smile/5.gif)
![](/img/smile/6.gif)
![](/img/smile/7.gif)
![](/img/smile/8.gif)
![](/img/smile/9.gif)
![](/img/smile/10.gif)
![](/img/smile/11.gif)
![](/img/smile/12.gif)
![](/img/smile/13.gif)
![](/img/smile/14.gif)
![](/img/smile/15.gif)
![](/img/smile/16.gif)
![](/img/smile/17.gif)
![](/img/smile/18.gif)
![](/img/smile/19.gif)
![](/img/smile/20.gif)
![](/img/smile/21.gif)
![](/img/smile/22.gif)
![](/img/smile/23.gif)
![](/img/smile/24.gif)
![](/img/smile/25.gif)
![](/img/smile/26.gif)
![](/img/smile/27.gif)
![](/img/smile/28.gif)
![](/img/smile/29.gif)
![](/img/smile/30.gif)
![](/img/smile/31.gif)
![](/img/smile/1.gif)
![](/img/smile/2.gif)
![](/img/smile/3.gif)
![](/img/smile/4.gif)
![](/img/smile/5.gif)
![](/img/smile/6.gif)
![](/img/smile/7.gif)
![](/img/smile/8.gif)
![](/img/smile/9.gif)
![](/img/smile/10.gif)
![](/img/smile/11.gif)
![](/img/smile/12.gif)
![](/img/smile/13.gif)
![](/img/smile/14.gif)
![](/img/smile/15.gif)
![](/img/smile/16.gif)
![](/img/smile/17.gif)
![](/img/smile/18.gif)
![](/img/smile/19.gif)
![](/img/smile/20.gif)
![](/img/smile/21.gif)
![](/img/smile/22.gif)
![](/img/smile/23.gif)
![](/img/smile/24.gif)
![](/img/smile/25.gif)
![](/img/smile/26.gif)
![](/img/smile/27.gif)
![](/img/smile/28.gif)
![](/img/smile/29.gif)
![](/img/smile/30.gif)
![](/img/smile/31.gif)
![](/img/smile/32.gif)
Uživatelé prohlížející si toto vlákno
Uživatelé on-line: 0 registrovaných, 6 hostů
Podobná vlákna
Tutorial BLENDER/PYTHON — založil Wolfkiller
Blender seka se — založil johnysek12
Blender 2.57b — založil predy
Moderátoři diskuze