View Issue Details

IDProjectCategoryView StatusLast Update
0006031DarkRadiantGUIpublic15.08.2022 13:50
ReporterDragofer Assigned Togreebo  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.0.0 
Target Version3.1.0Fixed in Version3.1.0 
Summary0006031: Material Editor: allow to delete materials
DescriptionThe Material Editor makes it very easy to create new materials, but deleting them still requires manually looking them up in the .mtr file and then reloading decls in DR. It'd make cleaning up leftover materials in an FM or core assets easier if there were a "Delete" button somewhere, i.e. near the "Unlock Editing" button.
TagsNo tags attached.

Activities

greebo

greebo

13.08.2022 06:00

administrator   ~0015161

Implement such that any comments above the material (that are not separated by empty lines) are removed along with the decl.
Dragofer

Dragofer

14.08.2022 11:10

developer   ~0015162

Very nice, it's particularly cool to see that you did after all seem to implement syntax trees for faithfully reproducing the source text. I assume this would pave the way for resolving some of those related tickets, too?
greebo

greebo

15.08.2022 13:50

administrator   ~0015169

It's only for the decl file as a whole, not the syntax within the declaration blocks (e.g. materials) itself. The text within a decl block is still overwritten by the source text produced in the Material or Particle Editors.

Implementing Syntax Tree parsing for the inner part of material declarations is feasible, but the even harder problem would be to write an algorithm to update the syntax tree with minimal changes to its structure. There are quite some redundant ways of expressing shader stages or placing keywords.

Related Changesets

DarkRadiant: defparser 6b45cdaf

2022-08-07 03:35:30

greebo

Details Diff
0006031: Start writing unit tests to cover the desired behaviour of IDeclarationManager::removeDeclaration Affected Issues
0006031
mod - include/ideclmanager.h Diff File
mod - test/DeclManager.cpp Diff File
add - test/resources/tdm/testdecls/removal_tests.decl Diff File

DarkRadiant: defparser d278b4c3

2022-08-07 04:15:05

greebo

Details Diff
0006031: More decl removal unit test cases Affected Issues
0006031
mod - test/DeclManager.cpp Diff File
mod - test/MaterialExport.cpp Diff File
mod - test/algorithm/FileUtils.h Diff File
mod - test/resources/tdm/testdecls/removal_tests.decl Diff File

DarkRadiant: defparser 95041102

2022-08-07 05:20:41

greebo

Details Diff
0006031: Implement DeclarationManager::removeDeclarationFromFile, this doesn't deal with leading comments yet Affected Issues
0006031
mod - libs/decl/SpliceHelper.h Diff File
mod - radiantcore/decl/DeclarationManager.cpp Diff File
mod - radiantcore/decl/DeclarationManager.h Diff File
mod - test/DeclManager.cpp Diff File

DarkRadiant: defparser 35f911cb

2022-08-07 05:21:20

greebo

Details Diff
0006031: Fix a deadlock that can occur when waiting for parsers to finish Affected Issues
0006031
mod - radiantcore/decl/DeclarationManager.cpp Diff File

DarkRadiant: defparser 6288cb62

2022-08-07 05:32:00

greebo

Details Diff
0006031: Allow removal of unsaved declarations Affected Issues
0006031
mod - radiantcore/decl/DeclarationManager.cpp Diff File
mod - test/DeclManager.cpp Diff File

DarkRadiant: defparser bea40041

2022-08-07 06:00:30

greebo

Details Diff
0006031: Add a misleading commented out declaration on top of the real one, this is throwing the splice helper off its rails Affected Issues
0006031
mod - test/DeclManager.cpp Diff File
mod - test/resources/tdm/testdecls/removal_tests.decl Diff File

DarkRadiant: defparser 7048c432

2022-08-07 07:47:49

greebo

Details Diff
0006031: Move ThreadedDefLoader to parser namespace Affected Issues
0006031
mod - libs/parser/ThreadedDeclParser.h Diff File
mod - plugins/dm.gui/gui/GuiManager.h Diff File
mod - radiantcore/fonts/FontLoader.h Diff File
mod - tools/msvc/libs.vcxproj Diff File
mod - tools/msvc/libs.vcxproj.filters Diff File

DarkRadiant: defparser 237ef176

2022-08-07 17:30:15

greebo

Details Diff
0006031: Start working on an advanced version of the declaration BlockTokeniser Affected Issues
0006031
add - libs/parser/DefBlockSyntaxParser.h Diff File
mod - tools/msvc/libs.vcxproj Diff File
mod - tools/msvc/libs.vcxproj.filters Diff File

DarkRadiant: defparser e4dd890c

2022-08-07 18:27:07

greebo

Details Diff
0006031: First simple unit test Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/CMakeLists.txt Diff File
add - test/DefBlockSyntaxParser.cpp Diff File
mod - tools/msvc/Tests/Tests.vcxproj Diff File
mod - tools/msvc/Tests/Tests.vcxproj.filters Diff File

DarkRadiant: defparser 82f19cf0

2022-08-08 04:23:10

greebo

Details Diff
0006031: Parse whitespace tokens Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File

DarkRadiant: defparser b0595bdd

2022-08-12 06:13:16

greebo

Details Diff
0006031: Start implementing the block tokeniser func Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File

DarkRadiant: defparser e530be60

2022-08-12 06:54:07

greebo

Details Diff
0006031: More block tokeniser unit tests. Fix parsing when encountering control characters within a quoted string within a block Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File

DarkRadiant: defparser e6c53422

2022-08-12 11:03:52

greebo

Details Diff
0006031: Add test assuming that a parsed syntax tree can be converted back to the exact source string it has been parsed from. Affected Issues
0006031
mod - test/DefBlockSyntaxParser.cpp Diff File
mod - test/algorithm/FileUtils.h Diff File

DarkRadiant: defparser 15aa2867

2022-08-12 14:27:28

greebo

Details Diff
0006031: It's possible now to parse a decl file into a syntax tree and reconstruct the source text, byte-perfect. Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File
mod - test/resources/tdm/testdecls/removal_tests.decl Diff File

DarkRadiant: defparser 2f6dfe2e

2022-08-12 14:33:09

greebo

Details Diff
0006031: Extend the unit tests to cover def, particles, material types Affected Issues
0006031
mod - test/DefBlockSyntaxParser.cpp Diff File

DarkRadiant: defparser c479e990

2022-08-12 16:32:51

greebo

Details Diff
0006031: Introduce parser specialisations for std::stream and const std::string, using traits to reduce code duplication.
Extend unit tests.
Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File

DarkRadiant: defparser 33e7da46

2022-08-12 18:43:10

greebo

Details Diff
0006031: Update the DeclarationFolderParser to use the DefBlockSyntaxParser to load the decl files.
For that I had to write an iterator adapter supporting the peek() method needed for the specific DefBlockSyntaxTokeniserFunc implementation. Since std::istream has a peek() method we can expose that in a special iterator adapter. Pretty convoluted altogether, but the client code is looking nice.
Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - radiantcore/decl/DeclarationFolderParser.cpp Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File

DarkRadiant: defparser ccdd03b8

2022-08-12 19:13:46

greebo

Details Diff
0006031: Remove old code in DeclarationFolderParser Affected Issues
0006031
mod - radiantcore/decl/DeclarationFolderParser.cpp Diff File

DarkRadiant: defparser 9b7ac576

2022-08-12 19:30:42

greebo

Details Diff
0006031: Remove the declaration from physical decl files by manipulating the parsed syntax tree. Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - radiantcore/decl/DeclarationManager.cpp Diff File

DarkRadiant: defparser 9308ace6

2022-08-13 04:46:31

greebo

Details Diff
0006031: Lead-in comments of deleted blocks are now removed along with it Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - radiantcore/decl/DeclarationManager.cpp Diff File
mod - test/DeclManager.cpp Diff File
mod - test/resources/tdm/testdecls/removal_tests.decl Diff File

DarkRadiant: defparser 322ffce4

2022-08-13 05:13:13

greebo

Details Diff
0006031: Material Editor is now offering a button to remove the selected material Affected Issues
0006031
mod - install/ui/materialeditor.fbp Diff File
mod - install/ui/materialeditor.xrc Diff File
mod - radiant/ui/materials/editor/MaterialEditor.cpp Diff File
mod - radiant/ui/materials/editor/MaterialEditor.h Diff File

DarkRadiant: defparser 95b34708

2022-08-13 05:41:02

greebo

Details Diff
0006031: Declaration Manager is creating a .bak file before removing a decl from the target path. Affected Issues
0006031
mod - libs/os/file.h Diff File
mod - libs/stream/ExportStream.h Diff File
mod - radiantcore/decl/DeclarationManager.cpp Diff File
mod - test/DeclManager.cpp Diff File

DarkRadiant: defparser 30358653

2022-08-13 05:47:06

greebo

Details Diff
0006031: Remove a .darkradiant file in another unit test that used to stick around after a full test run. Affected Issues
0006031
mod - test/EntityClass.cpp Diff File

DarkRadiant: master fd8bef54

2022-08-13 06:14:43

greebo

Details Diff
0006031: Migrate particle tests to use the DefBlockSyntaxParser to check the file contents Affected Issues
0006031
mod - test/Particles.cpp Diff File

DarkRadiant: master 8ace9e39

2022-08-13 06:33:54

greebo

Details Diff
0006031: Migrate DefBlockTokeniser test cases to the DefBlockSyntaxParser test fixture Affected Issues
0006031
mod - test/DeclManager.cpp Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File

DarkRadiant: master d8162d2a

2022-08-13 06:38:52

greebo

Details Diff
0006031: Turns out the DefBlockTokeniser can be removed Affected Issues
0006031
rm - libs/parser/DefBlockTokeniser.h Diff File
mod - test/DefTokenisers.cpp Diff File
mod - tools/msvc/libs.vcxproj Diff File
mod - tools/msvc/libs.vcxproj.filters Diff File

DarkRadiant: master 034e0f46

2022-08-13 07:03:25

greebo

Details Diff
0006031: Introduce DefSyntaxTree::foreachBlock to reduce duplicated boilerplate code at the client side Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/DeclManager.cpp Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File
mod - test/Particles.cpp Diff File

DarkRadiant: master a7b73980

2022-08-13 07:48:26

greebo

Details Diff
0006031: Migrate DeclarationManager::saveDeclaration to manipulate the DefSyntaxTree instead of messing with regexes Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - radiantcore/decl/DeclarationManager.cpp Diff File

DarkRadiant: master 3f14603d

2022-08-13 07:52:41

greebo

Details Diff
0006031: Code cleanup, remove the regex-based SpliceHelper. Affected Issues
0006031
rm - libs/decl/SpliceHelper.h Diff File
mod - radiantcore/decl/DeclarationManager.cpp Diff File
mod - tools/msvc/libs.vcxproj Diff File
mod - tools/msvc/libs.vcxproj.filters Diff File

DarkRadiant: master 0a234c9f

2022-08-13 07:59:59

greebo

Details Diff
0006031: Change a few assertions in the MaterialExport tests which were tailored to the old algorithm that replaced the entire decl including the whitespace and comments outside the braced block. Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/MaterialExport.cpp Diff File

DarkRadiant: master a6f3a221

2022-08-13 19:35:38

greebo

Details Diff
0006031: Make the DefBlockSyntaxTokeniserFunc::_state field a variable, it has always been re-initialised between calls anyway. Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File

DarkRadiant: master be4161a6

2022-08-13 19:53:32

greebo

Details Diff
0006031: More unit tests, harden the parser against some ill-formed def token sequences Affected Issues
0006031
mod - libs/parser/DefBlockSyntaxParser.h Diff File
mod - test/DefBlockSyntaxParser.cpp Diff File

DarkRadiant: master 40baf891

2022-08-14 13:12:09

greebo

Details Diff
0006031: DeclarationManager is now more tolerant when it comes to trying to remove decls from files. Affected Issues
0006031
mod - radiant/ui/particles/ParticleEditor.cpp Diff File
mod - radiantcore/decl/DeclarationManager.cpp Diff File

Issue History

Date Modified Username Field Change
30.07.2022 19:22 Dragofer New Issue
30.07.2022 19:43 Dragofer Description Updated
31.07.2022 08:23 greebo Status new => confirmed
07.08.2022 03:34 greebo Assigned To => greebo
07.08.2022 03:34 greebo Status confirmed => assigned
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser 6b45cdaf
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser d278b4c3
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser 95041102
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser 35f911cb
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser 6288cb62
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser bea40041
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser 7048c432
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser 237ef176
07.08.2022 18:27 greebo Changeset attached => DarkRadiant defparser e4dd890c
12.08.2022 19:12 greebo Changeset attached => DarkRadiant defparser 82f19cf0
12.08.2022 19:12 greebo Changeset attached => DarkRadiant defparser b0595bdd
12.08.2022 19:12 greebo Changeset attached => DarkRadiant defparser e530be60
12.08.2022 19:12 greebo Changeset attached => DarkRadiant defparser e6c53422
12.08.2022 19:12 greebo Changeset attached => DarkRadiant defparser 15aa2867
12.08.2022 19:12 greebo Changeset attached => DarkRadiant defparser 2f6dfe2e
12.08.2022 19:12 greebo Changeset attached => DarkRadiant defparser c479e990
12.08.2022 19:12 greebo Changeset attached => DarkRadiant defparser 33e7da46
13.08.2022 04:46 greebo Changeset attached => DarkRadiant defparser ccdd03b8
13.08.2022 04:46 greebo Changeset attached => DarkRadiant defparser 9b7ac576
13.08.2022 04:46 greebo Changeset attached => DarkRadiant defparser 9308ace6
13.08.2022 05:15 greebo Changeset attached => DarkRadiant defparser 322ffce4
13.08.2022 05:53 greebo Changeset attached => DarkRadiant defparser 95b34708
13.08.2022 05:53 greebo Changeset attached => DarkRadiant defparser 30358653
13.08.2022 06:00 greebo Target Version => 3.1.0
13.08.2022 06:00 greebo Status assigned => resolved
13.08.2022 06:00 greebo Resolution open => fixed
13.08.2022 06:00 greebo Fixed in Version => 3.1.0
13.08.2022 06:00 greebo Note Added: 0015161
13.08.2022 06:46 greebo Changeset attached => DarkRadiant master fd8bef54
13.08.2022 06:46 greebo Changeset attached => DarkRadiant master 8ace9e39
13.08.2022 06:46 greebo Changeset attached => DarkRadiant master d8162d2a
13.08.2022 07:52 greebo Changeset attached => DarkRadiant master 034e0f46
13.08.2022 07:52 greebo Changeset attached => DarkRadiant master a7b73980
13.08.2022 07:52 greebo Changeset attached => DarkRadiant master 3f14603d
13.08.2022 08:00 greebo Changeset attached => DarkRadiant master 0a234c9f
14.08.2022 07:35 greebo Changeset attached => DarkRadiant master a6f3a221
14.08.2022 07:35 greebo Changeset attached => DarkRadiant master be4161a6
14.08.2022 11:10 Dragofer Note Added: 0015162
14.08.2022 15:37 greebo Changeset attached => DarkRadiant master 40baf891
15.08.2022 13:50 greebo Note Added: 0015169