-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43f75bc
commit d807ecc
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import bpy | ||
|
||
enableSelectionSorting = True | ||
|
||
sortedSelectionNames = [] | ||
|
||
def getSortedSelectedObjectNames(): | ||
return sortedSelectionNames | ||
|
||
def updateSelectionSorting(): | ||
global sortedSelectionNames | ||
|
||
selectedNames = getSelectedObjectNames() | ||
|
||
if enableSelectionSorting: | ||
newSortedSelection = [] | ||
for name in sortedSelectionNames: | ||
if name in selectedNames: | ||
newSortedSelection.append(name) | ||
for name in selectedNames: | ||
if name not in newSortedSelection: | ||
newSortedSelection.append(name) | ||
sortedSelectionNames = newSortedSelection | ||
else: | ||
sortedSelectionNames = selectedNames | ||
|
||
def getSelectedObjectNames(): | ||
selectedNames = [] | ||
for object in bpy.context.selected_objects: | ||
selectedNames.append(object.name) | ||
return selectedNames |