Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_data.c
| Show First 20 Lines • Show All 531 Lines • ▼ Show 20 Lines | for (bGPDframe *gpf_src = gpl_src->frames.first; gpf_src; gpf_src = gpf_src->next) { | ||||
| for (bGPDstroke *gps_src = gpf_src->strokes.first; gps_src; gps_src = gps_src->next) { | for (bGPDstroke *gps_src = gpf_src->strokes.first; gps_src; gps_src = gps_src->next) { | ||||
| /* make copy of source stroke */ | /* make copy of source stroke */ | ||||
| bGPDstroke *gps_dst = BKE_gpencil_stroke_duplicate(gps_src); | bGPDstroke *gps_dst = BKE_gpencil_stroke_duplicate(gps_src); | ||||
| /* check if material is in destination object, | /* check if material is in destination object, | ||||
| * otherwise add the slot with the material | * otherwise add the slot with the material | ||||
| */ | */ | ||||
| Material *ma_src = give_current_material(ob_src, gps_src->mat_nr + 1); | Material *ma_src = BKE_material_gpencil_get(ob_src, gps_src->mat_nr + 1); | ||||
| int idx = BKE_gpencil_object_material_ensure(bmain, ob_dst, ma_src); | int idx = BKE_gpencil_object_material_ensure(bmain, ob_dst, ma_src); | ||||
brecht: You can't assign a default material to a mesh. | |||||
brechtUnsubmitted Not Done Inline Actions*to an object. brecht: *to an object. | |||||
| /* Reassign the stroke material to the right slot in destination object. */ | /* Reassign the stroke material to the right slot in destination object. */ | ||||
| gps_dst->mat_nr = idx; | gps_dst->mat_nr = idx; | ||||
| /* add new stroke to frame */ | /* add new stroke to frame */ | ||||
| BLI_addtail(&gpf_dst->strokes, gps_dst); | BLI_addtail(&gpf_dst->strokes, gps_dst); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 864 Lines • ▼ Show 20 Lines | static int gp_stroke_change_color_exec(bContext *C, wmOperator *op) | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Material *ma = NULL; | Material *ma = NULL; | ||||
| char name[MAX_ID_NAME - 2]; | char name[MAX_ID_NAME - 2]; | ||||
| RNA_string_get(op->ptr, "material", name); | RNA_string_get(op->ptr, "material", name); | ||||
| bGPdata *gpd = ED_gpencil_data_get_active(C); | bGPdata *gpd = ED_gpencil_data_get_active(C); | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| if (name[0] == '\0') { | if (name[0] == '\0') { | ||||
| ma = give_current_material(ob, ob->actcol); | ma = BKE_material_gpencil_get(ob, ob->actcol); | ||||
| } | } | ||||
| else { | else { | ||||
| ma = (Material *)BKE_libblock_find_name(bmain, ID_MA, name); | ma = (Material *)BKE_libblock_find_name(bmain, ID_MA, name); | ||||
| if (ma == NULL) { | if (ma == NULL) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| } | } | ||||
| /* try to find slot */ | /* try to find slot */ | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | static int gp_stroke_lock_color_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| /* sanity checks */ | /* sanity checks */ | ||||
| if (ELEM(NULL, gpd)) { | if (ELEM(NULL, gpd)) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* first lock all colors */ | /* first lock all colors */ | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| Material *tmp_ma = give_current_material(ob, i + 1); | Material *tmp_ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (tmp_ma) { | if (tmp_ma) { | ||||
| tmp_ma->gp_style->flag |= GP_STYLE_COLOR_LOCKED; | tmp_ma->gp_style->flag |= GP_STYLE_COLOR_LOCKED; | ||||
| DEG_id_tag_update(&tmp_ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&tmp_ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
brechtUnsubmitted Not Done Inline ActionsYou can't do depsgraph updates for a default material. brecht: You can't do depsgraph updates for a default material. | |||||
| } | } | ||||
| } | } | ||||
| /* loop all selected strokes and unlock any color */ | /* loop all selected strokes and unlock any color */ | ||||
| for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { | for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { | ||||
| /* only editable and visible layers are considered */ | /* only editable and visible layers are considered */ | ||||
| if (gpencil_layer_is_editable(gpl) && (gpl->actframe != NULL)) { | if (gpencil_layer_is_editable(gpl) && (gpl->actframe != NULL)) { | ||||
| for (bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->prev) { | for (bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->prev) { | ||||
| /* only if selected */ | /* only if selected */ | ||||
| if (gps->flag & GP_STROKE_SELECT) { | if (gps->flag & GP_STROKE_SELECT) { | ||||
| /* skip strokes that are invalid for current view */ | /* skip strokes that are invalid for current view */ | ||||
| if (ED_gpencil_stroke_can_use(C, gps) == false) { | if (ED_gpencil_stroke_can_use(C, gps) == false) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* unlock color */ | /* unlock color */ | ||||
| Material *tmp_ma = give_current_material(ob, gps->mat_nr + 1); | Material *tmp_ma = BKE_material_gpencil_get(ob, gps->mat_nr + 1); | ||||
| tmp_ma->gp_style->flag &= ~GP_STYLE_COLOR_LOCKED; | tmp_ma->gp_style->flag &= ~GP_STYLE_COLOR_LOCKED; | ||||
| DEG_id_tag_update(&tmp_ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&tmp_ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* updates */ | /* updates */ | ||||
| ▲ Show 20 Lines • Show All 736 Lines • ▼ Show 20 Lines | if ((ob_iter->type == OB_GPENCIL) && (ob_iter != ob_active)) { | ||||
| if (ob_active->defbase.first && ob_active->actdef == 0) { | if (ob_active->defbase.first && ob_active->actdef == 0) { | ||||
| ob_active->actdef = 1; | ob_active->actdef = 1; | ||||
| } | } | ||||
| /* add missing materials reading source materials and checking in destination object */ | /* add missing materials reading source materials and checking in destination object */ | ||||
| short *totcol = give_totcolp(ob_src); | short *totcol = give_totcolp(ob_src); | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| Material *tmp_ma = give_current_material(ob_src, i + 1); | Material *tmp_ma = BKE_material_gpencil_get(ob_src, i + 1); | ||||
| BKE_gpencil_object_material_ensure(bmain, ob_dst, tmp_ma); | BKE_gpencil_object_material_ensure(bmain, ob_dst, tmp_ma); | ||||
| } | } | ||||
| /* duplicate bGPDlayers */ | /* duplicate bGPDlayers */ | ||||
| tJoinGPencil_AdtFixData afd = {0}; | tJoinGPencil_AdtFixData afd = {0}; | ||||
| afd.src_gpd = gpd_src; | afd.src_gpd = gpd_src; | ||||
| afd.tar_gpd = gpd_dst; | afd.tar_gpd = gpd_dst; | ||||
| afd.names_map = BLI_ghash_str_new("joined_gp_layers_map"); | afd.names_map = BLI_ghash_str_new("joined_gp_layers_map"); | ||||
| Show All 17 Lines | if ((ob_iter->type == OB_GPENCIL) && (ob_iter != ob_active)) { | ||||
| ED_gpencil_parent_location(depsgraph, ob_iter, gpd_src, gpl_src, diff_mat); | ED_gpencil_parent_location(depsgraph, ob_iter, gpd_src, gpl_src, diff_mat); | ||||
| invert_m4_m4(inverse_diff_mat, diff_mat); | invert_m4_m4(inverse_diff_mat, diff_mat); | ||||
| Material *ma_src = NULL; | Material *ma_src = NULL; | ||||
| for (bGPDframe *gpf = gpl_new->frames.first; gpf; gpf = gpf->next) { | for (bGPDframe *gpf = gpl_new->frames.first; gpf; gpf = gpf->next) { | ||||
| for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { | for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { | ||||
| /* Reassign material. Look old material and try to find in destination. */ | /* Reassign material. Look old material and try to find in destination. */ | ||||
| ma_src = give_current_material(ob_src, gps->mat_nr + 1); | ma_src = BKE_material_gpencil_get(ob_src, gps->mat_nr + 1); | ||||
| gps->mat_nr = BKE_gpencil_object_material_ensure(bmain, ob_dst, ma_src); | gps->mat_nr = BKE_gpencil_object_material_ensure(bmain, ob_dst, ma_src); | ||||
| bGPDspoint *pt; | bGPDspoint *pt; | ||||
| int i; | int i; | ||||
| for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { | for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { | ||||
| float mpt[3]; | float mpt[3]; | ||||
| mul_v3_m4v3(mpt, inverse_diff_mat, &pt->x); | mul_v3_m4v3(mpt, inverse_diff_mat, &pt->x); | ||||
| sub_v3_v3(mpt, offset_local); | sub_v3_v3(mpt, offset_local); | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | static int gpencil_lock_layer_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| /* first lock and hide all colors */ | /* first lock and hide all colors */ | ||||
| Material *ma = NULL; | Material *ma = NULL; | ||||
| short *totcol = give_totcolp(ob); | short *totcol = give_totcolp(ob); | ||||
| if (totcol == 0) { | if (totcol == 0) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (ma) { | if (ma) { | ||||
| gp_style = ma->gp_style; | gp_style = ma->gp_style; | ||||
| gp_style->flag |= GP_STYLE_COLOR_LOCKED; | gp_style->flag |= GP_STYLE_COLOR_LOCKED; | ||||
| gp_style->flag |= GP_STYLE_COLOR_HIDE; | gp_style->flag |= GP_STYLE_COLOR_HIDE; | ||||
| DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| /* loop all selected strokes and unlock any color used in active layer */ | /* loop all selected strokes and unlock any color used in active layer */ | ||||
| for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { | for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { | ||||
| /* only editable and visible layers are considered */ | /* only editable and visible layers are considered */ | ||||
| if (gpencil_layer_is_editable(gpl) && (gpl->actframe != NULL) && | if (gpencil_layer_is_editable(gpl) && (gpl->actframe != NULL) && | ||||
| (gpl->flag & GP_LAYER_ACTIVE)) { | (gpl->flag & GP_LAYER_ACTIVE)) { | ||||
| for (bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->prev) { | for (bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->prev) { | ||||
| /* skip strokes that are invalid for current view */ | /* skip strokes that are invalid for current view */ | ||||
| if (ED_gpencil_stroke_can_use(C, gps) == false) { | if (ED_gpencil_stroke_can_use(C, gps) == false) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ma = give_current_material(ob, gps->mat_nr + 1); | ma = BKE_material_gpencil_get(ob, gps->mat_nr + 1); | ||||
| DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| gp_style = ma->gp_style; | gp_style = ma->gp_style; | ||||
| /* unlock/unhide color if not unlocked before */ | /* unlock/unhide color if not unlocked before */ | ||||
| if (gp_style != NULL) { | if (gp_style != NULL) { | ||||
| gp_style->flag &= ~GP_STYLE_COLOR_LOCKED; | gp_style->flag &= ~GP_STYLE_COLOR_LOCKED; | ||||
| gp_style->flag &= ~GP_STYLE_COLOR_HIDE; | gp_style->flag &= ~GP_STYLE_COLOR_HIDE; | ||||
| } | } | ||||
| Show All 26 Lines | |||||
| } | } | ||||
| /* ********************** Isolate gpencil_ color **************************** */ | /* ********************** Isolate gpencil_ color **************************** */ | ||||
| static int gpencil_color_isolate_exec(bContext *C, wmOperator *op) | static int gpencil_color_isolate_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| bGPdata *gpd = ED_gpencil_data_get_active(C); | bGPdata *gpd = ED_gpencil_data_get_active(C); | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| Material *active_ma = give_current_material(ob, ob->actcol); | Material *active_ma = BKE_material_gpencil_get(ob, ob->actcol); | ||||
| MaterialGPencilStyle *active_color = BKE_material_gpencil_settings_get(ob, ob->actcol); | MaterialGPencilStyle *active_color = BKE_material_gpencil_settings_get(ob, ob->actcol); | ||||
| MaterialGPencilStyle *gp_style; | MaterialGPencilStyle *gp_style; | ||||
| int flags = GP_STYLE_COLOR_LOCKED; | int flags = GP_STYLE_COLOR_LOCKED; | ||||
| bool isolate = false; | bool isolate = false; | ||||
| if (RNA_boolean_get(op->ptr, "affect_visibility")) { | if (RNA_boolean_get(op->ptr, "affect_visibility")) { | ||||
| flags |= GP_STYLE_COLOR_HIDE; | flags |= GP_STYLE_COLOR_HIDE; | ||||
| } | } | ||||
| if (ELEM(NULL, gpd, active_color)) { | if (ELEM(NULL, gpd, active_color)) { | ||||
| BKE_report(op->reports, RPT_ERROR, "No active color to isolate"); | BKE_report(op->reports, RPT_ERROR, "No active color to isolate"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* Test whether to isolate or clear all flags */ | /* Test whether to isolate or clear all flags */ | ||||
| Material *ma = NULL; | Material *ma = NULL; | ||||
| short *totcol = give_totcolp(ob); | short *totcol = give_totcolp(ob); | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| /* Skip if this is the active one */ | /* Skip if this is the active one */ | ||||
| if ((ma == NULL) || (ma == active_ma)) { | if ((ma == NULL) || (ma == active_ma)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* If the flags aren't set, that means that the color is | /* If the flags aren't set, that means that the color is | ||||
| * not alone, so we have some colors to isolate still | * not alone, so we have some colors to isolate still | ||||
| */ | */ | ||||
| gp_style = ma->gp_style; | gp_style = ma->gp_style; | ||||
| if ((gp_style->flag & flags) == 0) { | if ((gp_style->flag & flags) == 0) { | ||||
| isolate = true; | isolate = true; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /* Set/Clear flags as appropriate */ | /* Set/Clear flags as appropriate */ | ||||
| if (isolate) { | if (isolate) { | ||||
| /* Set flags on all "other" colors */ | /* Set flags on all "other" colors */ | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (ma == NULL) { | if (ma == NULL) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| gp_style = ma->gp_style; | gp_style = ma->gp_style; | ||||
| if (gp_style == active_color) { | if (gp_style == active_color) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| else { | else { | ||||
| gp_style->flag |= flags; | gp_style->flag |= flags; | ||||
| } | } | ||||
| DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* Clear flags - Restore everything else */ | /* Clear flags - Restore everything else */ | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (ma == NULL) { | if (ma == NULL) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| gp_style = ma->gp_style; | gp_style = ma->gp_style; | ||||
| gp_style->flag &= ~flags; | gp_style->flag &= ~flags; | ||||
| DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | static int gpencil_color_hide_exec(bContext *C, wmOperator *op) | ||||
| if (totcol == 0) { | if (totcol == 0) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| if (unselected) { | if (unselected) { | ||||
| /* hide unselected */ | /* hide unselected */ | ||||
| MaterialGPencilStyle *color = NULL; | MaterialGPencilStyle *color = NULL; | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (ma) { | if (ma) { | ||||
| color = ma->gp_style; | color = ma->gp_style; | ||||
| if (active_color != color) { | if (active_color != color) { | ||||
| color->flag |= GP_STYLE_COLOR_HIDE; | color->flag |= GP_STYLE_COLOR_HIDE; | ||||
| DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | static int gpencil_color_reveal_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| if (totcol == 0) { | if (totcol == 0) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* make all colors visible */ | /* make all colors visible */ | ||||
| MaterialGPencilStyle *gp_style = NULL; | MaterialGPencilStyle *gp_style = NULL; | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (ma) { | if (ma) { | ||||
| gp_style = ma->gp_style; | gp_style = ma->gp_style; | ||||
| gp_style->flag &= ~GP_STYLE_COLOR_HIDE; | gp_style->flag &= ~GP_STYLE_COLOR_HIDE; | ||||
| DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| /* updates */ | /* updates */ | ||||
| Show All 36 Lines | static int gpencil_color_lock_all_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| if (totcol == 0) { | if (totcol == 0) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* make all layers non-editable */ | /* make all layers non-editable */ | ||||
| MaterialGPencilStyle *gp_style = NULL; | MaterialGPencilStyle *gp_style = NULL; | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (ma) { | if (ma) { | ||||
| gp_style = ma->gp_style; | gp_style = ma->gp_style; | ||||
| gp_style->flag |= GP_STYLE_COLOR_LOCKED; | gp_style->flag |= GP_STYLE_COLOR_LOCKED; | ||||
| DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| /* updates */ | /* updates */ | ||||
| Show All 36 Lines | static int gpencil_color_unlock_all_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| if (totcol == 0) { | if (totcol == 0) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* make all layers editable again*/ | /* make all layers editable again*/ | ||||
| MaterialGPencilStyle *gp_style = NULL; | MaterialGPencilStyle *gp_style = NULL; | ||||
| for (short i = 0; i < *totcol; i++) { | for (short i = 0; i < *totcol; i++) { | ||||
| ma = give_current_material(ob, i + 1); | ma = BKE_material_gpencil_get(ob, i + 1); | ||||
| if (ma) { | if (ma) { | ||||
| gp_style = ma->gp_style; | gp_style = ma->gp_style; | ||||
| gp_style->flag &= ~GP_STYLE_COLOR_LOCKED; | gp_style->flag &= ~GP_STYLE_COLOR_LOCKED; | ||||
| DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| /* updates */ | /* updates */ | ||||
| ▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines | |||||
You can't assign a default material to a mesh.