• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 visibility conditions for scenery objects

Messages
5,214
Hi Arno,
In a scenerydesign.org thread of 2017, you mentioned a possibility to add visibility conditions to the model.def.xml where you then have to add it in the hierarchy editor to the model part visibility conditions. However, I do not know if you implemented it in MCX as there is no possibility to write in visibility conditions other than the ones that come in a drop down menu!
 

tgibson

Resource contributor
Messages
11,327
Country
us-california
I believe you can write them by hand into the file in the SDK and then MCX will read that? Or perhaps you can do it in the MCX ModelDef.xml Editor?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi,

If you add them to the modeldef.xml file, the drop down menu in the hierarchy editor will be updated to include them. The menu is build from the modeldef.xml content. To be safe you maybe need to open the hierarchy editor again after you modified the modeldef.xml file.
 
Messages
5,214
Right. As the hierarchy editor did not update to include them, I guess I must have made a mistake in the xml.
But thanks for the info.
 
Messages
5,214
But now I cannot even edit the modeldef.xml any longer. The minute I try to add a <, it throws an error: "Naam kan niet beginnen met het teken (name cannot start with the symbol).
I do not get it :confused:.
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
Please show us your XML, I'm sure it's a matter of syntax. You probably have the less than symbol in the wrong position. I have sucessfully modified the modeldef.xml, in order to produce sunglasses that render only during the day, so it does work.
 
Messages
5,214
Like in this thread of Scenerydesign.org: https://www.scenerydesign.org/2017/07/prepar3d-v4-visibility-conditions-for-scenery/
modeldefxml error.jpg
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
Ok great, except to duplicate my results, I'm pretty sure you'd need to start with your default modeldef.xml and add entries to that. Try this thread for ideas.
 
Messages
5,214
Bless you, Rick.
That default modeldef.xml was where I had gone wrong (using the wrong adapted default modeldef.xml).
Now that it works in MCX, I still have to find out if it works in P3Dv4.5 (or not:()!
Will know after dinner.
Thanks a bunch.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
I'll check if typing a new condition works usually I just modify an exiting one.
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
Yes, new visibility conditions can be added. Both Arno's original example on his blog and my daytime condition, are written as new entries. I am sure it is a matter of syntax, you could probably copy/paste the entry on Arno's blog and then replace your visibility condition with his.
 
Messages
5,214
Probably you are right but I can not. I have to add the extra entry to the default modeldef.xml before I can edit anything.
Wish I knew what I am doing wrong.
Refer to this other thread as to how I feel like for the moment: a dumbfounded ass on a swabbering (neologism!) dinghy that is wondering how the heck he got himself there and how to get back to the mainland.
And no, the seasonal GP poly never shows up or it shows up all the time.
The problem is that I cannot find out whether it works or not until I shut down P3D, start it again, wait for 15 minutes and then find that it does not work.
When I load the mdl again there are no modeldef.xml entries any longer. So I have to start from scratch again and that has taken me about the whole day (the weather is bad so I had time) to do it, but to no avail.
I know I am probably doing something wrong but I have not the faintest what unless I can get some further help of some ass loving :):D experts of it over here.

PS: I cannot copy or paste, I does not work in MCX.
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
Ok, no problem, first off. You can edit the modeldef.xml in Notepad and since MCX loads from it, I usually make my edits outside MCX. Also, to save time, you can modify a model in MCX, while P3D runs and then call the new model from within the running P3D session. I know this from running many trial and error cycles with my glasses model and I see that you say that you intend to work with a GP - so - if this test and reload cycle does not work with a scenery ground polygon, which I believe it should, you can, for testing purposes, compile as a model object and test that way, until you have the vis condition right, then compile as a valid ground polygon.

Finally, it would probably be best to see what you have so far, if you could upload your modeldef.xml.
 
Messages
5,214
Here is my modeldef.xml entry:

<PartInfo>
<Name>season_winter_snow</Name>
<Visibility>
<Parameter>
<Code>
(E:ZULU MONTH OF YEAR, number) 10.0 &gt;= (E:ZULU MONTH OF YEAR, number) 3.0 &lt;= and if{ 1 } els { 0 }
</Code>
</Parameter>
</Visibility>
</PartInfo>
 
D

Deleted member 1281

Guest
Well, how can anything be greater than 10 and less than 3?

Why don't you use (or adapt) the ready-made vis called season_winter (in the 4.5 modeldef), which correctly has an 'or' as the only logical logical connective:

Quote:
Code:
         (E:ZULU MONTH OF YEAR, number) 12.0 &gt;= (E:ZULU MONTH OF YEAR, number) 2.0 &lt;= or if{ 1 } els{ 0 }
 
Last edited by a moderator:
Messages
5,214
Thanks, mjahn.
Did that already. Did not work. But I probably did something wrong once more (like forgetting to change the entry in the hierarchy editor). Checking once more.
Other question: how do you point your modeldef.xml path to some changed path. I do not seem to find any way to do that (I copied the original modeldef.xml to my temp folder where I add and make changes).
And my final question: How do you change the modeldef.xml entries AFTER you have used the GPW? MCX does not honor them as far as my experience goes.
 
D

Deleted member 1281

Guest
As long as the MCX path is set up correctly, why change it. Just make a backup copy of the current modeldef, edit it, and see if your new code is accessible. Other than that I am out of my comfort zone; scenery isn't my thing.
 

tgibson

Resource contributor
Messages
11,327
Country
us-california
Hi,

I think you have to reload the object to be converted before the modeldef file will change with your edits.

You set the path to the modeldef file in Options/FS Related Settings/ModelDefPath.

Hope this helps,
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
Well, how can anything be greater than 10 and less than 3?
Via this logic sir:

(E:ZULU MONTH OF YEAR, number) 12.0 &gt;= (E:ZULU MONTH OF YEAR, number) 2.0 &lt;= or if{ 1 } els{ 0 }
[/CODE]

Above is a direct copy/paste from the default P3Dv4.4 seasonal visibility condition section of the modeldef.xml. It goes without saying that it works, as written. Us scenery guys naturally recognize the implied sequencing of the calendar months, 1 through 12.

Other question: how do you point your modeldef.xml path to some changed path. I do not seem to find any way to do that (I copied the original modeldef.xml to my temp folder where I add and make changes).
Please don't trouble yourself with this step. I have applied a very similar variation of the above code to the attached modeldef.xml. Please locate the existing modeldef.xml to which MCX points, rename that file and place the attached file there. The next time you open MCX, the condition "season_winter_snow" will be available in the hierarchy editor. I do not specifically know how to apply the condition to a ground polygon. Could you not create the GP, re-import it and again compile it with the visibility condition applied?
 

Attachments

  • modeldef.zip
    58.2 KB · Views: 455
Top