BrushMode.applyToSelection now returns a progress iterator
This commit is contained in:
parent
daf2a91142
commit
fa1ddb4bb1
@ -74,7 +74,8 @@ class BrushCommand(SimplePerformCommand):
|
||||
self.editorSession.currentDimension)
|
||||
for point in self.points]
|
||||
selection = reduce(lambda a, b: a | b, selections)
|
||||
self.brushMode.applyToSelection(self, selection)
|
||||
for i in self.brushMode.applyToSelection(self, selection):
|
||||
yield i
|
||||
except NotImplementedError:
|
||||
for i, point in enumerate(self.points):
|
||||
f = self.brushMode.applyToPoint(self, point)
|
||||
|
@ -40,6 +40,8 @@ class BrushMode(QtCore.QObject):
|
||||
Called by BrushCommand to apply this brush mode to the given selection. Selection
|
||||
is generated by calling BrushShape.createShapedSelection and optionally
|
||||
combining multiple selections.
|
||||
|
||||
Return a progress iterator.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@ -98,8 +100,7 @@ class Fill(BrushMode):
|
||||
|
||||
:type command: BrushCommand
|
||||
"""
|
||||
fill = command.editorSession.currentDimension.fillBlocksIter(selection, command.options['blockInfo'])
|
||||
showProgress("Applying brush...", fill)
|
||||
return command.editorSession.currentDimension.fillBlocksIter(selection, command.options['blockInfo'])
|
||||
|
||||
def brushBoxForPoint(self, point, options):
|
||||
return self.brushBoundingBox(point, options)
|
||||
@ -147,6 +148,7 @@ class Biome(BrushMode):
|
||||
# TODO: progress bar, biome fill
|
||||
biomeID = command.options['biomeID']
|
||||
for x, _, z in selection.positions:
|
||||
yield 0, 0, "Applying biome brush"
|
||||
command.editorSession.currentDimension.setBiomeID(x, z, biomeID)
|
||||
|
||||
def brushBoxForPoint(self, point, options):
|
||||
|
Reference in New Issue
Block a user