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

<TooltipText> entry in modeldef.xml - Maybe a BUG?

Discussion in 'ModelConverterX' started by tonaz, 7 Dec 2017.

  1. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
    Hello
    i found out that if i use in my modeldef
    <TooltipText>Something</TooltipText>
    to display a mouse over, when i try to open again the model in MCX, that MouseRect is messed up, it looks like "custom_rec_...something_bla001", like MCX can't find it in the modeldef.
    And i have to put the correct one in MCX everytime.
    In the same exact element and code, if i dont use <TooltipText> everything is fine when i open the file again.
    Could be a bug?
     
  2. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,915
    Country:
    netherlands
    Hi,

    Could be a bug indeed. Are you using the latest development release? I fixed some bugs in that area a month or two ago or so.

    Else I need to check what is going on. If you have a small object that demonstrates the problem that would be easiest to debug.
     
  3. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
    Actually i dont know how to help you with this.
    You just could try to add the <TooltipText>Something</TooltipText> in any MouseRec of your modeldef, and replicate the problem.
     
  4. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,915
    Country:
    netherlands
    Ok, let me try that.
     
  5. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,915
    Country:
    netherlands
    Hi,

    I can't reproduce it here. I added a TooltipText to a definition here, but if you then export a MDL with that definition and read it in again it works fine.

    Which build of MCX are you using?
     
  6. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
    Version 1.4.0.0 8af44896 DEV 09 12 2017

    I really dont understand... if i add the tooltiptext tag, it happens this bug :-(
     
  7. Henk Schuitemaker

    Henk Schuitemaker

    Joined:
    31 May 2015
    Messages:
    57
    Country:
    netherlands
    I agree with Arno. Custom mouserec tags in MCX may have weird names (which I do not care for) but the tooltips in the exported MDL work fine in the sim.
     
  8. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,915
    Country:
    netherlands
    But I also don't get the weird name. Maybe you can post your modeldef.xml and mdl file for testing?
     
  9. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
    You say <Tooltip> tag, which actually works.
    I am saying <TOOLTIPTEXT> tag, that brings up the weird mouserec names.
    If you try to comment out all the <TOOLTIPTEXT> tags from modeldef, open the model again and recompile, you will find out that you will not have any weird names no more on next reopening.
    And by the way if you recompile the model with those weird names, and with tooltiptext tag, the mouse over tooltip WILL BE WRONG in the sim.
     
  10. Henk Schuitemaker

    Henk Schuitemaker

    Joined:
    31 May 2015
    Messages:
    57
    Country:
    netherlands
    Sorry, cannot replicate. Attached a small test model I just created with a custom mouserec using <TOOLTIPTEXT> and when I load it in MCX everything is OK, no weird tag name.
    I thought I did see the weird tag names but it must have been with an older beta I guess.
     

    Attached Files:

    Last edited: 12 Dec 2017 at 12:23
  11. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
    Using your modeldef, and opening your MDL this is what i see:
    https://pasteboard.co/GXSJNpm.jpg
    Can you see the name in MCX do not match the name you gave in modeldef...
     
  12. Henk Schuitemaker

    Henk Schuitemaker

    Joined:
    31 May 2015
    Messages:
    57
    Country:
    netherlands
    That is the same I see, modeldef name "custom_rec_Flaps_Auto_switch" shows in MCX as "custom_rec_FLAPS_SWITCH_00". This is not a problem for me, apparently MCX looks at the variable(s) used in the mouserec code and generates a friendly name from it.
     
  13. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
    Actually IT IS a problem. This means that the model compiler is not reading from your main modeldef.xml.
    But it is adding some extralines in the generated one during compiling!!!
    When you open again your model, it SHOULD have the names you gave in the modeldef!!!!!
    Arno? Am i right?
    I hope i am clear enough
     
  14. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,915
    Country:
    netherlands
    Hi,

    I'll try your example here as well, because with my example the name stays the same on import.

    The different name in MCX doesn't have to be a problem, it just indicates that no matching definition was found and that MCX constructed its own with the information from the mdl file.
     
  15. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,915
    Country:
    netherlands
    Hi,

    It's suspicious that your modeldef.xml seems to be completely empty. Are you sure the path in the options points to the right location?
     
  16. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
    it's Henk's example
    (which looks quite strange to me as well)
    The thing i am trying to explaing is, when you reopen your model it should read the correct definitions in modeldef, with matching names..
    damn, i will make a video explaining :D
     
  17. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
  18. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,915
    Country:
    netherlands
    Hi,

    Thanks for making the video, that was really useful. I think I know what is going on, let me try to explain.

    Inside the MDL file the name of the mouse rectangle is not stored, but all the other definitions are. So when MCX loads a MDL file it tries to find the mouse rectangle that matches the definitions and will use that name. When it can't find a matching definition it will make a custom one like you saw.

    But this also means that when you have an existing MDL file that uses a mouse rectangle and you change the definition in the modeldef.xml file, MCX will not find it It will still be looking for the old one that was stored in the MDL, not for the changes you just made. So in that case you will have to assign the correct mouse rectangle again in the hierarchy editor. After you export it again, it should find the mouse rectangle with the correct name again.

    Another thing to keep in mind is that MCX reads the modeldef.xml from disk when you start to import a model. If you change the file on disk after that, MCX is not aware of that. It will use the version in memory (to which it might have added new custom definitions already). So to be sure you use your latest version you would have to reload the model.

    Let me know if this makes things more clear,
     
  19. tonaz

    tonaz

    Joined:
    5 Nov 2013
    Messages:
    113
    Thanks for the exaustive explanation, everything is crystal clear (also the fact that you have to modify the modeldef first, which i already discovered in the past).

    The main goal of the video bytheway was to show you that MCX actually do read correctly the mouse rect, but it dont read it if there is the damned <ToolTiptext> !!!
    I showed you in the video that without that tag, everything is fine, and you can export the model hundred times and open it again and again without having the custom mouse rect namea that MCX adds.
    Maybe i am still missing something. Very puzzling.
     
  20. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,915
    Country:
    netherlands
    Hi,

    But I can't reproduce the ToolTipText issue, because here on my side it works. Just to double check after you add the ToolTipText in the modeldef.xml file, you first assign the mouse rectangle again in the hierarchy editor. Next you can export the MDL with the updated definitions. If you then load the new MDL file again the definition should be found.