I just got a bug report from Willy Tschager, that the renamed and fully OMR conform unofficial files marked as not correct.
This bug is already fixed, I only have to upload that version. Will do that maybe tomorrow.

Update 22.10.2012 changes
'list of used parts' - first try (not complete finished yet)
'Delete redundant files' now works but without delete for a good reason.
More detailed information after LDraw OMR Check
Many small changes in the background.

Update 02.11.2012 changes
'list of used parts' - now disabled because it does not work like suggested.
Added: menu entry 'search part' now working.
Added: menu entry 'Check for ~Moved to files' added with code behind.
Added: picture of the whole model (first dat-file in the mpd file) is shown. (ldvlib.dll needed)
Changed: at startup mpdcenterini.xml is searched in "current_user/documents" and if not found
it is searched in "application_path" and if not found the user is asked some questions.
The file will always be stored and written to in the "current_user/documents" folder.

Update 17.11.2012 changes
Added: Quickcheck for unofficial parts and for '~Moved to' parts added. (For larger models this is'nt anymore quick.)
Changed: The '0 FILE' entry needs to be the same as the '0 Name:' entry.

Due to the requirement (http://forums.ldraw.org/showthread.php?t...61#pid6661) that the '0 FILE' entry in the MPD file has to be the same value than the '0 Name:' entry in the file this is a quite major rewrite. I have done a lot of testing but it might contain bugs. Please report them so I can quickly solve that.

Also you should check your already with MPDCenter created MPD files for imported subfiles or imported 48 primitives as they will not carry the correct '0 FILE' entry! If formerly saved with an previous version of MPDCenter you only need to open and save that file again to have that corrected.
I have not yet check the behaviour if you open again with MLCad and saved it. As MLCad caused this confusion (in conjunction with our specifications) I would currently not rely on MLCad. LDView works great.

As you know I have about 1000 mpd files online.
With the current build of MPDCenter (not yet online) I check all files. During this process I am sure to detect more bugs that just by testing test files.
Also I should be aware of bad handling and maybe have new ideas for better handling at all.

Edit:
I just discovered that MPDCenter will not work if a line with '0 BFC' is found.
This error will be fixed with the next version.

Edit:
Found another bug (thanks to Willy) if importing files. At one place I did not handle file names case independend and that results in not renaming the files on import.
This bug will be fixed with the next version.

Edit:
Next Bug. If you have an additional empty space in front of the reference this will be taken as part of the reference name.
This bug will be fixed with the next version.

Edit:
Check and remove ~Moved to parts don't work correct. The transformation matrix is not used currently!
This bug will be fixed with the next version.

Given the following situation:
A mpd content file named "multi.mpd" is loaded in MPDCenter.
In that mpd file there is a file named "single.ldr".
Which options should be offered if I try to import another plain file "single.ldr"?
Currently you are unable to add this file as the only mpd where you can add this file to is "multi.mpd" and there exists already a file with this name (it may have different content).

Do you like to have the possibility to create on the fly a new mpd named "unnamed.mpd" besides the already existing mpd content file?

Or do you think that this is not worth to code this as this naming chaos will never be a good idea?

1. In User Preferences the program asks for my LDraw username. What is that? Also, it would not let me enter spaces.
2. It asks for a license type. Why are there only two options? Why can't I select Creative Commons 3.0 BY-SA?
3. In Options, the program asks me for 'base' LDraw folder, 'pure' official folder and unofficial folder. Are these all supposed to be different?

1: Parts and models author lines have a spot for your LDraw username
2: The LDraw.org contributors agreement uses CCAL 2.0. To change that would require approval from all our authors which would not be something we will be doing again anytime in the near future (or ever if I have any say in the matter)
3: ideally you should have your official and unofficial libraries separate

to
1) LDraw User name is the name all part authors have for uploading parts to the PT. If you do not have a name, leave that entry blank. As blanks not allowed in LDraw User names - you can not enter blanks.

2) The ldraw library is distributed by a license that can be choosen by default.
If MPDCenter finds a file %LdrawBasePath%\LDraw_licenses.txt then the text from that file is used to be displayed. I attached a file for that purpose.

Code:

3. In Options, the program asks me for 'base' LDraw folder, 'pure' official folder and unofficial folder. Are these all supposed to be different?

Normally yes. But most people put the base and the unofficial into one folder. To detect which files are official and which are not MPDCenter needs a 'pure' official folder, where really only official files are in. Otherwise the "import unofficial files" will not give correct results.

Michael Heidemann Wrote:2) The ldraw library is distributed by a license that can be choosen by default.
If MPDCenter finds a file %LdrawBasePath%\LDraw_licenses.txt then the text from that file is used to be displayed. I attached a file for that purpose.

So, this only applies to parts authors? I can use any license for a MOC?

OK, so I 'opened" datsville.ldr in MPDCenter and I got a small model tree with 'unnamed.xmpd' as the top level. What do I do next?

Next step is Menu command - Import - Import unofficial files
This will import all files that are referenced from datsville.ldr into your unnamed.xmpd that are not in your "pure" Base Library directory. During the import you might get a window that a file can not be found. This is a hint, that a file is not in the same directory than datsville.ldr and therefore missing for the user you send the zip of your folder to. In that case you should answer with no, but note that filename for fixing datsville project later.
After that has been done you will find all imported files also in the tree.

You can now check for files that are not needed (Menu Command - Edit - Search for not needed files).
This will detect files in the whole (imported) project that are not referenced by any line. This can only affect mpd content files.

There is currently not much more that you can use for the datsville project, as the export will not be done in the same way you have structured datsville. So any change you make within MPDCenter will be lost because you can not work with the result from MPDCenter.
Sorry, that is not the whole truth. You can of course save each file separately from the tree

Code:

Also, I don't really want to create an XMPD file. I am happy with the way the model structure is right now.

As described above this is the way MPDCenter works. It wasn't intended to follow your structure but to ensure all files that are needed to display a model (also with several mpd content files) as a single file (xmpd content file).

Ohh..
You are right. Just saving the content from one single file is not implemented.
You always exports also the referred files.

But you can try and play with the features that are already implemented.
Export is always done by Menu Command - Extract - [choose some]
Please note that you first have to select the file (only one entry) in the tree. Depending on the filetype (ldr or mpd) you will get different possibilities at the - Extract - command.

Code:

Also, can I get a list of models used vs. not used and just sitting in the directory?

I think that is not possible. MPDCenter does not care about your files until it is used in a model.
Comparing the output of MPDCenter with your original folder also does not work, because some modelfiles are imported into mpd content files where they are needed.

Michael Heidemann Wrote:In the next build there will be a menu command - "Extract" - "Selected like it is" so you are able to save each ldr/dat file and/or each mpd content file just like it appears in the tree.

I do not want to export it "just like it appears in the tree". I do not want "unnamed.xmpd" or "unnamed.mpd".

Also I have ~400 models. I am not going to click this option for each and every one of them.

Michael Heidemann Wrote:

Code:

Also, can I get a list of models used vs. not used and just sitting in the directory?

I think that is not possible. MPDCenter does not care about your files until it is used in a model.
Comparing the output of MPDCenter with your original folder also does not work, because some modelfiles are imported into mpd content files where they are needed.

This is the main thing I was hoping MPDCenter would be capable of doing.

But this will take a while as there are a couple of questions to be answered for such functionality.

My idea is like follows:
1) make a list of all files in a specified directory.
2) Start with the first file of that list and look for the existance of a file with the same name in the tree.
2a) If same filename found as mpd content file - ok
2b) If same filename found as ldr/dat entry - if it is in unnamed.mpd - ok
2c) If same filename found as ldr/dat entry - if it is in another mpd (at this point I do not know whether this file is already imported into that mpd or not. So I need to reload and compare both mpd.)

I hope I have not forgotten something.

The worst case is that there might be files inside the mpd content files that have the same name but different content. I can think of the following situation:
files in the directory:
figure1.ldr
model1.mpd (contains a figure1.ldr that is different from the others)
model2.mpd (contains a figure1.ldr that is different from the others)

Could you make it so that you can select multiple items in the model tree and apply actions in bulk? For instance I have multiple models that share the same license, or multiple models with the same author. That would really speed things up.

[edit]

Also, there needs to be a way to differentiate between sub-models that are *contained* within an MPD file and sub-models that are simply *referenced* within an MPD file. For instance, vehicle_017_graysemitruck.mpd lists the following:

Could you make it so that you can select multiple items in the model tree and apply actions in bulk?

Not on my todo list so far. I'll have a look at this later.

Code:

Also, there needs to be a way to differentiate between sub-models that are *contained* within an MPD file and sub-models that are simply *referenced* within an MPD file.

There is no way at present to give that information and I doubt it will ever be.

Code:

Lastly, a bug. When you click on the information screen to the right, the selection highlighting disappears in the tree view to the left.

This is not a bug! This is the simple behaviour of applications. You select an item and this item will be highlighted so you know what you are working on. If you just hit the tab key if you are focused on the information (body) textfield the focus will go to the listbox and the formerly selected item is highlighted again, as that was the last user selected item from the list.

Also, there needs to be a way to differentiate between sub-models that are *contained* within an MPD file and sub-models that are simply *referenced* within an MPD file.

There is no way at present to give that information and I doubt it will ever be.

Wow! That is surprising.

Michael Heidemann Wrote:

Code:

Lastly, a bug. When you click on the information screen to the right, the selection highlighting disappears in the tree view to the left.

This is not a bug! This is the simple behaviour of applications. You select an item and this item will be highlighted so you know what you are working on. If you just hit the tab key if you are focused on the information (body) textfield the focus will go to the listbox and the formerly selected item is highlighted again, as that was the last user selected item from the list.

Well, take a look at Windows File Explorer for example. You can see the highlighted item in both the tree view and the folder view.

No it is not. You are looking for a different tool!
Once a file is imported it doesn't matter anyway. The file is part of the mpd!

Code:

Well, take a look at Windows File Explorer for example. You can see the highlighted item in both the tree view and the folder view.

No, I can not see this in my system (win8). What I see is that in the folder tree the item is blue (current focus) and if I switch to the folder content the blue is turned to gray. This is done by the author of the application and not a feature of the programming languange. If you like to have such a feature - we can debate this - this is not a bug!

I just tried to tweak the treeview control but so far with no good result.
These kind of operation are often complicate (at least for me).
I can follow both of your ideas and think that they will make MPDCenter more usable.
So please be patient - hopefully I can solve these coding problems.

Well, take a look at Windows File Explorer for example. You can see the highlighted item in both the tree view and the folder view.

Stupid me
I got to manage this behaviour. So if the focus is not on the treeview the selected item is still marked with light gray (standard windows behaviour).
Now I look for the possibility to mark the imported items in the treeview.

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

Ok, that does not give any clue to me regarding the problem. What I see is that you have 2GB ram and I have 4GB ram, but that should not be the problem. I am going to change the code slightly with more error detection.
Can you repeat the error?

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

1. The first time I tried, the program stalled and did nothing for 30mins except for the little yellow propeller spinning.
2. The second time it finished rather quickly (5-10 mins) and was successful. However, the program also spawned a child window asking me to select a file folder in a folder tree. I ignored this because I didn't know what it was for. I don't know if it was important or not.

2. The second time it finished rather quickly (5-10 mins) and was successful. However, the program also spawned a child window asking me to select a file folder in a folder tree. I ignored this because I didn't know what it was for. I don't know if it was important or not.

If you have the latest build tested, the window tells you why you should select a folder. If you do not select a "project base folder" then you get no answer to the question which files from that folder are _not_ importet.

Depending on the size of your project and the speed of your system it can take quite a while to finish the process. But also it might be that you ignored (or did not see) another window where you are asked to give an answer (if a file could not be find automatically). As long as the propellor rotates the programm works

MPDCenter is a tool that might help you at the work you are doing. You already asked for several new functions and behaviour. That all is build in now. So the real question is what you want to do!

The more detailed you can answer this question, the more help you can get.

MPDCenter answers f.e.
1) Which files are not in the correct place to be loaded correctly on any system (unofficial files f.e.)
2) Your question which files are not yet refered by datsville.ldr but in the datsville folder
3) which author have contributed so far for this project.

The main message is: "The path is not of a legal form"
From the calling route I see that it occurs in the following line in my code:
files = IO.Directory.GetFiles(strOriginalPath)
So the variable strOriginalPath needs to contain an odd path.
The path of the current loaded file is set to setOriginalPath with the following line:
strOriginalPath = System.IO.Path.GetDirectoryName(gstrMPDfilePath)
And gstrMPDfilePath is filled with the complete path and filename of the current loaded file!

So please let me have the full path and filename to your loaded datsville file.
Please note that currently all pathes needs to be just normal pathes, no ftp, no network (only by letter), etc.

I have implemented that check during the import of unofficial files.
At that point I know which files are in need of importing. Therefore I take that list and compare it against the list of files in that directory. The result is shown in the messagewindow and can be copied to somewhere else if needed. It looks like this:

Code:

Files not imported from path C:\Users\Michael\Desktop\datsville_rev337\datsville.
axis32x.dat - this file is not imported.
building_046_garagesmall.mpd - this file is not imported.
building_047_garagelarge.mpd - this file is not imported.
building_056_warehouselarge.mpd - this file is not imported.
building_063_officebuildingsmall.mpd - this file is not imported.
building_078_redwhitehouse2.ldr - this file is not imported.
datsville.ldr - this file is not imported.
dir_bat.cmd - this file is not imported.
dir_bat.txt - this file is not imported.
gridb32x.dat - this file is not imported.
gridb8x.dat - this file is not imported.
grids32x.dat - this file is not imported.
gridu4x.dat - this file is not imported.
infrastructure_arrowsign.ldr - this file is not imported.
infrastructure_flowers_02.ldr - this file is not imported.
infrastructure_flowers_03.ldr - this file is not imported.
infrastructure_rubblepile.ldr - this file is not imported.
infrastructure_signstoptriple.ldr - this file is not imported.
infrastructure_streetlamp_5.ldr - this file is not imported.
infrastructure_trafficsignal_1.ldr - this file is not imported.
infrastructure_treecoolabah.ldr - this file is not imported.
infrastructure_treegum.ldr - this file is not imported.
infrastructure_warningsign.ldr - this file is not imported.
pedestrian_037_bluefiguresit1.ldr - this file is not imported.
pedestrian_057_citycatbusinessman.ldr - this file is not imported.
pedestrian_058_citycattourist.ldr - this file is not imported.
pedestrian_062_bicyclistredshirt.ldr - this file is not imported.
rail_crossingnogate.ldr - this file is not imported.
rail_splitright.ldr - this file is not imported.
rail_straight.ldr - this file is not imported.
snotroad_curvestripenocross.ldr - this file is not imported.
snotroad_doubleblanknocross.ldr - this file is not imported.
snotroad_doubledash.ldr - this file is not imported.
snotroad_doublestripeleftonly.ldr - this file is not imported.
snotroad_doublestripeleftonlydouble.ldr - this file is not imported.
snotroad_halfstripenocross.ldr - this file is not imported.
snotroad_quadblanknocross.ldr - this file is not imported.
snotroad_tripleblankcross_1.ldr - this file is not imported.
snotroad_tripleblankcross_2.ldr - this file is not imported.
snotroad_tripledotsnocross.ldr - this file is not imported.
vehicle_058_graybicyclewithrider.ldr - this file is not imported.
vehicle_071_cranerailcar.mpd - this file is not imported.

1)
You can create an inventory listing like in LDView, but the pictures will be rendered with LDView.
Edit: added a How to for this feature.

2)
You can convert l3b files that contains groups into a mpd file, where the groups are converted to submodels.
Edit: added a How to for this feature.

3) You can add mpd files into one file, that our current tools can read and show like normal mpd files. This is the main feature of MPDCenter and is now full working. With this feature you can add your collection of models (ldr files and/or mpd files) into one xmpd file. If you open this xmpd file in MLCad you can work on this just as on every other mpd model. If you want to be able to split this xmpd file later into its former mpd/ldr files please be sure not to change the names of the files in the xmpd file.
But you can create new scenes where all your models are in one scene. To be able to give your work to any other LDraw user you also only need one click to import all unofficial files into the xmpd file, so there is never a piece missing.

I was able to create an XMPD file using this program. How do I save/export it as just an MPD file? Is there a difference? Thanks.

[edit]

Generating the XMPD file from Datsville took several minutes. Converting the XMPD file to a single inlined LDR file is now taking several hours. It is not done yet. I don't see the propeller animation either. According to Windows the program is "Not Responding".

(2018-01-07, 17:11)Michael Horvath Wrote: Is there any chance you could make this program multi-threaded? Using a single core it is taking over 24 hours to inline Datsville. But I have three other cores that could also be used. Thanks.

(OTOH, maybe I am the only person who needs this?)

To your last question - I think yes. Datsville is by far the largest project I know. But I made progress in speed. It was my bad implementation of some functions that made it so slow. Currently I run a last test to see how fast in hours (not days) it will take. Datsville has more than 500000 lines (not inlined), so it is really large.
To your multi-threaded question, I have no idea how to do this.
cu
mikeheide

(2018-01-07, 17:11)Michael Horvath Wrote: Is there any chance you could make this program multi-threaded? Using a single core it is taking over 24 hours to inline Datsville. But I have three other cores that could also be used. Thanks.

(OTOH, maybe I am the only person who needs this?)

To your last question - I think yes. Datsville is by far the largest project I know. But I made progress in speed. It was my bad implementation of some functions that made it so slow. Currently I run a last test to see how fast in hours (not days) it will take. Datsville has more than 500000 lines (not inlined), so it is really large.
To your multi-threaded question, I have no idea how to do this.
cu
mikeheide

(2018-02-18, 15:32)Michael Heidemann Wrote: To your last question - I think yes. Datsville is by far the largest project I know. But I made progress in speed. It was my bad implementation of some functions that made it so slow. Currently I run a last test to see how fast in hours (not days) it will take. Datsville has more than 500000 lines (not inlined), so it is really large.
To your multi-threaded question, I have no idea how to do this.
cu
mikeheide

Thanks for continuing the program!

Yeah, I don't know how to make multi-threaded software either.

I don't think you can multi thread the inline process it might even be slower because all threads still need to manipulate a single destination array/string list.
Loading/parsing the LDraw source files can be threaded though, but I'm guessing that's not the bottle neck here.

Quote:I don't think you can multi thread the inline process it might even be slower because all threads still need to manipulate a single destination array/string list.

Well, that's how multithreading works.
The destination array should be "the set of already inlined files".
Multiple threads then can operate on multiple portions of DatVille, each one accessing and contributing to that array.
Of course, the access to that array (both read+write) must be protected by a semaphore (in C#: lock(...)).
Any thread that finds a part that is not yet inlined, will add it to that array so other threads will find it there.

Quote:I don't think you can multi thread the inline process it might even be slower because all threads still need to manipulate a single destination array/string list.

Well, that's how multithreading works.
The destination array should be "the set of already inlined files".
Multiple threads then can operate on multiple portions of DatVille, each one accessing and contributing to that array.
Of course, the access to that array (both read+write) must be protected by a semaphore (in C#: lock(...)).
Any thread that finds a part that is not yet inlined, will add it to that array so other threads will find it there.

The current build of MPDCenter is in testing and is by far quicker than the previous (current available) version. It works still without any multi-threading.
It still needs some tests to be stable in any case.

If there is someone who has a wish for a new function etc. please let me know within the next days, so I try to implement that in the next release.

Changes:
1) Inlining is now much, much faster than in previous versions.
2) The menu command 'Selected in LDR inlined' now works for all LDR files in a MPD file separately. If used on a MPD file the first file is inlined.BUGFIX:
1) Error in detection of unresolved references corrected.

Changes:
1) Inlining is now much, much faster than in previous versions.
2) The menu command 'Selected in LDR inlined' now works for all LDR files in a MPD file separately. If used on a MPD file the first file is inlined.BUGFIX:
1) Error in detection of unresolved references corrected.

Changes:
1) Inlining is now much, much faster than in previous versions.
2) The menu command 'Selected in LDR inlined' now works for all LDR files in a MPD file separately. If used on a MPD file the first file is inlined.BUGFIX:
1) Error in detection of unresolved references corrected.

Enjoy.

cu
Mike

Thank you!

Michael I also have to thank you for your input to getting this tool better and better.
cu
Mike

(2018-08-22, 3:16)Michael Horvath Wrote: Can MPDCenter inline all the way down to the part level? I mean, quads, lines, etc.

Thanks!

Oh, wow! The latest version of Inliner does exactly what I need! I.e. inline every part and primitive in an MPD file.

(But you might consider adding the feature to MPDCenter too.)

This might be also possible for MPDCenter. How need this to be named? Currently MPDCenter inlined down to the library part level.
The extraction from model is found in the menue "Extract" in MPDCenter.
Ok my suggestion is f.e. "Selected in LDR inlined - primitive level".

(2018-10-05, 17:01)Michael Heidemann Wrote: Please see my other announcement for MPDCenter 2.5.0.0
Now also MPDCenter shall exactly do what you like.
I have inlined a 4MB model and got a 970 GB file without any linetype 1.
cu
Mikeheide