View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003690 | DarkRadiant | Selection System | public | 10.03.2014 12:41 | 20.04.2016 15:53 |
Reporter | Assigned To | SteveL | |||
Priority | normal | Severity | normal | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Win32 | OS | Windows | OS Version | 7 sp1 |
Product Version | 1.8.1 | ||||
Summary | 0003690: Select all models of same type: not working anymore. | ||||
Description | when you do the above selection, other models of the same type arent being selected anymore. | ||||
Steps To Reproduce | Click on scripts, then "Select all Models of same type" | ||||
Tags | No tags attached. | ||||
Attached Files | select_all_models_of_type.py (1,467 bytes)
# Set the command name so that DarkRadiant recognises this file __commandName__ = 'SelectAllModelsOfType' __commandDisplayName__ = 'Select all Models of same type' # The actual algorithm called by DarkRadiant is contained in the execute() function def execute(): # Collect all currently selected models selectedModelNames = {} class Walker(SelectionVisitor) : def visit(self, node): # Try to "cast" the node to an entity entity = node.getEntity() if not entity.isNull(): if not entity.getKeyValue('model') == '': selectedModelNames[entity.getKeyValue('model')] = 1 visitor = Walker() GlobalSelectionSystem.foreachSelected(visitor) print('Unique models currently selected: ' + str(len(selectedModelNames))) # Now traverse the scenegraph, selecting all of the same names class SceneWalker(SceneNodeVisitor) : def pre(self, node): # Try to "cast" the node to an entity entity = node.getEntity() if not entity.isNull(): modelName = entity.getKeyValue('model') if not modelName == '' and modelName in selectedModelNames: # match, select this node node.setSelected(1); return 0 # don't traverse this entity's children return 1 # not an entity, so traverse children walker = SceneWalker() GlobalSceneGraph.root().traverse(walker) # __executeCommand__ evaluates to true after DarkRadiant has successfully initialised if __executeCommand__: execute() | ||||
Double checking this issue was not in 1.8.0 compared to 1.8.1 where it is. | |
Reproduced in 1.8.1 pre-release. In 1.8.0 with the same test map the script works. Python script is unchanged. | |
Confirmed, it works in 1.8.0 not not in 1.8.1 | |
This python script has always had a bug in it, but the functionality didn't break till January when work was done on separating the jobs of Node::traverse() and Node::traverseChildren(). The script always returns 0 in its second visitor class, so doesn't search a level down. That worked for selecting FS models when it started by traversing children of world, but not now that it starts with world itself. |
|
Modified script posted to the beta forum thread for testing. | |
Submitted pull request to DR repo: https://github.com/orbweaver/DarkRadiant/pull/11 |
|
Its happening again in the latest released version of 1.8.1 | |
I believe this has been fixed in 203. | |
Date Modified | Username | Field | Change |
---|---|---|---|
10.03.2014 12:41 |
|
New Issue | |
21.03.2014 10:11 |
|
Note Added: 0006451 | |
21.03.2014 19:57 | SteveL | Assigned To | => SteveL |
21.03.2014 19:57 | SteveL | Status | new => assigned |
21.03.2014 20:05 | SteveL | Note Added: 0006452 | |
21.03.2014 20:05 | SteveL | Status | assigned => confirmed |
21.03.2014 22:45 |
|
Note Added: 0006453 | |
28.03.2014 10:11 | SteveL | Note Added: 0006477 | |
28.03.2014 10:12 | SteveL | Note Edited: 0006477 | |
28.03.2014 20:26 | SteveL | Note Edited: 0006477 | |
28.03.2014 20:29 | SteveL | File Added: select_all_models_of_type.py | |
28.03.2014 20:29 | SteveL | Note Added: 0006480 | |
23.04.2014 18:50 | SteveL | Note Added: 0006550 | |
23.04.2014 18:50 | SteveL | Status | confirmed => resolved |
23.04.2014 18:50 | SteveL | Fixed in Version | => 1.8.1 |
23.04.2014 18:50 | SteveL | Resolution | open => fixed |
23.04.2014 18:50 | SteveL | Product Version | 1.8.0 => 1.8.1 |
27.07.2014 18:20 |
|
Note Added: 0006810 | |
27.07.2014 18:20 |
|
Status | resolved => assigned |
27.07.2014 18:20 |
|
Resolution | fixed => reopened |
07.07.2015 09:51 |
|
Note Added: 0007626 | |
07.07.2015 10:15 | greebo | Status | assigned => resolved |
07.07.2015 10:15 | greebo | Fixed in Version | 1.8.1 => |
07.07.2015 10:15 | greebo | Resolution | reopened => fixed |
20.04.2016 15:53 | greebo | Status | resolved => closed |