0
$\begingroup$

Problem:

I'm trying to create a row of vertices to render as Christmas lights. Each vertex has its own x, y, z values, but I would like to add a fourth attribute to use as brightness.

Here's a simplified visualization of what I'm trying to achieve: enter image description here

Each vertex has its own custom attribute so I can assign it as a brightness from 0 (dim) to 3 (brightest).

Is there any way to add a fourth attribute that doesn't involve vertex groups? Exporting vertex groups via JSON gives me four arrays of a binary nature:

"Group 0": [1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0]
"Group 1": [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]
"Group 2": [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1]
"Group 3": [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0]

What I need is just one array because the values won't necessarily be in discrete integers:

"Groups" : [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]

Question:

  • How do I assign a custom attribute to each vertex via the GUI?

I've seen answers that need use of the BMesh module, but I don't know scripting, and I need to edit each vertex individually (hopefully via the GUI).

I saw the Custom Properties dropdown, which looked very promising, but I cannot assign individual values to each vertex, it only assigns a single property to the entire object.

enter image description here

$\endgroup$
  • $\begingroup$ Where do you want to use the exported data? I think it would be easier to create an object at each location with a custom value, then have a script to export the format you want. Also each vertex group has a weight which is between 0.0 and 1.0, so you shouldn't get only 0 or 1 in the vertex group export. $\endgroup$ – sambler Jul 26 '17 at 9:46
  • $\begingroup$ Oh, you're right! I didn't know you could change vertex weights! This is what I was looking for. I had to assign values as 0.0, 0.1, 0.2, 0.3 and then remove "0." from each JSON value to transform to integers, but it works! (By the way, I'm using THREE.js exporter to use the JSON data in Three.js) $\endgroup$ – Marquizzo Jul 26 '17 at 18:05

Your Answer

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

Browse other questions tagged or ask your own question.