1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FS2004 Model Data Name

Discussion in 'Library Creator XML' started by sfrenchie, 19/7/11.

  1. sfrenchie

    sfrenchie

    Joined:
    12/4/11
    Messages:
    766
    Country:
    unitedstates
    Wouldn't it be possible for Library Creator to retrieve the ID from the corresponding xml file when adding an mdl to a library?

    As it is now, I compile and test models individually. When I am satisfied with the models I compile them into a library. While adding the models to the library new ID's are generated and of course whatever I placed in a scenery is not showing anymore until I manually open each object xml, copy the ID and paste it in the library xml.

    The same goes for MCX.

    Thanks.
  2. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,237
    Country:
    netherlands
    Hi,

    In the FS2004 MDL format the GUID is not stored, it is only in the XML file. So if you add that MDL file to another library there is no way to know the previous GUID that was assigned.

    In that case it might be easier to manually merge the XML code into the library XML.
  3. sfrenchie

    sfrenchie

    Joined:
    12/4/11
    Messages:
    766
    Country:
    unitedstates
    Hi Arno

    Simply retrieving the "name" field from the XML file (if present)?
  4. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,237
    Country:
    netherlands
    But Library Creator XML knows nothing about your old XML file, the tool creates a new one and you add a MDL to it.

    Or would you suggest to check if there is a XML with the same name as the MDL and then read from that? I would find that a bit complex and even confusing since that is something users would not expect to happen.

    I see the XML that is made during export just as an example. You don't have to use it at all. Why not just add it to your library directly and then test using that? If you need to update the object you just export the MDL again and recompile the library to update it.
  5. sfrenchie

    sfrenchie

    Joined:
    12/4/11
    Messages:
    766
    Country:
    unitedstates
    Yes, that's what I was thinking about.

    I cannot speak for others and would like to hear what they think about my suggestion.

    It is possible my sense of logic differs from others but to me it is logic.
    Say you create an object and place it all over the FS world. Month later you create more objects of the same kind and decide to put them together in a library. To me it is logic that you would automatically reuse the same reference to that object (the object ID).

    For the moment I do as you suggested, that is to manually edit the library file to replace the ID.

    Disregard "The same goes for MCX." in my original post since in that instance MCX doesn't create an XML. If I'm correct the ID can actuall be left to 0000000xxxx since it is not used.
  6. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,237
    Country:
    netherlands
    Hi Patrick,

    The GUID is not know to the MDL, so ModelConverterX will indeed keep an empty GUID when loading FS2004 MDL files.

    Maybe I work completely different. But I always start either project by creating a library to which I add all the objects. So if I start placing them around, they are in a library already. I can always add more objects to the same library later.

    You could do the same. Just load the XML of your first object to Library Creator XML and add more MDL files to that same file.
  7. sfrenchie

    sfrenchie

    Joined:
    12/4/11
    Messages:
    766
    Country:
    unitedstates
    I understand, different techniques or habits.

    However while testing new objects, which sometimes requires many compilations, it takes one more step to or rather the opening and use of an extra program including several steps (library creator) to recompile while I only have to drag/drop the file on bglcomp and I'm done.

    Don't take this as a criticism, it simply is an observation and no side is better than the other. More and more I realize that it seems Europeans and American in general have a different approach to programming. Sometimes it is in the way we differ in seeing the big pictures and sometimes it is in the details.
    For example, I posted a thread asking why most European made programs aren't using default button and mnemonics such as Alt-F. I got no response, but it seems one continent is more incline in using the mouse as an input device than the other. One could argue about which is faster, personally I would say, "keyboard".

    Anyway, no big deal really, just differences.
  8. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,237
    Country:
    netherlands
    Hi Patrick,

    After you have updated the MDL, you can just drag and drop the library XML to BGLComp to update the library. I don't think that would be an extra step.

    I think the other difference you see are mainly personal taste. For example I prefer to use the keyboard instead of the mouse (I even call bglcomp from the command prompt, instead of drag and drop). But it is indeed interesting to see that different people have different habits.

    It is not that I don't want to alter Library Creator XML with the logic you suggest, I just try to prevent that the code clutters with a lot of special cases that are not useful for most users. But I'll keep this on in mind.
  9. sfrenchie

    sfrenchie

    Joined:
    12/4/11
    Messages:
    766
    Country:
    unitedstates
    Excellent idea, I hadn't thought of that.

    Arno, I completely understand that. On top of cluttering there is also the issue of distribution/updates/etc. It can end up in a mess.

    Thanks for your interest in the topic.
  10. tgibson

    tgibson

    Joined:
    22/9/06
    Messages:
    4,306
    Country:
    us-california
    Hi Arno,

    When you create a scenery MDL in GMAX using MakeMDL, it also creates an XML file with the same name, containing the code for making it an FS2004 library object (if compiled). Library Creator X could look for that XML file with the same name, and use the GUID contained in the XML file. That way, the GUID assigned by MakeMDL would be used, and potential multiple GUIDs for the same object could be avoided. However, there should be an option for the user to allow use of this existing GUID, or have the program create a new one (in case this is the desire of the user). A popup window would work well in this case ("This MDL file has an existing GUID in an XML file. Do you want to use this existing GUID?".)

    Hope this helps,
  11. sfrenchie

    sfrenchie

    Joined:
    12/4/11
    Messages:
    766
    Country:
    unitedstates
    I like the idea, that was my original post however no more popups please :)
    Maybe an option in Settings, yes.
  12. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,237
    Country:
    netherlands
    Hi Tom,

    But if you decide to put the MDL in a library with Library Creator XML you are not using the XML made by MakeMDL at all are you? I always just delete them without looking at them. They are just a template you can use, but don't have to. MakeMDL does the same as Library Creator XML does, just create a new random GUID for the object.

    Maybe my way of working is completely different, but when I make an object, my first step is to put it in my own library that it will end up in. After that I will test, modify it, etc. When I make changes I just recompile the library with the latest MDL files.
  13. sfrenchie

    sfrenchie

    Joined:
    12/4/11
    Messages:
    766
    Country:
    unitedstates
    :rotfl: we are going around in circles. It is indeed about different workflow.
    Since my exchange of posts with Arno I have modified my train of thoughts a bit and work more with library in mind. If doesn't hurt.
  14. tgibson

    tgibson

    Joined:
    22/9/06
    Messages:
    4,306
    Country:
    us-california
    My point: There are indeed two different work flows, and they currently result in two different GUID's being generated. Our suggestion makes both GUID's the same.

    I think that is safest (to avoid missing objects in FS if someone switches from manual compilation of the GMAX XML file to using Library Creator X instead), but different GUID's work OK too in other circumstances.

    Of course, I just load my manual library XML file into Library Creator X and use that. :)

    Hope this helps,
  15. sfrenchie

    sfrenchie

    Joined:
    12/4/11
    Messages:
    766
    Country:
    unitedstates
    I do too and it is indeed an extra step. It would be nice to have the choice included in the application.

Share This Page