Can I place a MDL objects located in a BGL library file using SCASM?

#1
Hello everyone

The title says it all.

I have a BGL library file with four MDL objects, all the same but with different texture/color. This a BGL file created with Library Creator.

I would like to display (in P3Dv4) the red object in summer, the blue in winter etc. I don't see any possible way to do that with XML code. Only SCASM seems able to do that.

How can I use my MDL object with a FSX GUID from the BGL library file in SCASM ?

If it's not possible, is a placement with SODE my only solution ?

Thanks
 

=rk=

Resource contributor
#3
If this is P3Dv4 and the model object is the same, you can use the conditional visibility feature of P3D to render different textures, according to season.
 
#6
Rick

I did add the condition to modeldef.xml

I did add the condition within the hierarchy editor of MCX.

How the hell do I save that in the mdl file ? I tried to export but Visibility gets back to "none"
 

=rk=

Resource contributor
#7
You have to use the hierarchy editor to find the textured part and select the visibility condition there, before compile.
 
#8
FYI: Even if one used SCASM / ASM code with conditional display to call MDL objects packaged in BGLComp-XML scenery library object format BGLs compiled by SDK BGLComp (rather than as legacy non-MDL 3D objects packaged in scenery library object 'LibObj' format BGLs compiled by SCASM / BGLC, we could not be certain if future versions of P3D would continue to support such SCASM /ASM code, as L-M has made it clear they want to discontinue support of that type of scenery object code method.

It was only after an initial protest was made by the FS Development community when intended deprecation of SCASM code was announced for future versions of P3D, that L-M granted an 'extension' of SCASM / ASM -type G-Poly retro-compatibility in the currently available P3D run time rendering engines. :pushpin:

GaryGB
 
Last edited:
#9
Thanks guys

Rick, I want the FULL object to be visible / invisible depending on season. So I select the SceneGraphNode in the Hierarchy Editor in MCX and set the visibility condition on the right side. How the hell do I compile afterwards ?

Gary, I got your point. But if I want to do this, how should I do this ? What is the code I have to use in the scasm to refer to the MDL file ?

Thanks
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#10
After setting the visibility condition you can just export to mdl again and the condition should be stored. Which MDL format you export to?
 
#12
Arno

I think I made it work. The only point is that it's not really dynamic as simobject placement with SODE, meaning that the visibility condition is tested only once, when scenery is loaded, but no more after that. So you can't really use it for object that have to show up / diasppear at dawn or dusk for example.

One question about modeldef.xml, as it is not clear for me at all : this file is kind of a repository for visibility conditions and other stuff, but once these conditions are embedded in the mdl file modeldef.xml is not needed anymore, right ?

One suggestion to improve modelconverterx, if I may : when you set a visibility condition at the scenegrahnode level in the hierarchy editor, it's useless and it's not populating any modelpart below. Since an object can have many modelparts, it would be cool that changing the visibility conditions for the scenegraphnode, populates all the modelparts. What do you think ?

Do you have any insight from LM that they will accept more conditions than simple environnement conditions in any future versions of the SDK ?

Many thanks for your help and amazing tools

Greg
 
#13
Back to the initial question, I still don't understand if you can"call" an mdl file (by it's name or its GUID) in a SCASM file ... Any idea on this ? Except than converting the mdl in scasm code and inserting the code in the scasm.... SCASm has this cool feature that it can change sceney dynamically, starting with teh ifvarrange instruction ....
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#14
Hi,

You can apply the visibility condition on a parent node and then it will apply to all children. So no need to copy it to all modelparts.

Modeldef.xml is only used by xtomdl, once you made the mdl it's not needed to run the scenery anymore.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#15
Back to the initial question, I still don't understand if you can"call" an mdl file (by it's name or its GUID) in a SCASM file ... Any idea on this ? Except than converting the mdl in scasm code and inserting the code in the scasm.... SCASm has this cool feature that it can change sceney dynamically, starting with teh ifvarrange instruction ....
It's a long time ago, but if I remember correctly SCASM won't work with FSX style library bgl files, they need to be old style libraries. SCASM is really old now, I would not start using it anymore.
 
Top