Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- doc = MQSystem.getDocument()
- cntVisible = 0
- mainwnd = MQWidget.getMainWindow()
- dlg = MQWidget.Dialog(mainwnd)
- retText = ""
- def needFreeze(o):
- if o.patchType != 0:
- return True
- if o.mirrorType != 0:
- return True
- if o.latheType != 0:
- return True
- return False
- def cntTriSimple(o):
- ret = 0
- for f in o.face:
- if f.numVertex >= 3:
- ret += f.numVertex-2
- return ret
- def cntTriFull(o):
- bFreeze = needFreeze(o)
- if bFreeze:
- o = o.clone()
- o.freeze(-1)
- ret = cntTriSimple(o)
- doc.deleteObject(doc.getObjectIndex(o))
- else:
- ret = cntTriSimple(o)
- return ret
- for o in doc.object:
- if o is None:
- continue
- if o.visible is 0:
- continue
- cnt = cntTriFull(o)
- retText += o.name + ":\t"+str(cnt)+"ポリ\n"
- cntVisible += cnt
- dlg.canResize = True
- m = MQWidget.Memo(dlg)
- m.fillRateX = 1.0
- m.fillRateY = 1.0
- m.text = "表示しているポリゴン数(三角ポリ換算): "+str(cntVisible)+"ポリ\n\n---------------\n\n"+retText
- dlg.execute()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement