59 (mesh && mesh->
faces_num && !mesh->deform_verts().is_empty());
65 Mesh &mesh = *
static_cast<Mesh *
>(
object.data);
96 if (deform_group ==
nullptr) {
105 if (!color_attribute) {
144 ot->name =
"Vertex Color from Weight";
145 ot->idname =
"PAINT_OT_vertex_color_from_weight";
146 ot->description =
"Convert active weight into gray scale vertex colors";
173 ".select_poly", domain,
false);
178 ".select_vert", domain,
false);
238 ot->name =
"Smooth Vertex Colors";
239 ot->idname =
"PAINT_OT_vertex_color_smooth";
240 ot->description =
"Smooth colors across vertices";
268 if (!color_attribute) {
280 using T =
typename decltype(type_tag)::type;
281 for ([[maybe_unused]]
const int i : segment) {
282 if constexpr (std::is_void_v<T>) {
285 else if constexpr (std::is_same_v<T, ColorGeometry4f>) {
290 else if constexpr (std::is_same_v<T, ColorGeometry4b>) {
343 brightness /= 100.0f;
344 float delta = contrast / 200.0f;
351 gain = 1.0f - delta * 2.0f;
352 gain = 1.0f /
max_ff(gain, FLT_EPSILON);
353 offset = gain * (brightness - delta);
357 gain =
max_ff(1.0f - delta * 2.0f, 0.0f);
358 offset = gain * brightness + delta;
370 for (
int i = 0; i < 3; i++) {
383 ot->name =
"Vertex Paint Brightness/Contrast";
384 ot->idname =
"PAINT_OT_vertex_color_brightness_contrast";
385 ot->description =
"Adjust vertex color brightness/contrast";
395 const float min = -100,
max = +100;
420 hsv[0] += (
hue - 0.5f);
424 else if (hsv[0] < 0.0f) {
439 ot->name =
"Vertex Paint Hue/Saturation/Value";
440 ot->idname =
"PAINT_OT_vertex_color_hsv";
441 ot->description =
"Adjust vertex color Hue/Saturation/Value";
452 RNA_def_float(
ot->srna,
"s", 1.0f, 0.0f, 2.0f,
"Saturation",
"", 0.0f, 2.0f);
453 RNA_def_float(
ot->srna,
"v", 1.0f, 0.0f, 2.0f,
"Value",
"", 0.0f, 2.0f);
468 for (
int i = 0; i < 3; i++) {
479 ot->name =
"Vertex Paint Invert";
480 ot->idname =
"PAINT_OT_vertex_color_invert";
481 ot->description =
"Invert RGB values";
506 for (
int i = 0; i < 3; i++) {
519 ot->name =
"Vertex Paint Levels";
520 ot->idname =
"PAINT_OT_vertex_color_levels";
521 ot->description =
"Adjust levels of vertex colors";
532 ot->srna,
"offset", 0.0f, -1.0f, 1.0f,
"Offset",
"Value to add to colors", -1.0f, 1.0f);
534 ot->srna,
"gain", 1.0f, 0.0f,
FLT_MAX,
"Gain",
"Value to multiply colors by", 0.0f, 10.0f);
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
void BKE_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
Mesh * BKE_mesh_from_object(Object *ob)
@ BKE_MESH_BATCH_DIRTY_ALL
void BKE_sculpt_update_object_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
#define BLI_assert_unreachable()
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
bool ED_mesh_color_ensure(Mesh *mesh, const char *name)
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its hue
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color attribute
BPy_StructRNA * depsgraph
static IndexMask from_bools(Span< bool > bools, IndexMaskMemory &memory)
void to_static_type_tag(const Fn &fn) const
const void * data() const
const CPPType & type() const
void materialize(void *dst) const
void get(int64_t index, void *r_value) const
void set_all(const void *src)
void set_by_copy(int64_t index, const void *value)
GVArray adapt_domain(const GVArray &varray, const AttrDomain from_domain, const AttrDomain to_domain) const
GAttributeReader lookup(const StringRef attribute_id) const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
int domain_size(const AttrDomain domain) const
bool contains(const StringRef attribute_id) const
GAttributeWriter lookup_for_write(StringRef attribute_id)
GSpanAttributeWriter lookup_for_write_span(StringRef attribute_id)
void tag_attribute_changed(const IndexMask &node_mask, StringRef attribute_name)
pbvh::Tree * pbvh_get(Object &object)
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
eCustomDataType cpp_type_to_custom_data_type(const CPPType &type)
void push_end(Object &ob)
void push_nodes(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const Type type)
void push_begin(const Scene &scene, Object &ob, const wmOperator *op)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
ColorSceneLinearByteEncoded4b< eAlpha::Premultiplied > ColorGeometry4b
GPU_SHADER_INTERFACE_INFO(overlay_edit_curve_handle_iface, "vert").flat(Type pos vertex_in(1, Type::UINT, "data") .vertex_out(overlay_edit_curve_handle_iface) .geometry_layout(PrimitiveIn Frequency::GEOMETRY storage_buf(1, Qualifier::READ, "uint", "data[]", Frequency::GEOMETRY) .push_constant(Type Frequency::GEOMETRY selection[]
bool vertex_paint_mode_poll(bContext *C)
static bool vertex_color_smooth(Object &ob)
void PAINT_OT_vertex_color_smooth(wmOperatorType *ot)
static bool vertex_weight_paint_mode_poll(bContext *C)
void PAINT_OT_vertex_color_hsv(wmOperatorType *ot)
static IndexMask get_selected_indices(const Mesh &mesh, const blender::bke::AttrDomain domain, IndexMaskMemory &memory)
static int vertex_color_levels_exec(bContext *C, wmOperator *op)
static void transform_active_color_data(Mesh &mesh, const FunctionRef< void(ColorGeometry4f &color)> transform_fn)
static bool vertex_paint_from_weight(Object &ob)
static int vertex_color_hsv_exec(bContext *C, wmOperator *op)
static void face_corner_color_equalize_verts(Mesh &mesh, const IndexMask selection)
static void tag_object_after_update(Object &object)
void PAINT_OT_vertex_color_levels(wmOperatorType *ot)
void PAINT_OT_vertex_color_from_weight(wmOperatorType *ot)
void PAINT_OT_vertex_color_brightness_contrast(wmOperatorType *ot)
static int vertex_color_brightness_contrast_exec(bContext *C, wmOperator *op)
static int vertex_paint_from_weight_exec(bContext *C, wmOperator *)
void PAINT_OT_vertex_color_invert(wmOperatorType *ot)
static int vertex_color_invert_exec(bContext *C, wmOperator *op)
static void transform_active_color(bContext *C, wmOperator *op, const FunctionRef< void(ColorGeometry4f &color)> transform_fn)
static int vertex_color_smooth_exec(bContext *C, wmOperator *)
float RNA_float_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
ListBase vertex_group_names
int vertex_group_active_index
char * active_color_attribute
void WM_event_add_notifier(const bContext *C, uint type, void *reference)