Skip to content

Commit

Permalink
Fix when float values are passed to progress bars (#133)
Browse files Browse the repository at this point in the history
* Fix when float values could be passed to progress bars

* Update the mac xcode version
  • Loading branch information
tbttfox authored Jul 3, 2024
1 parent 2f69e42 commit 1ef9e34
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4'
xcode-version: '15.4'

- name: Configure CMake
run: |
Expand Down Expand Up @@ -243,11 +243,11 @@ jobs:
- name: Get Correct Python Version
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.9'

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4'
xcode-version: '15.4'

- name: Configure CMake
run: |
Expand Down
10 changes: 8 additions & 2 deletions simplexui/commands/unsubdivide.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ def partitionIslands(faces, neigh, pBar=None):
allVerts = set(chain.from_iterable(faces))
islands = []
count = float(len(allVerts))

if pBar is not None:
pBar.setValue(0)
pBar.setMaximum(count)
QApplication.processEvents()

while allVerts:
verts = set([allVerts.pop()])
exclude = set()
Expand All @@ -200,7 +206,7 @@ def partitionIslands(faces, neigh, pBar=None):
allVerts.difference_update(exclude)

if pBar is not None:
pBar.setValue(100 * (count - len(allVerts)) / count)
pBar.setValue(count - len(allVerts))
QApplication.processEvents()

return islands
Expand Down Expand Up @@ -271,7 +277,7 @@ def getFaceCenterDel(faces, eNeigh, hints, pBar=None):
vertToFaces.setdefault(f, []).append(i)
vc.add(f)

count = float(len(vc))
count = len(vc)
centers = set()
midpoints = set()
originals = set(hints)
Expand Down
3 changes: 2 additions & 1 deletion simplexui/interface/mayaInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,12 +771,13 @@ def getAllShapeVertices(self, shapes, pBar=None):
# find the longest name for displaying stuff
sns = "_" * max(list(map(len, [s.name for s in shapes])))
pBar.setLabelText("Getting Shape:\n{0}".format(sns))
pBar.setMaximum(len(shapes))
QApplication.processEvents()

for i, shape in enumerate(shapes):
if pBar is not None:
pBar.setLabelText("Getting Shape:\n{0}".format(shape.name))
pBar.setValue((100.0 * i) / len(shapes))
pBar.setValue(i)
QApplication.processEvents()

cmds.setAttr(shape.thing, 1.0)
Expand Down

0 comments on commit 1ef9e34

Please sign in to comment.