Animation_nodes: Set Vertex Color node does not allow to set the vertex color for mesh generated with Animation Noes

Created on 7 Dec 2019  路  15Comments  路  Source: JacquesLucke/animation_nodes

Hi...
The Set Vertex Color node does not allow to set the color for the mesh which is generated with the Animation Noes.
screen

Most helpful comment

This hasn't been implemented yet. I don't think we will restore the previous behavior; because it is too dangerous and rather unexpected. However, if the meshes are generated in AN, then you will be able to create as many vertex color layers as you want with the names you want.

All 15 comments

Well you just need to add a vertex color layer.

Ah, you mean that when AN writes a new mesh, the vertex color layers will be gone. Let me think about that for a second.

Okay. Btw, now I remebder why I added this object.data.vertex_colors.new(name = 'Col') line in the old code of the node,
https://github.com/JacquesLucke/animation_nodes/blob/af8354fffcb9a05290fe81cebd3ad9ccbcf0c8d7/animation_nodes/nodes/color/set_vertex_color.py#L100

Yah, but this is still not a good solution. I will get back to you?

Yes, you are absolutely right. Okay.

Ok, so, here is what we are going to do. We will store a list of vertex colors in the AN mesh structure itself. Then write those vertex colors in the Mesh Object Output node. Much like we do with UVs.

The question is, what should we do to the Vertex Color input node? Should the vertex and polygon colors be derived mesh properties? We can perhaps add a Get Mesh Vertex Colors node instead.

Okay, it looks promising.

  • Just for testing Vertex Color Input node for a mesh from AN, I have added this line in the Set Vertex Color nodeobject.data.vertex_colors.new(name = 'Col'). The Vertex Color Input node is working fine,
    Screenshot from 2019-12-07 19-04-49

  • _Should the vertex and polygon colors be derived mesh properties?_ This shall change the general workflow of AN, what I mean is that we are setting the vertex color with the _Set Vertex Color_ node but getting it from the mesh properties. However, this will give more functionality to play with Vertex Color.

  • _Get Mesh Vertex Colors node_ This idea will require two nodes, one to get mesh from an object _Mesh Object Input node_ and another is _Get Mesh Vertex Colors_.

Yes, this is what I had in mind.

Okay.

Just a query, suppose we get vertex color from mesh (using Get Mesh Vertex Colors) and we manipulate the mesh (remove some vertices or polygon). Then, how we can handle the vertex color of the modified mesh?

There isn't much we can do this case, this is the user's responsibility. We only care about changes done by our nodes.

Okay :)

Okay, it looks promising.

  • Just for testing Vertex Color Input node for a mesh from AN, I have added this line in the Set Vertex Color nodeobject.data.vertex_colors.new(name = 'Col'). The Vertex Color Input node is working fine,
    Screenshot from 2019-12-07 19-04-49
  • _Should the vertex and polygon colors be derived mesh properties?_ This shall change the general workflow of AN, what I mean is that we are setting the vertex color with the _Set Vertex Color_ node but getting it from the mesh properties. However, this will give more functionality to play with Vertex Color.
  • _Get Mesh Vertex Colors node_ This idea will require two nodes, one to get mesh from an object _Mesh Object Input node_ and another is _Get Mesh Vertex Colors_.

Was wondering if this change to fix the issue has been implemented or not, seems not on my side even after download the newest version of AN+EN that has renewed in 2019/12/09.

Also In the past, Set vertex color node has an ability to name such an attribute. Instead of naming it "Col", it's possible to change "Col" to others like "randomcolor" using nodes (thus retain the proceduralness). In that case, I suppose it generates a vertex layer/attribute with each set vertex color node, meaning it's possible to generate multiple attributes for a single object (I haven't tested this. I can be completely wrong, but I no longer have older version of AN to test this).

The current "set vertex color" node, however, seems losing this function completely. You have to manually add one, and only one vertex color layer, and you can't change its name through AN as in the past? (indeed, if you can only generate one vertex layer, it may be pointless to change it's name through AN). Although I think there are workarounds to solve the problem, but I don't think these function should be deleted in this node?

This hasn't been implemented yet. I don't think we will restore the previous behavior; because it is too dangerous and rather unexpected. However, if the meshes are generated in AN, then you will be able to create as many vertex color layers as you want with the names you want.

This hasn't been implemented yet. I don't think we will restore the previous behavior; because it is too dangerous and rather unexpected. However, if the meshes are generated in AN, then you will be able to create as many vertex color layers as you want with the names you want.

Not sure how this will work based on the current node behavior we have, but if what you said will come true then it may be good enough. Will see. Thanks for replying.

Resolved in #1256.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tofuhead picture tofuhead  路  7Comments

LupoMarcio picture LupoMarcio  路  4Comments

765563652 picture 765563652  路  7Comments

shadowcreeper-hash picture shadowcreeper-hash  路  4Comments

collinizhou picture collinizhou  路  10Comments