diff options
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index eb8b385bbc7..01bbd1db003 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -80,7 +80,7 @@ void init_def_material(void) /* not material itself */ void BKE_material_free(Material *ma) { - BKE_material_free_ex(ma, TRUE); + BKE_material_free_ex(ma, true); } /* not material itself */ @@ -294,7 +294,8 @@ void BKE_material_make_local(Material *ma) Mesh *me; Curve *cu; MetaBall *mb; - int a, is_local = FALSE, is_lib = FALSE; + int a; + bool is_local = false, is_lib = false; /* - only lib users: do nothing * - only local users: set flag @@ -318,8 +319,8 @@ void BKE_material_make_local(Material *ma) if (ob->mat) { for (a = 0; a < ob->totcol; a++) { if (ob->mat[a] == ma) { - if (ob->id.lib) is_lib = TRUE; - else is_local = TRUE; + if (ob->id.lib) is_lib = true; + else is_local = true; } } } @@ -331,8 +332,8 @@ void BKE_material_make_local(Material *ma) if (me->mat) { for (a = 0; a < me->totcol; a++) { if (me->mat[a] == ma) { - if (me->id.lib) is_lib = TRUE; - else is_local = TRUE; + if (me->id.lib) is_lib = true; + else is_local = true; } } } @@ -344,8 +345,8 @@ void BKE_material_make_local(Material *ma) if (cu->mat) { for (a = 0; a < cu->totcol; a++) { if (cu->mat[a] == ma) { - if (cu->id.lib) is_lib = TRUE; - else is_local = TRUE; + if (cu->id.lib) is_lib = true; + else is_local = true; } } } @@ -357,8 +358,8 @@ void BKE_material_make_local(Material *ma) if (mb->mat) { for (a = 0; a < mb->totcol; a++) { if (mb->mat[a] == ma) { - if (mb->id.lib) is_lib = TRUE; - else is_local = TRUE; + if (mb->id.lib) is_lib = true; + else is_local = true; } } } @@ -366,7 +367,7 @@ void BKE_material_make_local(Material *ma) } /* Only local users. */ - if (is_local && is_lib == FALSE) { + if (is_local && is_lib == false) { id_clear_lib_data(bmain, &ma->id); extern_local_material(ma); } @@ -944,14 +945,14 @@ short find_material_index(Object *ob, Material *ma) return 0; } -int object_add_material_slot(Object *ob) +bool object_add_material_slot(Object *ob) { - if (ob == NULL) return FALSE; - if (ob->totcol >= MAXMAT) return FALSE; + if (ob == NULL) return false; + if (ob->totcol >= MAXMAT) return false; assign_material(ob, NULL, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF); ob->actcol = ob->totcol; - return TRUE; + return true; } static void do_init_render_material(Material *ma, int r_mode, float *amb) @@ -1128,7 +1129,7 @@ static bool material_in_nodetree(bNodeTree *ntree, Material *mat) return 0; } -int material_in_material(Material *parmat, Material *mat) +bool material_in_material(Material *parmat, Material *mat) { if (parmat == mat) return 1; @@ -1196,7 +1197,7 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime) ma->id.flag &= ~LIB_DOIT; } -int object_remove_material_slot(Object *ob) +bool object_remove_material_slot(Object *ob) { Material *mao, ***matarar; Object *obt; @@ -1204,14 +1205,14 @@ int object_remove_material_slot(Object *ob) short a, actcol; if (ob == NULL || ob->totcol == 0) { - return FALSE; + return false; } /* this should never happen and used to crash */ if (ob->actcol <= 0) { printf("%s: invalid material index %d, report a bug!\n", __func__, ob->actcol); BLI_assert(0); - return FALSE; + return false; } /* take a mesh/curve/mball as starting point, remove 1 index, @@ -1280,7 +1281,7 @@ int object_remove_material_slot(Object *ob) } } - return TRUE; + return true; } @@ -1532,7 +1533,7 @@ void free_matcopybuf(void) matcopybuf.ramp_spec = NULL; if (matcopybuf.nodetree) { - ntreeFreeTree_ex(matcopybuf.nodetree, FALSE); + ntreeFreeTree_ex(matcopybuf.nodetree, false); MEM_freeN(matcopybuf.nodetree); matcopybuf.nodetree = NULL; } @@ -1558,7 +1559,7 @@ void copy_matcopybuf(Material *ma) matcopybuf.mtex[a] = MEM_dupallocN(mtex); } } - matcopybuf.nodetree = ntreeCopyTree_ex(ma->nodetree, FALSE); + matcopybuf.nodetree = ntreeCopyTree_ex(ma->nodetree, false); matcopybuf.preview = NULL; BLI_listbase_clear(&matcopybuf.gpumaterial); matcopied = 1; @@ -1611,7 +1612,7 @@ void paste_matcopybuf(Material *ma) } } - ma->nodetree = ntreeCopyTree_ex(matcopybuf.nodetree, FALSE); + ma->nodetree = ntreeCopyTree_ex(matcopybuf.nodetree, false); } |