"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "source/blender/blenkernel/intern/material.c" between
blender-2.93.0.tar.xz and blender-2.93.1.tar.xz

About: Blender is a 3D graphics creation suite allowing modeling, animation, rendering, post-production, realtime interactive 3D and game creation and playback with cross-platform compatibility. LTS (Long Term Support) release.

material.c  (blender-2.93.0.tar.xz):material.c  (blender-2.93.1.tar.xz)
skipping to change at line 1370 skipping to change at line 1370
void BKE_texpaint_slots_refresh_object(Scene *scene, struct Object *ob) void BKE_texpaint_slots_refresh_object(Scene *scene, struct Object *ob)
{ {
for (int i = 1; i < ob->totcol + 1; i++) { for (int i = 1; i < ob->totcol + 1; i++) {
Material *ma = BKE_object_material_get(ob, i); Material *ma = BKE_object_material_get(ob, i);
BKE_texpaint_slot_refresh_cache(scene, ma); BKE_texpaint_slot_refresh_cache(scene, ma);
} }
} }
struct FindTexPaintNodeData { struct FindTexPaintNodeData {
bNode *node; Image *ima;
short iter_index; bNode *r_node;
short index;
}; };
static bool texpaint_slot_node_find_cb(bNode *node, void *userdata) static bool texpaint_slot_node_find_cb(bNode *node, void *userdata)
{ {
struct FindTexPaintNodeData *find_data = userdata; struct FindTexPaintNodeData *find_data = userdata;
if (find_data->iter_index++ == find_data->index) { Image *ima = (Image *)node->id;
find_data->node = node; if (find_data->ima == ima) {
find_data->r_node = node;
return false; return false;
} }
return true; return true;
} }
bNode *BKE_texpaint_slot_material_find_node(Material *ma, short texpaint_slot) bNode *BKE_texpaint_slot_material_find_node(Material *ma, short texpaint_slot)
{ {
struct FindTexPaintNodeData find_data = {NULL, 0, texpaint_slot}; struct FindTexPaintNodeData find_data = {ma->texpaintslot[texpaint_slot].ima, NULL};
ntree_foreach_texnode_recursive(ma->nodetree, texpaint_slot_node_find_cb, &fin d_data); ntree_foreach_texnode_recursive(ma->nodetree, texpaint_slot_node_find_cb, &fin d_data);
return find_data.node; return find_data.r_node;
} }
/* r_col = current value, col = new value, (fac == 0) is no change */ /* r_col = current value, col = new value, (fac == 0) is no change */
void ramp_blend(int type, float r_col[3], const float fac, const float col[3]) void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
{ {
float tmp, facm = 1.0f - fac; float tmp, facm = 1.0f - fac;
switch (type) { switch (type) {
case MA_RAMP_BLEND: case MA_RAMP_BLEND:
r_col[0] = facm * (r_col[0]) + fac * col[0]; r_col[0] = facm * (r_col[0]) + fac * col[0];
 End of changes. 4 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)