17 #define DNA_DEPRECATED_ALLOW
103 flag_private_id_data);
246 .name_plural =
"materials",
249 .asset_type_info =
NULL,
256 .foreach_cache =
NULL,
257 .foreach_path =
NULL,
265 .blend_read_undo_preserve =
NULL,
267 .lib_override_apply_post =
NULL,
335 return &(pointcloud->
mat);
339 return &(volume->
mat);
368 return &(pointcloud->
totcol);
384 return &(((
Mesh *)
id)->mat);
386 return &(((
Curve *)
id)->mat);
390 return &(((
bGPdata *)
id)->mat);
392 return &(((
Curves *)
id)->mat);
396 return &(((
Volume *)
id)->mat);
410 return &(((
Mesh *)
id)->totcol);
412 return &(((
Curve *)
id)->totcol);
416 return &(((
bGPdata *)
id)->totcol);
418 return &(((
Curves *)
id)->totcol);
422 return &(((
Volume *)
id)->totcol);
459 if (psys->part->omat == actcol) {
464 ID *ob_data =
object->data;
469 switch (
GS(ob_data->
name)) {
515 *materials_len_p_dst = *materials_len_p_src;
516 if (*materials_len_p_src != 0) {
519 for (
int a = 0;
a < *materials_len_p_src;
a++) {
537 if (do_id_user && totcol < (*totcolp)) {
539 for (i = totcol; i < (*totcolp); i++) {
566 memcpy(mat, *matar,
sizeof(
void *) * (*totcol));
573 (*matar)[(*totcol)++] = ma;
585 short index = (short)index_i;
590 if (index >= 0 && index < (*totcol)) {
591 ret = (*matar)[index];
600 if (index + 1 != (*totcol)) {
601 memmove((*matar) + index,
602 (*matar) + (index + 1),
603 sizeof(
void *) * ((*totcol) - (index + 1)));
607 *matar =
MEM_reallocN(*matar,
sizeof(
void *) * (*totcol));
627 while ((*totcol)--) {
647 const short *totcolp;
655 if (totcolp ==
NULL || *totcolp == 0) {
660 const int slot_index =
clamp_i(act - 1, 0, *totcolp - 1);
664 if (*totcolp < ob->totcol) {
668 if (slot_index < ob->totcol && ob->
matbits && ob->
matbits[slot_index]) {
670 ma_p = &ob->
mat[slot_index];
676 if (matarar && *matarar) {
677 ma_p = &(*matarar)[slot_index];
690 return ma_p ? *ma_p :
NULL;
701 data = &editmesh_eval_final->
id;
713 const int tot_slots_data = tot_slots_data_ptr ? *tot_slots_data_ptr : 0;
715 if (tot_slots_data == 0) {
720 const int slot_index =
clamp_i(act - 1, 0, tot_slots_data - 1);
721 const int tot_slots_object = ob->
totcol;
728 if (slot_index < tot_slots_object) {
739 if (slot_index < tot_slots_data) {
755 return len_p ? *len_p : 0;
763 if (
ELEM(
NULL, materials_ptr, len_ptr)) {
768 const int slot_index = slot - 1;
769 const int old_length = *len_ptr;
771 if (slot_index >= old_length) {
773 const int new_length = slot_index + 1;
774 *materials_ptr =
MEM_reallocN(*materials_ptr,
sizeof(
void *) * new_length);
775 *len_ptr = new_length;
776 for (
int i = old_length; i < new_length; i++) {
777 (*materials_ptr)[i] =
NULL;
781 (*materials_ptr)[slot_index] =
material;
787 if (len_ptr ==
NULL) {
824 if (do_id_user && totcol < ob->totcol) {
825 for (
int i = totcol; i < ob->
totcol; i++) {
838 else if (ob->
totcol < totcol) {
839 newmatar =
MEM_callocN(
sizeof(
void *) * totcol,
"newmatar");
840 newmatbits =
MEM_callocN(
sizeof(
char) * totcol,
"newmatbits");
842 memcpy(newmatar, ob->
mat,
sizeof(
void *) * ob->
totcol);
898 if (ob->
data ==
id) {
922 if (totcolp ==
NULL || matarar ==
NULL) {
926 if (act > *totcolp) {
927 matar =
MEM_callocN(
sizeof(
void *) * act,
"matarray1");
930 memcpy(matar, *matarar,
sizeof(
void *) * (*totcolp));
939 mao = (*matarar)[act - 1];
943 (*matarar)[act - 1] = ma;
971 if (totcolp ==
NULL || matarar ==
NULL) {
975 if (act > *totcolp) {
976 matar =
MEM_callocN(
sizeof(
void *) * act,
"matarray1");
979 memcpy(matar, *matarar,
sizeof(
void *) * (*totcolp));
1005 switch (assign_type) {
1023 mao = ob->
mat[act - 1];
1027 ob->
mat[act - 1] = ma;
1031 mao = (*matarar)[act - 1];
1035 (*matarar)[act - 1] = ma;
1092 if (ob_src->
totcol == 0) {
1098 for (
int i = 0; i < ob_dst->
totcol; i++) {
1107 for (; i < ob_src->
totcol; i++) {
1108 remap_src_to_dst[i] = i;
1112 for (; i < ob_dst->
totcol; i++) {
1113 remap_src_to_dst[i] = i;
1115 for (; i < ob_src->
totcol; i++) {
1116 remap_src_to_dst[i] = 0;
1121 for (
int i = 0; i < ob_src->
totcol; i++) {
1140 ID *data_orig = ob_orig->
data;
1149 if (
ELEM(
NULL, orig_totcol, orig_mat, eval_totcol, eval_mat)) {
1154 for (
int i = 0; i < *orig_totcol; i++) {
1160 *orig_totcol = *eval_totcol;
1161 *orig_mat =
MEM_callocN(
sizeof(
void *) * (*eval_totcol), __func__);
1162 for (
int i = 0; i < *eval_totcol; i++) {
1163 Material *material_eval = (*eval_mat)[i];
1164 if (material_eval !=
NULL) {
1166 (*orig_mat)[i] = material_orig;
1177 const bool to_object_only)
1179 int actcol_orig = ob->
actcol;
1186 for (
int i = 0; i < totcol; i++) {
1198 if (actcol_orig > ob->
totcol) {
1199 actcol_orig = ob->
totcol;
1202 ob->
actcol = actcol_orig;
1217 if (totcolp ==
NULL || matarar ==
NULL) {
1221 for (
a = 0;
a < *totcolp;
a++) {
1222 if ((*matarar)[
a] == ma) {
1272 if (
ELEM(
NULL, matarar, *matarar)) {
1282 mao = (*matarar)[ob->
actcol - 1];
1287 for (
int a = ob->
actcol; a < ob->totcol;
a++) {
1288 (*matarar)[
a - 1] = (*matarar)[
a];
1292 if (*totcolp == 0) {
1297 const int actcol = ob->
actcol;
1300 if (obt->data == ob->
data) {
1302 if (actcol > obt->totcol) {
1306 mao = obt->mat[actcol - 1];
1311 for (
int a = actcol;
a < obt->totcol;
a++) {
1312 obt->mat[
a - 1] = obt->mat[
a];
1313 obt->matbits[
a - 1] = obt->matbits[
a];
1316 if (obt->actcol > obt->totcol) {
1317 obt->actcol = obt->totcol;
1320 if (obt->totcol == 0) {
1324 obt->matbits =
NULL;
1349 for (sock =
node->inputs.first; sock; sock = sock->
next) {
1402 (*((
int *)userdata))++;
1434 switch (
node->type) {
1439 slot->
interp = storage->interpolation;
1452 slot->
valid =
false;
1566 for (
int i = 1; i <
ob->
totcol + 1; i++) {
1613 float tmp, facm = 1.0f - fac;
1617 r_col[0] = facm * (r_col[0]) + fac *
col[0];
1618 r_col[1] = facm * (r_col[1]) + fac *
col[1];
1619 r_col[2] = facm * (r_col[2]) + fac *
col[2];
1622 r_col[0] += fac *
col[0];
1623 r_col[1] += fac *
col[1];
1624 r_col[2] += fac *
col[2];
1627 r_col[0] *= (facm + fac *
col[0]);
1628 r_col[1] *= (facm + fac *
col[1]);
1629 r_col[2] *= (facm + fac *
col[2]);
1632 r_col[0] = 1.0f - (facm + fac * (1.0f -
col[0])) * (1.0f - r_col[0]);
1633 r_col[1] = 1.0f - (facm + fac * (1.0f -
col[1])) * (1.0f - r_col[1]);
1634 r_col[2] = 1.0f - (facm + fac * (1.0f -
col[2])) * (1.0f - r_col[2]);
1637 if (r_col[0] < 0.5f) {
1638 r_col[0] *= (facm + 2.0f * fac *
col[0]);
1641 r_col[0] = 1.0f - (facm + 2.0f * fac * (1.0f -
col[0])) * (1.0f - r_col[0]);
1643 if (r_col[1] < 0.5f) {
1644 r_col[1] *= (facm + 2.0f * fac *
col[1]);
1647 r_col[1] = 1.0f - (facm + 2.0f * fac * (1.0f -
col[1])) * (1.0f - r_col[1]);
1649 if (r_col[2] < 0.5f) {
1650 r_col[2] *= (facm + 2.0f * fac *
col[2]);
1653 r_col[2] = 1.0f - (facm + 2.0f * fac * (1.0f -
col[2])) * (1.0f - r_col[2]);
1657 r_col[0] -= fac *
col[0];
1658 r_col[1] -= fac *
col[1];
1659 r_col[2] -= fac *
col[2];
1662 if (
col[0] != 0.0f) {
1663 r_col[0] = facm * (r_col[0]) + fac * (r_col[0]) /
col[0];
1665 if (
col[1] != 0.0f) {
1666 r_col[1] = facm * (r_col[1]) + fac * (r_col[1]) /
col[1];
1668 if (
col[2] != 0.0f) {
1669 r_col[2] = facm * (r_col[2]) + fac * (r_col[2]) /
col[2];
1673 r_col[0] = facm * (r_col[0]) + fac *
fabsf(r_col[0] -
col[0]);
1674 r_col[1] = facm * (r_col[1]) + fac *
fabsf(r_col[1] -
col[1]);
1675 r_col[2] = facm * (r_col[2]) + fac *
fabsf(r_col[2] -
col[2]);
1678 r_col[0] =
min_ff(r_col[0],
col[0]) * fac + r_col[0] * facm;
1679 r_col[1] =
min_ff(r_col[1],
col[1]) * fac + r_col[1] * facm;
1680 r_col[2] =
min_ff(r_col[2],
col[2]) * fac + r_col[2] * facm;
1684 if (tmp > r_col[0]) {
1688 if (tmp > r_col[1]) {
1692 if (tmp > r_col[2]) {
1697 if (r_col[0] != 0.0f) {
1698 tmp = 1.0f - fac *
col[0];
1702 else if ((tmp = (r_col[0]) / tmp) > 1.0f) {
1709 if (r_col[1] != 0.0f) {
1710 tmp = 1.0f - fac *
col[1];
1714 else if ((tmp = (r_col[1]) / tmp) > 1.0f) {
1721 if (r_col[2] != 0.0f) {
1722 tmp = 1.0f - fac *
col[2];
1726 else if ((tmp = (r_col[2]) / tmp) > 1.0f) {
1735 tmp = facm + fac *
col[0];
1740 else if ((tmp = (1.0f - (1.0f - (r_col[0])) / tmp)) < 0.0f) {
1743 else if (tmp > 1.0f) {
1750 tmp = facm + fac *
col[1];
1754 else if ((tmp = (1.0f - (1.0f - (r_col[1])) / tmp)) < 0.0f) {
1757 else if (tmp > 1.0f) {
1764 tmp = facm + fac *
col[2];
1768 else if ((tmp = (1.0f - (1.0f - (r_col[2])) / tmp)) < 0.0f) {
1771 else if (tmp > 1.0f) {
1780 float colH, colS, colV;
1781 float tmpr, tmpg, tmpb;
1784 rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
1785 hsv_to_rgb(colH, rS, rV, &tmpr, &tmpg, &tmpb);
1786 r_col[0] = facm * (r_col[0]) + fac * tmpr;
1787 r_col[1] = facm * (r_col[1]) + fac * tmpg;
1788 r_col[2] = facm * (r_col[2]) + fac * tmpb;
1794 float colH, colS, colV;
1795 rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
1798 hsv_to_rgb(rH, (facm * rS + fac * colS), rV, r_col + 0, r_col + 1, r_col + 2);
1804 float colH, colS, colV;
1805 rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
1807 hsv_to_rgb(rH, rS, (facm * rV + fac * colV), r_col + 0, r_col + 1, r_col + 2);
1812 float colH, colS, colV;
1813 float tmpr, tmpg, tmpb;
1816 rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
1817 hsv_to_rgb(colH, colS, rV, &tmpr, &tmpg, &tmpb);
1818 r_col[0] = facm * (r_col[0]) + fac * tmpr;
1819 r_col[1] = facm * (r_col[1]) + fac * tmpg;
1820 r_col[2] = facm * (r_col[2]) + fac * tmpb;
1825 float scr, scg, scb;
1828 scr = 1.0f - (1.0f -
col[0]) * (1.0f - r_col[0]);
1829 scg = 1.0f - (1.0f -
col[1]) * (1.0f - r_col[1]);
1830 scb = 1.0f - (1.0f -
col[2]) * (1.0f - r_col[2]);
1832 r_col[0] = facm * (r_col[0]) +
1833 fac * (((1.0f - r_col[0]) *
col[0] * (r_col[0])) + (r_col[0] * scr));
1834 r_col[1] = facm * (r_col[1]) +
1835 fac * (((1.0f - r_col[1]) *
col[1] * (r_col[1])) + (r_col[1] * scg));
1836 r_col[2] = facm * (r_col[2]) +
1837 fac * (((1.0f - r_col[2]) *
col[2] * (r_col[2])) + (r_col[2] * scb));
1841 if (
col[0] > 0.5f) {
1842 r_col[0] = r_col[0] + fac * (2.0f * (
col[0] - 0.5f));
1845 r_col[0] = r_col[0] + fac * (2.0f * (
col[0]) - 1.0f);
1847 if (
col[1] > 0.5f) {
1848 r_col[1] = r_col[1] + fac * (2.0f * (
col[1] - 0.5f));
1851 r_col[1] = r_col[1] + fac * (2.0f * (
col[1]) - 1.0f);
1853 if (
col[2] > 0.5f) {
1854 r_col[2] = r_col[2] + fac * (2.0f * (
col[2] - 0.5f));
1857 r_col[2] = r_col[2] + fac * (2.0f * (
col[2]) - 1.0f);
1958 strcpy(ma->
id.
name,
"MADefault GPencil");
1965 strcpy(ma->
id.
name,
"MADefault Surface");
1983 principled->
locx = 10.0f;
1984 principled->
locy = 300.0f;
1993 strcpy(ma->
id.
name,
"MADefault Volume");
2008 principled->
locx = 10.0f;
2009 principled->
locy = 300.0f;
2018 strcpy(ma->
id.
name,
"MADefault Holdout");
2033 holdout->
locx = 10.0f;
2034 holdout->
locy = 300.0f;
void BKE_animdata_blend_read_data(struct BlendDataReader *reader, struct AnimData *adt)
void BKE_animdata_blend_write(struct BlendWriter *writer, struct AnimData *adt)
Generic geometry attributes built on CustomData.
struct CustomDataLayer * BKE_id_attributes_color_find(const struct ID *id, const char *name)
bool BKE_curve_material_index_used(const struct Curve *cu, int index)
void BKE_curve_material_remap(struct Curve *cu, const unsigned int *remap, unsigned int remap_len)
void BKE_curve_material_index_clear(struct Curve *cu)
void BKE_curve_material_index_remove(struct Curve *cu, int index)
display list (or rather multi purpose list) stuff.
void BKE_displist_free(struct ListBase *lb)
bool BKE_gpencil_material_index_used(struct bGPdata *gpd, int index)
void BKE_gpencil_material_remap(struct bGPdata *gpd, const unsigned int *remap, unsigned int remap_len)
void BKE_gpencil_material_index_reassign(struct bGPdata *gpd, int totcol, int index)
void BKE_icon_id_delete(struct ID *id)
void BKE_previewimg_free(struct PreviewImage **prv)
void BKE_previewimg_id_copy(struct ID *new_id, const struct ID *old_id)
void BKE_previewimg_blend_read(struct BlendDataReader *reader, struct PreviewImage *prv)
void BKE_previewimg_blend_write(struct BlendWriter *writer, const struct PreviewImage *prv)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
@ LIB_ID_CREATE_NO_ALLOCATE
struct ID * BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, int flag)
void id_us_min(struct ID *id)
void id_us_plus(struct ID *id)
void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id)
void * BKE_id_new(struct Main *bmain, short type, const char *name)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(_data, _id_super, _cb_flag)
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(_data, _func_call)
void BKE_library_foreach_ID_embedded(struct LibraryForeachIDData *data, struct ID **id_pp)
void BKE_main_unlock(struct Main *bmain)
void BKE_main_lock(struct Main *bmain)
General operations, lookup, etc. for materials.
@ BKE_MAT_ASSIGN_USERPREF
@ BKE_MAT_ASSIGN_EXISTING
bool BKE_mesh_material_index_used(struct Mesh *me, short index)
void BKE_mesh_material_remap(struct Mesh *me, const unsigned int *remap, unsigned int remap_len)
void BKE_mesh_material_index_remove(struct Mesh *me, short index)
void BKE_mesh_material_index_clear(struct Mesh *me)
void ntreeBlendWrite(struct BlendWriter *writer, struct bNodeTree *ntree)
#define NODE_CUSTOM_GROUP
#define SH_NODE_BSDF_PRINCIPLED
struct bNodeTree * ntreeCopyTree_ex(const struct bNodeTree *ntree, struct Main *bmain, bool do_id_user)
struct bNode * nodeGetActivePaintCanvas(struct bNodeTree *ntree)
#define SH_NODE_OUTPUT_MATERIAL
void ntreeFreeEmbeddedTree(struct bNodeTree *ntree)
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
struct bNodeTree * ntreeAddTree(struct Main *bmain, const char *name, const char *idname)
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
#define SH_NODE_VOLUME_PRINCIPLED
#define NODE_CLASS_TEXTURE
void nodeSetActive(struct bNodeTree *ntree, struct bNode *node)
#define SH_NODE_ATTRIBUTE
General operations, lookup, etc. for blender objects.
struct Mesh * BKE_object_get_editmesh_eval_final(const struct Object *object)
bool BKE_object_supports_material_slots(struct Object *ob)
Generic array manipulation API.
#define BLI_array_permute(arr, arr_len, order)
#define BLI_assert_unreachable()
bool BLI_ghash_reinsert(GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_ptr_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void ** BLI_ghash_lookup_p(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
MINLINE float min_ff(float a, float b)
MINLINE int clamp_i(int value, int min, int max)
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b)
MINLINE void add_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define ARRAY_SET_ITEMS(...)
#define STREQLEN(a, b, n)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define BLO_read_data_address(reader, ptr_p)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_read_id_address(reader, lib, id_ptr_p)
#define BLO_expand(expander, id)
#define BLT_I18NCONTEXT_ID_MATERIAL
#define CLOG_ERROR(clg_ref,...)
struct Depsgraph Depsgraph
void DEG_debug_print_eval(struct Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
bool DEG_is_evaluated_object(const struct Object *object)
struct ID * DEG_get_original_id(struct ID *id)
ID and Library types, which are fundamental for sdna.
@ ID_RECALC_COPY_ON_WRITE
Object groups, one object can be in many groups at once.
#define DNA_struct_default_get(struct_name)
@ GP_MATERIAL_STROKE_SHOW
Object is a sort of wrapper for general info.
#define OB_DATA_SUPPORT_ID(_id_type)
#define IMAGEPAINT_MODE_IMAGE
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void GPU_material_free(struct ListBase *gpumaterial)
Read Guarded memory(de)allocation.
#define MEM_recallocN(vmemh, len)
#define MEM_reallocN(vmemh, len)
static void init_data(ModifierData *md)
struct bNodeTreeType * ntreeType_Shader
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 Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
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 SH_NODE_TEX_IMAGE
const Depsgraph * depsgraph
DEGForeachIDComponentCallback callback
void * ntreeFreeLocalTree
ccl_global KernelShaderEvalInput ccl_global float * output
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_recallocN_id)(void *vmemh, size_t len, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
bool(* ForEachTexNodeCallback)(bNode *node, void *userdata)
static void material_default_surface_init(Material *ma)
void BKE_materials_init(void)
void BKE_materials_exit(void)
static void material_default_holdout_init(Material *ma)
static void material_data_index_clear_id(ID *id)
Material * BKE_object_material_get_eval(Object *ob, short act)
static void fill_texpaint_slots_recursive(bNodeTree *nodetree, bNode *active_node, const Object *ob, Material *ma, int slot_len, ePaintSlotFilter slot_filter)
void BKE_id_material_eval_ensure_default_slot(ID *id)
static void material_blend_read_lib(BlendLibReader *reader, ID *id)
void BKE_gpencil_material_attr_init(Material *ma)
void BKE_id_material_clear(Main *bmain, ID *id)
void BKE_object_material_array_assign(Main *bmain, struct Object *ob, struct Material ***matar, int totcol, const bool to_object_only)
Material * BKE_material_default_empty(void)
void BKE_material_copybuf_copy(Main *bmain, Material *ma)
static Material matcopybuf
copy/paste buffer, if we had a proper py api that would be better
Material ** BKE_object_material_get_p(Object *ob, short act)
void BKE_object_material_remap(Object *ob, const unsigned int *remap)
void BKE_id_material_assign(Main *bmain, ID *id, Material *ma, short act)
static bool ntree_foreach_texnode_recursive(bNodeTree *nodetree, ForEachTexNodeCallback callback, void *userdata, ePaintSlotFilter slot_filter)
static Material default_material_gpencil
static void material_foreach_id(ID *id, LibraryForeachIDData *data)
short BKE_object_material_slot_find_index(Object *ob, Material *ma)
static bool count_texture_nodes_cb(bNode *UNUSED(node), void *userdata)
Material * BKE_id_material_pop(Main *bmain, ID *id, int index_i)
void BKE_object_material_from_eval_data(Main *bmain, Object *ob_orig, const ID *data_eval)
Material * BKE_gpencil_material_add(Main *bmain, const char *name)
static void material_data_index_remove_id(ID *id, short index)
Material *** BKE_object_material_array_p(Object *ob)
static Material default_material_surface
Material * BKE_gpencil_material(Object *ob, short act)
Material * BKE_material_default_gpencil(void)
static void material_blend_write(BlendWriter *writer, ID *id, const void *id_address)
short * BKE_object_material_len_p(Object *ob)
static bool texpaint_slot_node_find_cb(bNode *node, void *userdata)
void BKE_material_copybuf_paste(Main *bmain, Material *ma)
short * BKE_id_material_len_p(ID *id)
static Material default_material_empty
void BKE_id_materials_copy(Main *bmain, ID *id_src, ID *id_dst)
void BKE_object_material_assign_single_obdata(struct Main *bmain, struct Object *ob, struct Material *ma, short act)
int BKE_object_material_count_eval(Object *ob)
bool BKE_object_material_slot_add(Main *bmain, Object *ob)
static void material_free_data(ID *id)
static ID * get_evaluated_object_data_with_materials(Object *ob)
bNode * BKE_texpaint_slot_material_find_node(Material *ma, short texpaint_slot)
static Material * default_materials[]
void BKE_id_material_resize(Main *bmain, ID *id, short totcol, bool do_id_user)
Material *** BKE_id_material_array_p(ID *id)
void BKE_material_copybuf_free(void)
static void material_blend_read_expand(BlendExpander *expander, ID *id)
static Material default_material_holdout
void BKE_id_material_eval_assign(ID *id, int slot, Material *material)
MaterialGPencilStyle * BKE_gpencil_material_settings(Object *ob, short act)
Material * BKE_material_default_volume(void)
void BKE_object_materials_test(Main *bmain, Object *ob, ID *id)
void BKE_id_material_append(Main *bmain, ID *id, Material *ma)
bool BKE_object_material_slot_used(Object *object, short actcol)
static void object_material_assign(Main *bmain, Object *ob, Material *ma, short act, int assign_type, bool do_test_all)
void BKE_object_material_resize(Main *bmain, Object *ob, const short totcol, bool do_id_user)
void BKE_objects_materials_test_all(Main *bmain, ID *id)
static void material_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag)
void BKE_texpaint_slots_refresh_object(Scene *scene, struct Object *ob)
void BKE_object_material_remap_calc(Object *ob_dst, Object *ob_src, short *remap_src_to_dst)
static void material_default_volume_init(Material *ma)
void BKE_texpaint_slot_refresh_cache(Scene *scene, Material *ma, const struct Object *ob)
static void material_default_gpencil_init(Material *ma)
static void material_blend_read_data(BlendDataReader *reader, ID *id)
static ePaintSlotFilter material_paint_slot_filter(const struct Object *ob)
@ PAINT_SLOT_COLOR_ATTRIBUTE
Material * BKE_material_default_holdout(void)
Material * BKE_object_material_get(Object *ob, short act)
static int count_texture_nodes_recursive(bNodeTree *nodetree, ePaintSlotFilter slot_filter)
static void material_init_data(ID *id)
Material * BKE_material_add(Main *bmain, const char *name)
void BKE_object_material_assign(Main *bmain, Object *ob, Material *ma, short act, int assign_type)
void BKE_material_defaults_free_gpu(void)
static Material default_material_volume
static bool fill_texpaint_slots_cb(bNode *node, void *userdata)
void BKE_material_copybuf_clear(void)
void BKE_material_eval(struct Depsgraph *depsgraph, Material *material)
Material * BKE_material_default_surface(void)
bool BKE_object_material_slot_remove(Main *bmain, Object *ob)
static bNode * nodetree_uv_node_recursive(bNode *node)
void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
struct bNodeTree * nodetree
struct PreviewImage * preview
struct MaterialGPencilStyle * gp_style
struct TexPaintSlot * texpaintslot
struct BMEditMesh * edit_mesh
struct CurveCache * curve_cache
struct ToolSettings * toolsettings
struct ImageUser * image_user
struct bNodeSocket * next
struct bNodeType * typeinfo
smooth(Type::VEC3, "normal_interp") .smooth(Type materials_data[4096]