Gradient vertex color for proportional editing


#1

Hi. I am new the Blender source code development. I want to add gradient vertex color feature for proportional editing mode like Maya. Currently I am tweaking the editor and bmesh codes. Could anyone help me about where I should look in order to set vertex colors in edit mode?


Vertex Colors display in Viewport
#2

I did find it maybe someone else need;
draw_em_fancy_verts function in drawobject.c.


#3

If you want to implement this feature, it should be done in the blender2.8 branch since the drawing code was completely rewritten there.

The transform tools can already do some additional drawing when active, see drawTransformView() where it draws constraints, snapping, edge slide, … over the mesh. This could fit there as well.


#4

Thank you so much for helping. I have added new function into drawTransformView like you instructed.
I am using immVertex3fv function to create new vertices according to gradient color for temporary solution.

But I should clip vertices which stay behind the faces for this. Also gradient vertices are only shown in while translating.

I want to change vertices color directly in drawing codes, that would solve both problems. Is drawing codes are still placed in drawobject.c for blender2.8?


#5


Clipping problem.


#6

For the clipping, the depth test is probably disabled? Normally it is enabled, but if you copied code from e.g. vertex / edge slide that code disables it.

If you want this to show also while the transform tool is not active, that is going to be a lot more complicated. The code to compute the falloff will need to be decoupled from the transform operator, and it will have to be refreshed whenever the mesh changes. Performance will be a concern.

If you want to implement that I can’t give you any quick pointers for where to look, you’ll need to dive into the mesh and drawing code to understand it more.


#7

I understand. Decoupled computing for falloff would not be nice. Thank you so much again for helping.
I have disabled the depth testing.

I think it is looking fine.


#8

it doesn’t seem to have full color range (eg. go from blue to red)


#9

Maybe it could be themable ?


#10

Sorry for late respond, yeah it doesn’t use blue channel, it is working top to down as red -> yellow (full red and green) -> green


#11

Thank you for suggestion, I will try to handle it.


#12

Hey, I just wanted to know what is missing in this to be in 2.8 ? :smiley:


#13

Looks pretty cool and useful.


#14

can you apply gradient coloring to faces as well? seeing falloff on vertex only isn’t that informative imo.


#15

This post was flagged by the community and is temporarily hidden.


#16

This post was flagged by the community and is temporarily hidden.