Blender
V3.3
|
General operations, lookup, etc. for materials. More...
Go to the source code of this file.
General operations, lookup, etc. for materials.
Definition in file BKE_material.h.
anonymous enum |
Enumerator | |
---|---|
BKE_MAT_ASSIGN_EXISTING | |
BKE_MAT_ASSIGN_USERPREF | |
BKE_MAT_ASSIGN_OBDATA | |
BKE_MAT_ASSIGN_OBJECT |
Definition at line 77 of file BKE_material.h.
Definition at line 795 of file material.c.
References BKE_material_default_gpencil(), BKE_object_material_get(), and NULL.
Referenced by BKE_gpencil_merge_materials_table_get(), ED_gpencil_join_objects_exec(), ED_gpencil_update_color_uv(), get_automasking_strokes_list(), gpencil_lock_layer_exec(), gpencil_material_hide_exec(), gpencil_material_isolate_exec(), gpencil_material_lock_all_exec(), gpencil_material_reveal_exec(), gpencil_material_unlock_all_exec(), gpencil_materials_copy_to_object_exec(), gpencil_stroke_change_color_exec(), gpencil_stroke_separate_exec(), gpencil_strokes_merge_poll(), is_stroke_affected_by_modifier(), and object_gpencil_add_exec().
Definition at line 298 of file material.c.
References BKE_gpencil_material_attr_init(), BKE_material_add(), and NULL.
Referenced by BKE_gpencil_brush_preset_set(), BKE_gpencil_object_material_new(), BLO_update_defaults_startup_blend(), gpencil_material_to_vertex_exec(), and new_material_exec().
Definition at line 270 of file material.c.
References ARRAY_SET_ITEMS, MaterialGPencilStyle::fill_rgba, MaterialGPencilStyle::flag, GP_MATERIAL_STROKE_SHOW, Material::gp_style, MEM_callocN, MaterialGPencilStyle::mix_factor, MaterialGPencilStyle::mix_rgba, NULL, MaterialGPencilStyle::stroke_rgba, MaterialGPencilStyle::texture_offset, MaterialGPencilStyle::texture_pixsize, and MaterialGPencilStyle::texture_scale.
Referenced by BKE_gpencil_material_add(), BKE_gpencil_material_settings(), BKE_gpencil_object_material_ensure_active(), and material_default_gpencil_init().
struct MaterialGPencilStyle* BKE_gpencil_material_settings | ( | struct Object * | ob, |
short | act | ||
) |
Definition at line 805 of file material.c.
References BKE_gpencil_material_attr_init(), BKE_material_default_gpencil(), BKE_object_material_get(), Material::gp_style, and NULL.
Referenced by BKE_gpencil_merge_materials(), deformStroke(), ED_gpencil_stroke_material_editable(), ED_gpencil_stroke_material_visible(), gpencil_create_extensions(), gpencil_draw_datablock(), gpencil_extract_palette_from_vertex(), gpencil_generic_curve_select(), gpencil_generic_stroke_select(), gpencil_material_hide_exec(), gpencil_material_isolate_exec(), gpencil_material_pool_create(), gpencil_material_select_exec(), gpencil_material_to_vertex_exec(), gpencil_object_cache_add(), gpencil_sculpt_brush_do_frame(), gpencil_stroke_cache_populate(), gpencil_stroke_caps_set_exec(), gpencil_stroke_cyclical_set_exec(), blender::eevee::gpencil_stroke_sync(), gpencil_vertexpaint_select_stroke(), gpencil_zoom_level_set(), and blender::io::gpencil::GpencilIO::prepare_stroke_export_colors().
Definition at line 559 of file material.c.
References BKE_id_material_array_p(), BKE_id_material_len_p(), BKE_objects_materials_test_all(), DEG_id_tag_update(), DEG_relations_tag_update(), ID_RECALC_COPY_ON_WRITE, id_us_plus(), MEM_callocN, and MEM_freeN.
Definition at line 377 of file material.c.
References BLI_assert, GS, id, ID_CU_LEGACY, ID_CV, ID_GD, ID_MB, ID_ME, ID_PT, ID_VO, ID::name, NULL, and OB_DATA_SUPPORT_ID.
Referenced by BKE_id_material_append(), BKE_id_material_assign(), BKE_id_material_clear(), BKE_id_material_eval_assign(), BKE_id_material_pop(), BKE_id_material_resize(), BKE_id_materials_copy(), BKE_object_material_from_eval_data(), BKE_object_material_get_eval(), and mesh_separate_material_assign_mat_nr().
void BKE_id_material_assign | ( | struct Main * | bmain, |
struct ID * | id, | ||
struct Material * | ma, | ||
short | act | ||
) |
Definition at line 905 of file material.c.
References BKE_id_material_array_p(), BKE_id_material_len_p(), BKE_objects_materials_test_all(), Material::id, id_us_min(), id_us_plus(), MAXMAT, MEM_callocN, MEM_freeN, and NULL.
Definition at line 621 of file material.c.
References BKE_id_material_array_p(), BKE_id_material_len_p(), BKE_objects_materials_test_all(), DEG_id_tag_update(), DEG_relations_tag_update(), ID_RECALC_COPY_ON_WRITE, id_us_min(), material_data_index_clear_id(), MEM_freeN, and NULL.
Referenced by mesh_separate_material_assign_mat_nr().
Definition at line 758 of file material.c.
References BKE_id_material_array_p(), BKE_id_material_len_p(), BLI_assert, BLI_assert_unreachable, ELEM, material, MEM_reallocN, and NULL.
Referenced by blender::nodes::node_geo_set_material_cc::assign_material_to_faces(), BKE_id_material_eval_ensure_default_slot(), blender::geometry::execute_realize_mesh_tasks(), and blender::nodes::node_geo_set_material_cc::node_geo_exec().
Add an empty material slot if the id has no material slots. This material slot allows the material to be overwritten by object-linked materials.
Definition at line 784 of file material.c.
References BKE_id_material_eval_assign(), BKE_id_material_len_p(), and NULL.
Referenced by blender::nodes::node_geo_set_material_cc::assign_material_to_faces(), blender::nodes::node_geo_mesh_primitive_circle_cc::create_circle_mesh(), blender::nodes::node_geo_mesh_primitive_cube_cc::create_cuboid_mesh(), blender::nodes::create_cylinder_or_cone_mesh(), blender::nodes::node_geo_mesh_primitive_ico_sphere_cc::create_ico_sphere_mesh(), blender::nodes::create_line_mesh(), blender::nodes::node_geo_mesh_primitive_uv_sphere_cc::create_uv_sphere_mesh(), and blender::nodes::node_geo_mesh_primitive_grid_cc::node_geo_exec().
short* BKE_id_material_len_p | ( | struct ID * | id | ) |
Definition at line 403 of file material.c.
References BLI_assert, GS, id, ID_CU_LEGACY, ID_CV, ID_GD, ID_MB, ID_ME, ID_PT, ID_VO, ID::name, NULL, and OB_DATA_SUPPORT_ID.
Referenced by BKE_id_material_append(), BKE_id_material_assign(), BKE_id_material_clear(), BKE_id_material_eval_assign(), BKE_id_material_eval_ensure_default_slot(), BKE_id_material_pop(), BKE_id_material_resize(), BKE_id_materials_copy(), BKE_object_material_count_eval(), BKE_object_material_from_eval_data(), BKE_object_material_get_eval(), BKE_object_materials_test(), BKE_objects_materials_test_all(), ED_object_add_type_with_obdata(), and mesh_separate_material_assign_mat_nr().
Definition at line 583 of file material.c.
References BKE_id_material_array_p(), BKE_id_material_len_p(), BKE_objects_materials_test_all(), DEG_id_tag_update(), DEG_relations_tag_update(), ID_RECALC_COPY_ON_WRITE, id_us_min(), material_data_index_remove_id(), MEM_freeN, MEM_reallocN, NULL, and ret.
Definition at line 528 of file material.c.
References BKE_id_material_array_p(), BKE_id_material_len_p(), DEG_id_tag_update(), DEG_relations_tag_update(), ID_RECALC_COPY_ON_WRITE, id_us_min(), MEM_freeN, MEM_recallocN, and NULL.
Referenced by BKE_object_materials_test(), and mesh_separate_material_assign_mat_nr().
Definition at line 507 of file material.c.
References Freestyle::a, BKE_id_material_array_p(), BKE_id_material_len_p(), DEG_id_tag_update(), DEG_relations_tag_update(), ID_RECALC_COPY_ON_WRITE, id_us_plus(), and MEM_dupallocN.
Referenced by BKE_mesh_to_pointcloud(), and BKE_pointcloud_to_mesh().
Definition at line 289 of file material.c.
References BKE_id_new(), and ID_MA.
Referenced by blender::io::usd::USDMaterialReader::add_material(), blender::io::alembic::utils::assign_materials(), BKE_gpencil_material_add(), get_or_create_current_material(), blender::io::obj::get_or_create_material(), Freestyle::BlenderStrokeRenderer::GetStrokeShader(), new_material_exec(), and DocumentImporter::writeMaterial().
Definition at line 1871 of file material.c.
References matcopied, and matcopybuf.
Referenced by WM_init().
Definition at line 1889 of file material.c.
References BKE_material_copybuf_free(), BLI_listbase_clear(), Material::gpumaterial, matcopied, matcopybuf, Material::nodetree, ntreeCopyTree_ex(), NULL, and Material::preview.
Referenced by copy_material_exec().
Definition at line 1877 of file material.c.
References BLI_assert, bNodeTree::id, matcopied, matcopybuf, MEM_freeN, Material::nodetree, ntreeFreeLocalTree, NULL, and ID::py_instance.
Referenced by BKE_material_copybuf_copy().
Definition at line 1907 of file material.c.
References GPU_material_free(), Material::gpumaterial, id, Material::id, matcopied, matcopybuf, MEM_freeN, Material::nodetree, ntreeCopyTree_ex(), ntreeFreeEmbeddedTree(), and NULL.
Referenced by paste_material_exec().
Definition at line 2041 of file material.c.
References default_material_empty.
Referenced by workbench_object_material_get().
Definition at line 2061 of file material.c.
References default_material_gpencil.
Referenced by BKE_gpencil_material(), BKE_gpencil_material_settings(), BKE_gpencil_object_material_ensure_from_active_input_material(), and gpencil_draw_strokes().
Definition at line 2046 of file material.c.
References default_material_holdout.
Referenced by eevee_object_material_get().
Definition at line 2051 of file material.c.
References default_material_surface.
Referenced by ED_node_shader_default(), EEVEE_material_default_get(), and eevee_object_material_get().
Definition at line 2056 of file material.c.
References default_material_volume.
Referenced by ED_node_shader_default(), EEVEE_material_default_get(), eevee_object_material_get(), and EEVEE_volumes_cache_object_add().
Definition at line 2066 of file material.c.
References default_materials, ListBase::first, GPU_material_free(), and Material::gpumaterial.
Referenced by gpu_codegen_exit(), and GPU_materials_free().
Definition at line 1932 of file material.c.
References DEG_debug_print_eval(), depsgraph, GPU_material_free(), Material::gpumaterial, Material::id, material, and ID::name.
Definition at line 2090 of file material.c.
References default_materials, and material_free_data().
Referenced by WM_exit_ex().
Definition at line 2078 of file material.c.
References default_material_gpencil, default_material_holdout, default_material_surface, default_material_volume, default_materials, material_default_gpencil_init(), material_default_holdout_init(), material_default_surface_init(), material_default_volume_init(), and material_init_data().
Referenced by main().
void BKE_object_material_array_assign | ( | struct Main * | bmain, |
struct Object * | ob, | ||
struct Material *** | matar, | ||
int | totcol, | ||
bool | to_object_only | ||
) |
Definition at line 1173 of file material.c.
References Object::actcol, BKE_MAT_ASSIGN_OBJECT, BKE_MAT_ASSIGN_USERPREF, BKE_object_material_assign(), BKE_object_material_slot_remove(), Object::matbits, and Object::totcol.
Referenced by material_slot_copy_exec(), mesh_separate_arrays(), and mesh_separate_tagged().
Definition at line 311 of file material.c.
References curves, Object::data, ELEM, Curve::mat, bGPdata::mat, Mesh::mat, MetaBall::mat, PointCloud::mat, Volume::mat, NULL, OB_CURVES, OB_CURVES_LEGACY, OB_FONT, OB_GPENCIL, OB_MBALL, OB_MESH, OB_POINTCLOUD, OB_SURF, OB_VOLUME, and Object::type.
Referenced by BKE_object_duplicate(), BKE_object_material_get_p(), BKE_object_material_remap(), BKE_object_material_slot_find_index(), BKE_object_material_slot_remove(), blender::deg::DepsgraphNodeBuilder::build_object_data(), blender::deg::DepsgraphRelationBuilder::build_object_data(), make_local_exec(), material_slot_copy_exec(), mesh_separate_arrays(), mesh_separate_tagged(), object_material_assign(), preview_prepare_scene(), and similar_face_select_exec().
void BKE_object_material_assign | ( | struct Main * | bmain, |
struct Object * | ob, | ||
struct Material * | ma, | ||
short | act, | ||
int | assign_type | ||
) |
Definition at line 1047 of file material.c.
References object_material_assign().
Referenced by MeshImporter::assign_material_to_geom(), BKE_gpencil_object_material_ensure(), BKE_gpencil_object_material_ensure_from_brush(), BKE_gpencil_object_material_new(), BKE_object_material_array_assign(), BKE_object_material_slot_add(), drop_named_material_invoke(), get_or_create_current_material(), gpencil_bake_grease_pencil_animation_exec(), gpencil_material_to_vertex_exec(), make_links_data_exec(), material_drop_invoke(), single_mat_users(), and ui_drop_material_exec().
void BKE_object_material_assign_single_obdata | ( | struct Main * | bmain, |
struct Object * | ob, | ||
struct Material * | ma, | ||
short | act | ||
) |
Similar to BKE_object_material_assign with BKE_MAT_ASSIGN_OBDATA type, but does not scan whole Main for other usages of the same obdata. Only use in cases where you know that the object's obdata is only used by this one object.
Definition at line 1052 of file material.c.
References BKE_MAT_ASSIGN_OBDATA, and object_material_assign().
Referenced by utils::assign_materials(), and blender::io::alembic::utils::assign_materials().
int BKE_object_material_count_eval | ( | struct Object * | ob | ) |
Definition at line 746 of file material.c.
References BKE_id_material_len_p(), BLI_assert, Object::data, DEG_is_evaluated_object(), get_evaluated_object_data_with_materials(), NULL, OB_EMPTY, and Object::type.
Referenced by gpencil_material_pool_create(), and gpencil_object_cache_add().
void BKE_object_material_from_eval_data | ( | struct Main * | bmain, |
struct Object * | ob_orig, | ||
const struct ID * | data_eval | ||
) |
Copy materials from evaluated geometry to the original geometry of an object.
Referenced by modifier_apply_obdata(), and object_convert_exec().
Definition at line 687 of file material.c.
References BKE_object_material_get_p(), and NULL.
Referenced by InstanceWriter::add_material_bindings(), animdata_filter_ds_materials(), bake_object_check(), bc_has_animations(), BKE_gpencil_convert_mesh(), BKE_gpencil_material(), BKE_gpencil_material_find_index_by_name_prefix(), BKE_gpencil_material_settings(), BKE_gpencil_object_material_ensure_by_name(), BKE_gpencil_object_material_ensure_from_active_input_material(), BKE_gpencil_object_material_ensure_from_brush(), BKE_gpencil_object_material_from_brush_get(), BKE_gpencil_object_material_index_get(), BKE_gpencil_object_material_index_get_by_name(), BKE_object_material_remap_calc(), BKE_texpaint_slots_refresh_object(), buttons_context_path_material(), GeometryExporter::create_mesh_primitive_list(), ED_gpencil_material_enum_itemf(), ED_mesh_join_objects_exec(), ED_object_assign_active_image(), ED_object_get_active_image(), ED_object_ot_drop_named_material_tooltip(), ED_object_texture_paint_mode_enter_ex(), ED_paint_proj_mesh_data_check(), AnimationExporter::export_curve_animation(), eyedropper_add_material(), blender::bke::paint::canvas::get_active_slot(), blender::ed::sculpt_paint::canvas::get_active_slot(), BCAnimationCurve::get_animation_name(), get_automasking_strokes_list(), blender::ed::space_node::get_context_path_node_shader(), get_default_texture_layer_name_for_object(), get_or_create_current_material(), gpencil_bake_grease_pencil_animation_exec(), gpencil_check_same_material_color(), gpencil_fill_invoke(), gpencil_layer_duplicate_object_exec(), gpencil_material_find_index_by_name(), gpencil_material_lock_unsused_exec(), gpencil_materials_copy_to_object_exec(), gpencil_modifier_masking_panel_draw(), gpencil_strokes_copy_exec(), imapaint_pick_uv(), Freestyle::BlenderFileLoader::insertShapeNode(), join_mesh_single(), make_links_data_exec(), material_slot_assign_exec(), material_slot_de_select(), mesh_new_from_mball_object(), object_frame_has_keyframe(), object_select_all_by_material(), object_select_linked_exec(), ForEachMaterialFunctor< Functor >::operator()(), paint_sample_color(), proj_paint_state_mesh_eval_init(), psys_get_particle_on_path(), psys_thread_context_init(), shader_get_from_context(), single_mat_users(), texture_paint_add_texture_paint_slot_invoke(), and AnimationImporter::translate_Animations().
On evaluated objects the number of materials on an object and its data might go out of sync. This is because during evaluation materials can be added/removed on the object data.
For rendering or exporting we generally use the materials on the object data. However, some material indices might be overwritten by the object.
Definition at line 707 of file material.c.
References BKE_id_material_array_p(), BKE_id_material_len_p(), BLI_assert, clamp_i(), data, DEG_is_evaluated_object(), get_evaluated_object_data_with_materials(), Object::mat, Object::matbits, material, materials_data, NULL, and Object::totcol.
Referenced by EEVEE_cryptomatte_cache_populate(), EEVEE_cryptomatte_object_curves_cache_populate(), EEVEE_cryptomatte_particle_hair_cache_populate(), eevee_object_material_get(), EEVEE_volumes_cache_object_add(), blender::io::obj::OBJMesh::get_object_material(), lineart_identify_mlooptri_feature_edges(), lineart_load_tri_task(), overlay_gpencil_draw_stroke_color_name(), OVERLAY_particle_cache_populate(), paint_object_is_rendered_transparent(), workbench_object_material_get(), and workbench_volume_material_color().
Definition at line 644 of file material.c.
References BKE_object_material_array_p(), BKE_object_material_len_p(), clamp_i(), Object::mat, Object::matbits, NULL, and Object::totcol.
Referenced by BKE_object_material_get(), and new_material_exec().
short* BKE_object_material_len_p | ( | struct Object * | ob | ) |
Definition at line 344 of file material.c.
References curves, Object::data, ELEM, NULL, OB_CURVES, OB_CURVES_LEGACY, OB_FONT, OB_GPENCIL, OB_MBALL, OB_MESH, OB_POINTCLOUD, OB_SURF, OB_VOLUME, Curve::totcol, bGPdata::totcol, Mesh::totcol, MetaBall::totcol, PointCloud::totcol, Volume::totcol, and Object::type.
Referenced by BKE_gpencil_merge_materials(), BKE_gpencil_merge_materials_table_get(), BKE_gpencil_object_material_index_get(), BKE_gpencil_object_material_index_get_by_name(), BKE_object_material_get_p(), BKE_object_material_remap(), BKE_object_material_slot_find_index(), BKE_object_material_slot_remove(), blender::deg::DepsgraphNodeBuilder::build_object_data(), blender::deg::DepsgraphRelationBuilder::build_object_data(), ED_gpencil_join_objects_exec(), eyedropper_add_material(), gpencil_active_material_poll(), gpencil_lock_layer_exec(), gpencil_material_hide_exec(), gpencil_material_isolate_exec(), gpencil_material_lock_all_exec(), gpencil_material_lock_unsused_exec(), gpencil_material_reveal_exec(), gpencil_material_to_vertex_exec(), gpencil_material_unlock_all_exec(), gpencil_materials_copy_to_object_poll(), gpencil_stroke_merge_material_exec(), material_slot_copy_exec(), mesh_separate_arrays(), mesh_separate_tagged(), and object_material_assign().
Definition at line 1060 of file material.c.
References BKE_curve_material_remap(), BKE_gpencil_material_remap(), BKE_mesh_material_remap(), BKE_object_material_array_p(), BKE_object_material_len_p(), BLI_array_permute, BLI_assert, Object::data, ELEM, Object::mat, Object::matbits, NULL, OB_CURVES_LEGACY, OB_FONT, OB_GPENCIL, OB_MESH, OB_SURF, Object::totcol, and Object::type.
Referenced by material_slot_move_exec().
void BKE_object_material_remap_calc | ( | struct Object * | ob_dst, |
struct Object * | ob_src, | ||
short * | remap_src_to_dst | ||
) |
Calculate a material remapping from ob_src to ob_dst.
remap_src_to_dst | An array the size of ob_src->totcol where index values are filled in which map to ob_dst materials. |
Definition at line 1090 of file material.c.
References BKE_object_material_get(), BLI_ghash_free(), BLI_ghash_lookup_p(), BLI_ghash_ptr_new_ex(), BLI_ghash_reinsert(), NULL, POINTER_AS_INT, POINTER_FROM_INT, and Object::totcol.
Referenced by BMD_mesh_intersection().
void BKE_object_material_resize | ( | struct Main * | bmain, |
struct Object * | ob, | ||
short | totcol, | ||
bool | do_id_user | ||
) |
Definition at line 819 of file material.c.
References Object::actcol, DEG_id_tag_update(), DEG_relations_tag_update(), Object::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, id_us_min(), Object::mat, Object::matbits, MEM_callocN, MEM_freeN, NULL, and Object::totcol.
Referenced by BKE_object_materials_test(), BKE_objects_materials_test_all(), and mesh_separate_material_assign_mat_nr().
Definition at line 1232 of file material.c.
References Object::actcol, BKE_MAT_ASSIGN_USERPREF, BKE_object_material_assign(), MAXMAT, NULL, and Object::totcol.
Referenced by BKE_gpencil_object_material_ensure(), BKE_gpencil_object_material_ensure_from_brush(), BKE_gpencil_object_material_new(), gpencil_bake_grease_pencil_animation_exec(), gpencil_material_to_vertex_exec(), material_slot_add_exec(), and new_material_exec().
Definition at line 1205 of file material.c.
References Freestyle::a, BKE_object_material_array_p(), BKE_object_material_len_p(), and NULL.
Referenced by gpencil_init_colors().
Definition at line 1248 of file material.c.
References Freestyle::a, Object::actcol, BKE_displist_free(), BKE_gpencil_material_index_reassign(), BKE_object_material_array_p(), BKE_object_material_len_p(), CLOG_ERROR, Object_Runtime::curve_cache, Object::data, CurveCache::disp, ELEM, ListBase::first, Material::id, id_us_min(), LOG, material_data_index_remove_id(), MEM_freeN, NULL, OB_CURVES_LEGACY, OB_FONT, OB_GPENCIL, OB_MESH, OB_SURF, Main::objects, Object::runtime, Object::totcol, and Object::type.
Referenced by BKE_gpencil_convert_curve(), BKE_object_material_array_assign(), gpencil_stroke_separate_exec(), material_slot_remove_exec(), material_slot_remove_unused_exec(), and object_convert_exec().
Definition at line 452 of file material.c.
References BKE_curve_material_index_used(), BKE_gpencil_material_index_used(), BKE_mesh_material_index_used(), BKE_object_supports_material_slots(), GS, ID_CU_LEGACY, ID_GD, ID_MB, ID_ME, LISTBASE_FOREACH, ID::name, NULL, OB_DATA_SUPPORT_ID, and Object::particlesystem.
Referenced by BKE_gpencil_convert_curve(), gpencil_stroke_separate_exec(), material_slot_remove_unused_exec(), and object_convert_exec().
Definition at line 864 of file material.c.
References BKE_id_material_len_p(), BKE_id_material_resize(), BKE_object_material_resize(), id, Object::id, LIB_TAG_MISSING, NULL, ID::tag, and Object::totcol.
Referenced by BKE_mesh_assign_object(), BKE_object_material_from_eval_data(), ED_object_add_type_with_obdata(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), libblock_remap_data_postprocess_obdata_relink(), loose_data_instantiate_obdata_process(), make_links_data_exec(), object_blend_read_lib(), object_convert_exec(), object_material_assign(), and placeholders_ensure_valid().
Definition at line 886 of file material.c.
References BKE_id_material_len_p(), BKE_main_lock(), BKE_main_unlock(), BKE_object_material_resize(), Object::data, ListBase::first, Object::id, ID::next, NULL, and Main::objects.
Referenced by BKE_id_material_append(), BKE_id_material_assign(), BKE_id_material_clear(), BKE_id_material_pop(), ED_mesh_join_objects_exec(), and object_material_assign().
Definition at line 1599 of file material.c.
References Material::nodetree, ntree_foreach_texnode_recursive(), NULL, PAINT_SLOT_COLOR_ATTRIBUTE, PAINT_SLOT_IMAGE, FindTexPaintNodeData::r_node, FindTexPaintNodeData::slot, texpaint_slot_node_find_cb(), and Material::texpaintslot.
void BKE_texpaint_slot_refresh_cache | ( | struct Scene * | scene, |
struct Material * | ma, | ||
const struct Object * | ob | ||
) |
Definition at line 1501 of file material.c.
References FillTexPaintSlotsData::active_node, count, count_texture_nodes_recursive(), DEG_id_tag_update(), fill_texpaint_slots_recursive(), Material::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_SHADING, IMAGEPAINT_MODE_IMAGE, ToolSettings::imapaint, FillTexPaintSlotsData::ma, material_paint_slot_filter(), MEM_callocN, MEM_SAFE_FREE, ImagePaintSettings::mode, nodeGetActivePaintCanvas(), Material::nodetree, NULL, FillTexPaintSlotsData::ob, Material::paint_active_slot, Material::paint_clone_slot, scene, Material::texpaintslot, Scene::toolsettings, and Material::tot_slots.
Referenced by BKE_texpaint_slots_refresh_object(), ED_paint_proj_mesh_data_check(), paint_sample_color(), and proj_paint_add_slot().
Definition at line 1564 of file material.c.
References BKE_object_material_get(), BKE_texpaint_slot_refresh_cache(), FillTexPaintSlotsData::ma, FillTexPaintSlotsData::ob, scene, and Object::totcol.
Referenced by ED_editors_init_for_undo(), ED_object_texture_paint_mode_enter_ex(), scene_changed(), and sculpt_update_object().
r_col | current value. |
col | new value. |
fac | Zero for is no change. |
Definition at line 1611 of file material.c.
References col, fabsf, hsv_to_rgb(), MA_RAMP_ADD, MA_RAMP_BLEND, MA_RAMP_BURN, MA_RAMP_COLOR, MA_RAMP_DARK, MA_RAMP_DIFF, MA_RAMP_DIV, MA_RAMP_DODGE, MA_RAMP_HUE, MA_RAMP_LIGHT, MA_RAMP_LINEAR, MA_RAMP_MULT, MA_RAMP_OVERLAY, MA_RAMP_SAT, MA_RAMP_SCREEN, MA_RAMP_SOFT, MA_RAMP_SUB, MA_RAMP_VAL, min_ff(), rgb_to_hsv(), and type.
Referenced by blender::nodes::node_shader_mix_rgb_cc::MixRGBFunction::call(), colorfn(), do_proc(), and Freestyle_blendRamp().