Blender V2.61 - r43446
|
#include <string.h>
#include <math.h>
#include <stddef.h>
#include "MEM_guardedalloc.h"
#include "DNA_curve_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_customdata_types.h"
#include "DNA_ID.h"
#include "DNA_meta_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "BLI_bpath.h"
#include "BLI_string.h"
#include "BKE_animsys.h"
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_icons.h"
#include "BKE_image.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_node.h"
#include "BKE_curve.h"
#include "GPU_material.h"
Go to the source code of this file.
Defines | |
#define | GS(a) (*((short *)(a))) |
#define | MAT_BGE_DISPUTED -99999 |
Functions | |
void | init_def_material (void) |
void | free_material (Material *ma) |
void | init_material (Material *ma) |
Material * | add_material (const char *name) |
Material * | copy_material (Material *ma) |
Material * | localize_material (Material *ma) |
static void | extern_local_material (Material *ma) |
void | make_local_material (Material *ma) |
void | extern_local_matarar (struct Material **matar, short totcol) |
Material *** | give_matarar (Object *ob) |
short * | give_totcolp (Object *ob) |
Material *** | give_matarar_id (ID *id) |
short * | give_totcolp_id (ID *id) |
static void | data_delete_material_index_id (ID *id, short index) |
void | material_append_id (ID *id, Material *ma) |
Material * | material_pop_id (ID *id, int index_i, int remove_material_slot) |
Material * | give_current_material (Object *ob, short act) |
ID * | material_from (Object *ob, short act) |
Material * | give_node_material (Material *ma) |
void | resize_object_material (Object *ob, const short totcol) |
void | test_object_materials (ID *id) |
void | assign_material_id (ID *id, Material *ma, short act) |
void | assign_material (Object *ob, Material *ma, short act) |
void | assign_matarar (struct Object *ob, struct Material ***matar, short totcol) |
short | find_material_index (Object *ob, Material *ma) |
int | object_add_material_slot (Object *ob) |
static void | do_init_render_material (Material *ma, int r_mode, float *amb) |
static void | init_render_nodetree (bNodeTree *ntree, Material *basemat, int r_mode, float *amb) |
void | init_render_material (Material *mat, int r_mode, float *amb) |
void | init_render_materials (Main *bmain, int r_mode, float *amb) |
void | end_render_material (Material *mat) |
void | end_render_materials (Main *bmain) |
static int | material_in_nodetree (bNodeTree *ntree, Material *mat) |
int | material_in_material (Material *parmat, Material *mat) |
void | automatname (Material *ma) |
int | object_remove_material_slot (Object *ob) |
void | ramp_blend (int type, float r_col[3], const float fac, const float col[3]) |
void | clear_matcopybuf (void) |
void | free_matcopybuf (void) |
void | copy_matcopybuf (Material *ma) |
void | paste_matcopybuf (Material *ma) |
static int | encode_tfaceflag (MTFace *tf, int convertall) |
static void | decode_tfaceflag (Material *ma, int flag, int convertall) |
static int | check_tfaceneedmaterial (int flag) |
static int | integer_getdigits (int number) |
static void | calculate_tface_materialname (char *matname, char *newname, int flag) |
static short | mesh_getmaterialnumber (Mesh *me, Material *ma) |
static short | mesh_addmaterial (Mesh *me, Material *ma) |
static void | set_facetexture_flags (Material *ma, Image *image) |
static short | convert_tfacenomaterial (Main *main, Mesh *me, MTFace *tf, int flag) |
static void | convert_tfacematerial (Main *main, Material *ma) |
int | do_version_tface (Main *main, int fileload) |
Variables | |
Material | defmaterial |
static char | colname_array [125][20] |
static Material | matcopybuf |
static short | matcopied = 0 |
Definition in file material.c.
#define GS | ( | a | ) | (*((short *)(a))) |
Definition at line 673 of file material.c.
Referenced by data_delete_material_index_id(), give_matarar_id(), give_totcolp_id(), init_render_nodetree(), and material_in_nodetree().
#define MAT_BGE_DISPUTED -99999 |
Definition at line 1779 of file material.c.
Referenced by do_version_tface().
Material* add_material | ( | const char * | name | ) | [read] |
Definition at line 202 of file material.c.
References alloc_libblock(), G, ID_MA, and init_material().
Referenced by convert_tfacenomaterial(), new_material_exec(), and DocumentImporter::writeMaterial().
Definition at line 838 of file material.c.
References Object::actcol, assign_material(), i, object_remove_material_slot(), and Object::totcol.
Referenced by material_slot_copy_exec(), and mesh_separate_selected().
Definition at line 767 of file material.c.
References Object::actcol, BLI_assert, Object::data, UserDef::flag, give_matarar(), give_totcolp(), Material::id, Object::id, id_us_plus(), ID::lib, Object::mat, Object::matbits, MAXMAT, MEM_callocN(), MEM_freeN(), NULL, test_object_materials(), Object::totcol, U, ID::us, and USER_MAT_ON_OB.
Referenced by assign_matarar(), MeshImporter::assign_material_to_geom(), drop_named_material_invoke(), make_links_data_exec(), NewBooleanMesh(), object_add_material_slot(), and single_mat_users().
Definition at line 725 of file material.c.
References BLI_assert, give_matarar_id(), give_totcolp_id(), Material::id, id_us_plus(), ID::lib, MAXMAT, MEM_callocN(), MEM_freeN(), NULL, test_object_materials(), and ID::us.
void automatname | ( | Material * | ma | ) |
Definition at line 1084 of file material.c.
References Material::b, colname_array, Material::g, G, g, MA_SHLESS, Material::mode, new_id(), NULL, Material::r, and Material::ref.
static void calculate_tface_materialname | ( | char * | matname, |
char * | newname, | ||
int | flag | ||
) | [static] |
Definition at line 1610 of file material.c.
References BLI_snprintf(), integer_getdigits(), and MAX_ID_NAME.
Referenced by convert_tfacematerial().
static int check_tfaceneedmaterial | ( | int | flag | ) | [static] |
Definition at line 1567 of file material.c.
References TF_ALPHA, TF_DYNAMIC, TF_LIGHT, TF_OBCOL, TF_SHAREDCOL, TF_SHAREDVERT, and TF_TEX.
Referenced by do_version_tface().
void clear_matcopybuf | ( | void | ) |
Definition at line 1702 of file material.c.
References BLI_findstring(), calculate_tface_materialname(), CD_MTFACE, copy_material(), CustomData_get_active_layer_index(), CustomDataLayer::data, decode_tfaceflag(), encode_tfaceflag(), Mesh::fdata, ListBase::first, Mesh::id, Material::id, id_us_min(), if(), CustomData::layers, Main::mat, Mesh::mat, MFace::mat_nr, material_pop_id(), MAX_ID_NAME, Main::mesh, mesh_addmaterial(), mesh_getmaterialnumber(), Mesh::mface, ID::name, ID::next, NULL, set_facetexture_flags(), Mesh::totcol, and MTFace::tpage.
Referenced by do_version_tface().
Definition at line 1658 of file material.c.
References add_material(), BLI_findstring(), BLI_snprintf(), decode_tfaceflag(), GameSettings::flag, Material::game, Mesh::id, id_us_min(), integer_getdigits(), Main::mat, MAX_ID_NAME, mesh_addmaterial(), mesh_getmaterialnumber(), MTFace::mode, ID::name, set_facetexture_flags(), TF_CONVERTED, and MTFace::tpage.
Referenced by do_version_tface().
void copy_matcopybuf | ( | Material * | ma | ) |
Definition at line 1434 of file material.c.
References ListBase::first, free_matcopybuf(), Material::gpumaterial, ListBase::last, matcopied, MAX_MTEX, MEM_dupallocN(), Material::mtex, Material::nodetree, ntreeCopyTree(), NULL, Material::preview, Material::ramp_col, and Material::ramp_spec.
Referenced by copy_material_exec().
Definition at line 214 of file material.c.
References BKE_previewimg_copy(), copy_libblock(), ListBase::first, Material::gpumaterial, Material::group, Material::id, id_lib_extern(), id_us_plus(), ListBase::last, MAX_MTEX, MEM_dupallocN(), MEM_mallocN(), Material::mtex, Material::nodetree, ntreeCopyTree(), NULL, Material::preview, Material::ramp_col, Material::ramp_spec, and MTex::tex.
Referenced by convert_tfacematerial(), KX_BlenderSceneConverter::ConvertMeshSpecial(), id_copy(), make_local_material(), new_id_matar(), new_material_exec(), object_add_duplicate_internal(), and single_mat_users().
static void data_delete_material_index_id | ( | ID * | id, |
short | index | ||
) | [static] |
Definition at line 526 of file material.c.
References curve_delete_material_index(), GS, ID_CU, ID_MB, ID_ME, mesh_delete_material_index(), and ID::name.
Referenced by material_pop_id(), and object_remove_material_slot().
static void decode_tfaceflag | ( | Material * | ma, |
int | flag, | ||
int | convertall | ||
) | [static] |
Definition at line 1530 of file material.c.
References ELEM, GameSettings::flag, Material::game, GEMAT_ADD, GEMAT_ALPHA, GEMAT_ALPHA_SORT, GEMAT_BACKCULL, GEMAT_BILLBOARD, GEMAT_CLIP, GEMAT_HALO, GEMAT_INVISIBLE, GEMAT_NOPHYSICS, GEMAT_SHADOW, GEMAT_TEXT, MA_OBCOLOR, Material::shade_flag, TF_ADD, TF_ALPHA, TF_ALPHASORT, TF_BILLBOARD, TF_BILLBOARD2, TF_BMFONT, TF_CLIP, TF_DYNAMIC, TF_INVISIBLE, TF_OBCOL, TF_SHADOW, and TF_TWOSIDE.
Referenced by convert_tfacematerial(), convert_tfacenomaterial(), and do_version_tface().
static void do_init_render_material | ( | Material * | ma, |
int | r_mode, | ||
float * | amb | ||
) | [static] |
Definition at line 886 of file material.c.
References Material::amb, Material::ambb, Material::ambg, Material::ambr, ELEM3, Material::flarec, MA_FACETEXTURE, MA_NORMAP_TANG, MA_RAYMIRROR, MA_RAYTRANSP, MA_SHADOW_TRA, MA_SHLESS, MA_STR_SURFDIFF, MA_TRANSP, MA_VERTEXCOL, MA_VERTEXCOLP, MAP_NORM, MTex::mapto, Material::mapto, MAX_MTEX, Material::mode, Material::mode_l, Material::mtex, MTEX_3TAP_BUMP, MTEX_5TAP_BUMP, MTEX_BICUBIC_BUMP, MTEX_COMPAT_BUMP, MTEX_NSPACE_TANGENT, NEED_UV, Tex::nodetree, Material::nodetree, MTex::normapspace, ntreeShaderGetTexcoMode(), R_OSA, R_RAYTRACE, Material::septex, Material::strand_surfnor, MTex::tex, TEX_ENVMAP, TEX_IMAGE, TEX_PLUGIN, MTex::texco, Material::texco, TEXCO_GLOB, TEXCO_LAVECTOR, TEXCO_NORM, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_OSA, TEXCO_REFL, TEXCO_SPEED, TEXCO_STICKY, TEXCO_STRAND, TEXCO_STRESS, TEXCO_UV, TEXCO_VIEW, MTex::texflag, Tex::type, Tex::use_nodes, and Material::use_nodes.
Referenced by init_render_material(), init_render_materials(), and init_render_nodetree().
int do_version_tface | ( | Main * | main, |
int | fileload | ||
) |
Definition at line 1781 of file material.c.
References CD_MTFACE, check_tfaceneedmaterial(), convert_tfacematerial(), convert_tfacenomaterial(), CustomData_get_active_layer_index(), CustomDataLayer::data, decode_tfaceflag(), encode_tfaceflag(), Mesh::fdata, ListBase::first, GameSettings::flag, Material::game, GEMAT_BACKCULL, Material::id, Mesh::id, if(), CustomData::layers, ID::lib, Main::mat, Mesh::mat, MAT_BGE_DISPUTED, MFace::mat_nr, Main::mesh, Mesh::mface, MTFace::mode, ID::name, ID::next, NULL, set_facetexture_flags(), TF_CONVERTED, Mesh::totcol, and MTFace::tpage.
Referenced by convert_tface_mt(), and texface_convert_exec().
static int encode_tfaceflag | ( | MTFace * | tf, |
int | convertall | ||
) | [static] |
Definition at line 1503 of file material.c.
References MTFace::mode, TF_CONVERTED, TF_LIGHT, TF_OBCOL, TF_SHAREDCOL, TF_SHAREDVERT, TF_TEX, and MTFace::transp.
Referenced by convert_tfacematerial(), and do_version_tface().
void end_render_material | ( | Material * | mat | ) |
Definition at line 1011 of file material.c.
References bNodeTree::execdata, Material::nodetree, ntreeShaderEndExecTree(), and Material::use_nodes.
Referenced by end_render_materials(), and preview_prepare_scene().
void end_render_materials | ( | Main * | bmain | ) |
Definition at line 1019 of file material.c.
References end_render_material(), ListBase::first, Material::id, Main::mat, ID::next, and ID::us.
Referenced by RE_Database_Free().
void extern_local_matarar | ( | struct Material ** | matar, |
short | totcol | ||
) |
Definition at line 443 of file material.c.
References i, and id_lib_extern().
Referenced by expand_local_mesh(), extern_local_curve(), extern_local_mball(), and extern_local_object().
static void extern_local_material | ( | Material * | ma | ) | [static] |
Definition at line 275 of file material.c.
References i, id_lib_extern(), MAX_MTEX, Material::mtex, and MTex::tex.
Referenced by make_local_material().
Definition at line 856 of file material.c.
References give_matarar(), give_totcolp(), and NULL.
void free_matcopybuf | ( | void | ) |
Definition at line 1408 of file material.c.
References matcopied, MAX_MTEX, MEM_freeN(), Material::mtex, Material::nodetree, ntreeFreeTree(), NULL, Material::ramp_col, and Material::ramp_spec.
Referenced by copy_matcopybuf().
void free_material | ( | Material * | ma | ) |
Definition at line 80 of file material.c.
References BKE_free_animdata(), BKE_icon_delete(), BKE_previewimg_free(), GPU_material_free(), ID::icon_id, Tex::id, MAX_MTEX, MEM_freeN(), Material::mtex, ntreeFreeTree(), Material::ramp_col, Material::ramp_spec, MTex::tex, and ID::us.
Referenced by free_libblock(), RE_free_sample_material(), and shader_preview_free().
Definition at line 603 of file material.c.
References give_matarar(), give_totcolp(), Object::mat, Object::matbits, NULL, and Object::totcol.
Referenced by InstanceWriter::add_material_bindings(), add_tface_color_layer(), allow_render_dupli_instance(), animdata_filter_ds_materials(), BL_ConvertMaterialIpos(), BL_ConvertMesh(), buttons_context_path_material(), buttons_texture_users_from_context(), ConvertCSGDescriptorsToDerivedMesh(), CreateMaterialFromBlenderObject(), GeometryExporter::createPolylist(), draw_mesh_fancy(), draw_mesh_object(), draw_new_particle_system(), draw_tface__set_draw(), draw_tface__set_draw_legacy(), dynamicPaint_Modifier_apply(), dynamicPaint_updateBrushMaterials(), ED_object_assign_active_image(), ED_object_get_active_image(), get_driver_path_hack(), give_current_material_or_def(), give_current_object_texture(), give_render_material(), GPU_begin_object_materials(), AnimationExporter::hasAnimations(), image_aspect(), join_mesh_exec(), list_item_row(), make_links_data_exec(), mesh_noise_exec(), object_frame_has_keyframe(), object_select_linked_exec(), ForEachMaterialFunctor< Functor >::operator()(), AnimationExporter::operator()(), preview_prepare_scene(), psys_get_particle_on_path(), psys_threads_create(), single_mat_users(), snode_set_context(), and AnimationImporter::translate_Animations().
Definition at line 451 of file material.c.
References Object::data, ELEM3, MetaBall::mat, Curve::mat, Mesh::mat, NULL, OB_CURVE, OB_FONT, OB_MBALL, OB_MESH, OB_SURF, and Object::type.
Referenced by assign_material(), find_material_index(), give_current_material(), make_local_exec(), material_slot_copy_exec(), mesh_separate_selected(), object_add_duplicate_internal(), object_remove_material_slot(), preview_prepare_scene(), and set_dupli_tex_mat().
Definition at line 494 of file material.c.
References GS, ID_CU, ID_MB, ID_ME, ID::name, and NULL.
Referenced by assign_material_id(), material_append_id(), and material_pop_id().
Definition at line 653 of file material.c.
References bNode::id, ID_MA, nodeGetActiveID(), Material::nodetree, NULL, and Material::use_nodes.
Referenced by buttons_context(), buttons_context_path_material(), give_current_object_texture(), and list_item_row().
short* give_totcolp | ( | Object * | ob | ) |
Definition at line 472 of file material.c.
References Object::data, ELEM3, NULL, OB_CURVE, OB_FONT, OB_MBALL, OB_MESH, OB_SURF, MetaBall::totcol, Curve::totcol, Mesh::totcol, and Object::type.
Referenced by allow_render_dupli_instance(), assign_material(), dynamicPaint_doMaterialTex(), dynamicPaint_updateBrushMaterials(), find_material_index(), give_current_material(), lib_link_object(), mesh_separate_selected(), object_remove_material_slot(), and set_dupli_tex_mat().
short* give_totcolp_id | ( | ID * | id | ) |
Definition at line 510 of file material.c.
References GS, ID_CU, ID_MB, ID_ME, ID::name, and NULL.
Referenced by assign_material_id(), material_append_id(), material_pop_id(), and test_object_materials().
void init_def_material | ( | void | ) |
void init_material | ( | Material * | ma | ) |
Definition at line 111 of file material.c.
References Material::adapt_thresh_mir, Material::adapt_thresh_tra, Material::alpha, GameSettings::alpha_blend, Material::amb, Material::ang, Material::b, Material::darkness, VolumeSettings::density, VolumeSettings::density_scale, VolumeSettings::depth_cutoff, Material::dist_mir, VolumeSettings::emission, VolumeSettings::emission_col, GameSettings::face_orientation, Material::fadeto_mir, GameSettings::flag, Material::flareboost, Material::flarec, Material::flaresize, Material::fresnel_mir, Material::fresnel_mir_i, Material::fresnel_tra, Material::fresnel_tra_i, Material::friction, Material::g, Material::game, GEMAT_BACKCULL, Material::gloss_mir, Material::gloss_tra, Material::har, Material::hasize, Material::linec, MA_APPROX_OCCLUSION, MA_RAYBIAS, MA_RAYMIR_FADETOSKY, MA_SHADBUF, MA_SHADOW, MA_SPHERE, MA_TANGENT_STR, MA_TRACEBLE, MA_VOL_PRECACHESHADING, MA_VOL_SHADE_SHADED, MA_VOL_STEP_RANDOMIZED, MA_ZTRANSP, Material::mirb, Material::mirg, Material::mirr, Material::mode, VolumeSettings::ms_diff, VolumeSettings::ms_intensity, VolumeSettings::ms_spread, NULL, Material::param, Material::pr_lamp, Material::pr_type, VolumeSettings::precache_resolution, Material::preview, Material::r, Material::rampfac_col, Material::rampfac_spec, Material::ray_depth, Material::ray_depth_tra, Material::ref, VolumeSettings::reflection, VolumeSettings::reflection_col, Material::refrac, Material::ringc, Material::rms, Material::roughness, Material::samp_gloss_mir, Material::samp_gloss_tra, VolumeSettings::scattering, Material::seed2, Material::shad_alpha, Material::shade_flag, VolumeSettings::shade_type, VolumeSettings::shadeflag, Material::spec, Material::specb, Material::specg, Material::specr, Material::spectra, Material::sss_back, Material::sss_col, Material::sss_colfac, Material::sss_error, Material::sss_front, Material::sss_ior, Material::sss_radius, Material::sss_scale, Material::sss_texfac, Material::starc, VolumeSettings::stepsize, VolumeSettings::stepsize_type, Material::strand_end, Material::strand_sta, Material::subsize, VolumeSettings::transmission_col, Material::tx_falloff, Material::tx_limit, and Material::vol.
Referenced by add_material(), and init_def_material().
void init_render_material | ( | Material * | mat, |
int | r_mode, | ||
float * | amb | ||
) |
Definition at line 972 of file material.c.
References do_init_render_material(), bNodeTree::execdata, init_render_nodetree(), Material::nodetree, ntreeShaderBeginExecTree(), and Material::use_nodes.
Referenced by init_render_materials(), and preview_prepare_scene().
void init_render_materials | ( | Main * | bmain, |
int | r_mode, | ||
float * | amb | ||
) |
Definition at line 985 of file material.c.
References do_init_render_material(), ListBase::first, Material::flag, Material::id, init_render_material(), MA_IS_USED, Material::mapto, Main::mat, ID::next, Material::texco, and ID::us.
Referenced by RE_Database_Baking(), and RE_Database_FromScene().
static void init_render_nodetree | ( | bNodeTree * | ntree, |
Material * | basemat, | ||
int | r_mode, | ||
float * | amb | ||
) | [static] |
Definition at line 952 of file material.c.
References do_init_render_material(), ListBase::first, GS, bNode::id, ID_MA, MA_RAYTRANSP, MA_TRANSP, MA_ZTRANSP, Material::mode_l, ID::name, bNode::next, NODE_GROUP, bNodeTree::nodes, Material::texco, and bNode::type.
Referenced by init_render_material().
static int integer_getdigits | ( | int | number | ) | [static] |
Definition at line 1598 of file material.c.
References i.
Referenced by calculate_tface_materialname(), and convert_tfacenomaterial().
Definition at line 246 of file material.c.
References BLI_remlink(), copy_libblock(), ListBase::first, G, Material::gpumaterial, Material::id, ListBase::last, MAX_MTEX, MEM_dupallocN(), MEM_mallocN(), Material::mtex, Material::nodetree, ntreeLocalize(), NULL, Material::preview, Material::ramp_col, and Material::ramp_spec.
Referenced by preview_prepare_scene(), and RE_init_sample_material().
void make_local_material | ( | Material * | ma | ) |
Definition at line 283 of file material.c.
References BKE_id_lib_local_paths(), copy_material(), Main::curve, extern_local_material(), FALSE, ListBase::first, G, MetaBall::id, Material::id, Mesh::id, Object::id, Curve::id, id_clear_lib_data(), ID::lib, Object::mat, Mesh::mat, Curve::mat, MetaBall::mat, Main::mball, Main::mesh, ID::next, NULL, Main::object, Curve::totcol, Object::totcol, Mesh::totcol, MetaBall::totcol, TRUE, and ID::us.
Referenced by id_make_local().
Definition at line 541 of file material.c.
References give_matarar_id(), give_totcolp_id(), id_us_plus(), MEM_callocN(), MEM_freeN(), and test_object_materials().
Referenced by mesh_addmaterial().
Definition at line 641 of file material.c.
References Object::data, Object::matbits, NULL, and Object::totcol.
Definition at line 1044 of file material.c.
References material_in_nodetree(), Material::nodetree, and Material::use_nodes.
Referenced by zbuffer_sss().
Definition at line 1027 of file material.c.
References ListBase::first, GS, bNode::id, ID_MA, ID::name, bNode::next, NODE_GROUP, bNodeTree::nodes, and bNode::type.
Referenced by material_in_material().
Definition at line 558 of file material.c.
References data_delete_material_index_id(), give_matarar_id(), give_totcolp_id(), id_us_min(), MEM_callocN(), MEM_freeN(), NULL, and test_object_materials().
Referenced by convert_tfacematerial().
Definition at line 1636 of file material.c.
References Mesh::id, Material::id, id_us_plus(), Mesh::mat, material_append_id(), NULL, and Mesh::totcol.
Referenced by convert_tfacematerial(), and convert_tfacenomaterial().
Definition at line 1622 of file material.c.
References Mesh::mat, and Mesh::totcol.
Referenced by convert_tfacematerial(), and convert_tfacenomaterial().
int object_add_material_slot | ( | Object * | ob | ) |
Definition at line 876 of file material.c.
References Object::actcol, assign_material(), FALSE, MAXMAT, NULL, Object::totcol, and TRUE.
Referenced by material_slot_add_exec().
int object_remove_material_slot | ( | Object * | ob | ) |
Definition at line 1103 of file material.c.
References Object::actcol, BLI_assert, Object::data, data_delete_material_index_id(), Object::disp, ELEM4, FALSE, freedisplist(), G, give_matarar(), give_totcolp(), Object::id, Material::id, Object::mat, Object::matbits, MEM_freeN(), ID::next, NULL, OB_CURVE, OB_FONT, OB_MESH, OB_SURF, Object::totcol, TRUE, Object::type, and ID::us.
Referenced by assign_matarar(), and material_slot_remove_exec().
void paste_matcopybuf | ( | Material * | ma | ) |
Definition at line 1458 of file material.c.
References GPU_material_free(), Material::id, Tex::id, id_us_plus(), matcopied, MAX_MTEX, MEM_dupallocN(), MEM_freeN(), Material::mtex, Material::nodetree, ntreeCopyTree(), ntreeFreeTree(), Material::ramp_col, Material::ramp_spec, MTex::tex, and ID::us.
Referenced by paste_material_exec().
void ramp_blend | ( | int | type, |
float | r_col[3], | ||
const float | fac, | ||
const float | col[3] | ||
) |
Definition at line 1183 of file material.c.
References 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, and rgb_to_hsv().
Referenced by add_to_diffuse(), colorfn(), do_colorband_blend(), do_mix_rgb(), do_proc(), do_specular_ramp(), node_shader_exec_mix_rgb(), ramp_diffuse_result(), ramp_spec_result(), shadeSunView(), and texture_rgb_blend().
void resize_object_material | ( | Object * | ob, |
const short | totcol | ||
) |
Definition at line 678 of file material.c.
References Object::actcol, Object::mat, Object::matbits, MEM_callocN(), MEM_freeN(), NULL, and Object::totcol.
Referenced by lib_link_object(), and test_object_materials().
Definition at line 1646 of file material.c.
References BKE_image_has_alpha(), MA_FACETEXTURE, MA_FACETEXTURE_ALPHA, and Material::mode.
Referenced by convert_tfacematerial(), convert_tfacenomaterial(), and do_version_tface().
void test_object_materials | ( | ID * | id | ) |
Definition at line 708 of file material.c.
References Object::data, G, give_totcolp_id(), Object::id, ID::next, NULL, and resize_object_material().
Referenced by assign_material(), assign_material_id(), join_mesh_exec(), make_links_data_exec(), material_append_id(), material_pop_id(), and set_mesh().
char colname_array[125][20] [static] |
{ "Black","DarkRed","HalfRed","Red","Red", "DarkGreen","DarkOlive","Brown","Chocolate","OrangeRed", "HalfGreen","GreenOlive","DryOlive","Goldenrod","DarkOrange", "LightGreen","Chartreuse","YellowGreen","Yellow","Gold", "Green","LawnGreen","GreenYellow","LightOlive","Yellow", "DarkBlue","DarkPurple","HotPink","VioletPink","RedPink", "SlateGray","DarkGrey","PalePurple","IndianRed","Tomato", "SeaGreen","PaleGreen","GreenKhaki","LightBrown","LightSalmon", "SpringGreen","PaleGreen","MediumOlive","YellowBrown","LightGold", "LightGreen","LightGreen","LightGreen","GreenYellow","PaleYellow", "HalfBlue","DarkSky","HalfMagenta","VioletRed","DeepPink", "SteelBlue","SkyBlue","Orchid","LightHotPink","HotPink", "SeaGreen","SlateGray","MediumGrey","Burlywood","LightPink", "SpringGreen","Aquamarine","PaleGreen","Khaki","PaleOrange", "SpringGreen","SeaGreen","PaleGreen","PaleWhite","YellowWhite", "LightBlue","Purple","MediumOrchid","Magenta","Magenta", "RoyalBlue","SlateBlue","MediumOrchid","Orchid","Magenta", "DeepSkyBlue","LightSteelBlue","LightSkyBlue","Violet","LightPink", "Cyan","DarkTurquoise","SkyBlue","Grey","Snow", "Mint","Mint","Aquamarine","MintCream","Ivory", "Blue","Blue","DarkMagenta","DarkOrchid","Magenta", "SkyBlue","RoyalBlue","LightSlateBlue","MediumOrchid","Magenta", "DodgerBlue","SteelBlue","MediumPurple","PalePurple","Plum", "DeepSkyBlue","PaleBlue","LightSkyBlue","PalePurple","Thistle", "Cyan","ColdBlue","PaleTurquoise","GhostWhite","White" }
Definition at line 1056 of file material.c.
Referenced by automatname().
Definition at line 71 of file material.c.
Referenced by BL_ConvertMesh(), give_current_material_or_def(), give_render_material(), GPU_begin_object_materials(), GPU_codegen_exit(), and GPU_materials_free().
short matcopied = 0 [static] |
Definition at line 1400 of file material.c.
Referenced by clear_matcopybuf(), copy_matcopybuf(), free_matcopybuf(), and paste_matcopybuf().
Material matcopybuf [static] |
Definition at line 1399 of file material.c.