forked from bartvdbraak/blender
Fix for 'Copy materials to selected' button freezing when using linked geometry
This commit is contained in:
parent
653593b574
commit
985c24b0f1
@ -442,7 +442,9 @@ static int material_slot_copy_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
|
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
|
||||||
if(ob != ob_iter && give_matarar(ob_iter)) {
|
if(ob != ob_iter && give_matarar(ob_iter)) {
|
||||||
assign_matarar(ob_iter, matar, ob->totcol);
|
if (ob->data != ob_iter->data)
|
||||||
|
assign_matarar(ob_iter, matar, ob->totcol);
|
||||||
|
|
||||||
if(ob_iter->totcol==ob->totcol) {
|
if(ob_iter->totcol==ob->totcol) {
|
||||||
ob_iter->actcol= ob->actcol;
|
ob_iter->actcol= ob->actcol;
|
||||||
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob_iter);
|
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob_iter);
|
||||||
|
@ -274,6 +274,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
|
|||||||
case ND_CONSTRAINT:
|
case ND_CONSTRAINT:
|
||||||
ED_area_tag_redraw(sa);
|
ED_area_tag_redraw(sa);
|
||||||
break;
|
break;
|
||||||
|
case ND_DRAW:
|
||||||
case ND_SHADING:
|
case ND_SHADING:
|
||||||
case ND_SHADING_DRAW:
|
case ND_SHADING_DRAW:
|
||||||
/* currently works by redraws... if preview is set, it (re)starts job */
|
/* currently works by redraws... if preview is set, it (re)starts job */
|
||||||
|
@ -1040,13 +1040,13 @@ static void rna_def_material_slot(BlenderRNA *brna)
|
|||||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||||
RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL);
|
RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL);
|
||||||
RNA_def_property_ui_text(prop, "Material", "Material datablock used by this material slot.");
|
RNA_def_property_ui_text(prop, "Material", "Material datablock used by this material slot.");
|
||||||
RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, "rna_Object_update");
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE);
|
prop= RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE);
|
||||||
RNA_def_property_enum_items(prop, link_items);
|
RNA_def_property_enum_items(prop, link_items);
|
||||||
RNA_def_property_enum_funcs(prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL);
|
RNA_def_property_enum_funcs(prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL);
|
||||||
RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data.");
|
RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data.");
|
||||||
RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, "rna_Object_update");
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||||
RNA_def_property_string_funcs(prop, "rna_MaterialSlot_name_get", "rna_MaterialSlot_name_length", NULL);
|
RNA_def_property_string_funcs(prop, "rna_MaterialSlot_name_get", "rna_MaterialSlot_name_length", NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user