0
$\begingroup$

I want to export vertex data of a simple objects which include normal and color information as well as vertices coordinates as text file. Similar to following example. Is it possible?

Vertex(
x: -1.0 ,
y: 1.0,
z: 1.0,
r: 1.0,
g: 0.0,
b: 0.0,
a: 1.0,
s: 0.25,
t: 0.25,
nX: 0.0,
nY: 0.0,
nZ: 1.0
)
$\endgroup$
1
$\begingroup$

You could use Python for exporting the exact format you asked for. (what are a, s, and t though ?) (I guess a is for alpha, but I don't think VertexColor data has an alpha channel. For s and t, I dont't know. Your question is not clear on these points).

If you accept other similar format, then you can export as PLY : enter image description here

Don't forget to activate "Vertex Color" : enter image description here

You get such a file : enter image description here

The header explains the structure: The orange line tells you you'll first have 1966 lines desribing the vertices (what you want) with columns described in yellow.

The pink tells you that you will have 500 faces with the property in blue. You didn't ask for it though. But it seems you cannot bypass them at export time.

$\endgroup$
3
  • $\begingroup$ Just to make it clear. s t values was about placement of texture image on vertex model at Apple' Metal. What I get from your answer is a translating function is needed to use vertices in a Swift application. OK. $\endgroup$ – Hope Nov 8 '17 at 10:46
  • $\begingroup$ If I understood you well, what you call 's' and 't' are 'U' and 'V' coordinates in Blender. $\endgroup$ – Maxx Nov 8 '17 at 12:07
  • $\begingroup$ PLY creates duplicate vertices. Is there an addon just to output vertex color in correct indices order. $\endgroup$ – June Wang Sep 25 '19 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.