Skip to content

Commit e9a14a1

Browse files
committed
Добавление счётчика материалов до и после комбинирования
1 parent d0f1db9 commit e9a14a1

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

CombDiffMapMat.ms

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,19 @@
126126
rollout combiningMaterialsOnDiffuseMaps "CombDiffMapMat"(
127127
-- About
128128
button btn_about "About" width:92 height:23 align:#right
129-
groupBox grB_1 "" pos:[0, 60] width:340 height:80
129+
groupBox grB_1 "" pos:[0, 60] width:340 height:110
130130
label prgrs_mat "Cleaning of unused materials" pos:[15, 40]
131131
checkbox mt_4_cb checked:true pos:[160, 40]
132132
label label_clear "" pos:[0, 60]
133133
label current_obj_name ""
134+
label materials_count "Materials before: 0 | After: 0" pos:[15, 100] width:310
134135
progressbar current_obj_pb color:green
135136
button btnApply "Combine materials" width:150 align:#center
136137

137138
on btn_about pressed do (
138139
rollout rol_meChecker_about "CombDiffMapMat - About" width:295 (
139140

140-
label lbl1 "CombDiffMapMat 1.0" height:17
141+
label lbl1 "CombDiffMapMat 1.1" height:17
141142
label lbl6 "Script features:" pos:[11,33]
142143
label lbl7 "- Support for combining materials on multiple objects" pos:[13,53]
143144
label lbl9 "- Removing unused materials" pos:[13,73]
@@ -154,20 +155,28 @@ rollout combiningMaterialsOnDiffuseMaps "CombDiffMapMat"(
154155
current_obj_pb.value = 0
155156
for obj in selection do
156157
(
158+
-- Сохраняем количество материалов до очистки
159+
local materials_before = if classof obj.material == MultiMaterial then obj.material.materialList.count else 1
157160
local diffuseNameId = getUniqueMaterialNamesAndIDs obj
158161
diffuseNameId = setMaterialIDs obj diffuseNameId
162+
159163
if (mt_4_cb.checked == true) then
160164
removeUnusedMaterials obj diffuseNameId
161-
165+
166+
-- Сохраняем количество материалов после очистки
167+
local materials_after = if classof obj.material == MultiMaterial then obj.material.materialList.count else 1
168+
169+
-- Обновляем текст с количеством материалов
170+
materials_count.text = "Materials before: " + materials_before as string + " | After: " + materials_after as string
171+
162172
current_obj_name.text = obj.name
163173
current_obj_pb.value += 100/selection.count + 1
164174
)
165175
messageBox "Done!"
166176
)
167-
168177
)
169178

170179
-- Отображение интерфейса
171-
createdialog combiningMaterialsOnDiffuseMaps 340 140
180+
createdialog combiningMaterialsOnDiffuseMaps 340 163
172181

173182

0 commit comments

Comments
 (0)