P3D v4 Console Based or scriptable MCX

Hello
@arno your MCX is really useful when it comes to access some libraries and update them.
I was working on updating some Libraries to PBR for P3D 4.5 and the library had 31 objects and I had to update only 2 objects so exporting all models manually and making the library again was time taking
what I think that we need is a new tool like scene proc that help us access the libraries or placements objects and update them, think of what we can do with it like scene proc does, it's limitless and can help many of us updating existing sceneries or converting sceneries to other sims (fsx to P3D or fs9 to P3D ............................... even xpl).

hope you like my suggestion.

or if you can, you can make a C# library that contains functions like read models and converting them to different sims and let the community be creative, this can give many people the opportunity making some tools that will help them winning time.

thnx in advance :)

PS: NO need for rendering, the read model data is enough as it helps to render anyway.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

Did you have a look at the batch convert wizard in MCX already? I can help you to make certain changes to a lot of models at the same time.

When working on a library you can also just load the BGL file in MCX and then save the BGL file again after making the changes. No need to save each model individually first.

Some other tool developers already use the libraries I made for my tools in their tools. Mainly for the preview rendering part, but sometimes also for other functions. So that is always an option.
 
i didn't try to use the libraries included in MCX folder i'll maybe check them out

how can i delete a model from a library in MCX and replace it with an other one without exporting anything?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
You can't change a model without exporting everything. MCX works on an internal data representation. So you always need to export everything. If you want to replace a model like that you would have to decompile the BGL and swap MDL files.

P.S. Distributing of the MCX DLL files is only allowed after permission from me, so if you make a useful tool please be sure to check that first.
 
You can't change a model without exporting everything. MCX works on an internal data representation. So you always need to export everything. If you want to replace a model like that you would have to decompile the BGL and swap MDL files.

P.S. Distributing of the MCX DLL files is only allowed after permission from me, so if you make a useful tool please be sure to check that first.
can you help me to make my own tool, I wanna just decompile a library then extract all MDL and replace MDLs I select with my MDLs, doing everything manually is hard as the libraries i work with are so big
 

tgibson

Resource contributor
I'm not sure what the problem is, I do this all the time. Yes, you have to Export the library BGL again but that is not a problem, is it?

1. Import the Library. (Back up this file first.)
2. If you are replacing objects and want to retain the same GUID numbers:
3. Click the green arrows until you find an object you want to replace.
4. Click the Object Information button, and press the Edit button. Copy the GUID and paste it into a text document (you'll need it later). Make sure you describe which object this is in the text file next to the GUID.
5. Repeat this for all objects you want to replace.
6. Click the Scenery Objects Editor button (next to the green arrows).
7. Find the object(s) you want to replace and click them. Click the Remove Object button. Repeat for all objects to be replaced.
8. Click the Add Object button and browse to your replacment MDL file. Click it. Click OK. Repeat for all objects to be replaced.
9. Use the green arrows to find a replaced object. Click the Object Information button, and the Edit button.
10. Copy the object's GUID from the text file and paste it, overwriting the existing GUID. Press the Edit button.
11. Repeat this for each replaced object.
12. Use *Export Scenery* and save it with the same name and a BGL sim format, overwriting your old library BGL file (you did back it up, right?). Now your updated objects will display instead of the originals.

Hope this helps,
 

tgibson

Resource contributor
Of course this would be made SO MUCH easier if the Scenery Objects Editor would only have a Replace Objects choice, which replaces an object in one step, retaining the existing GUID. :)
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Of course this would be made SO MUCH easier if the Scenery Objects Editor would only have a Replace Objects choice, which replaces an object in one step, retaining the existing GUID. :)
That's probably only a few lines of code to add, I'll see if I can add something :)
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
can you help me to make my own tool, I wanna just decompile a library then extract all MDL and replace MDLs I select with my MDLs, doing everything manually is hard as the libraries i work with are so big
That would be more complex than it sounds in code as well :). MDL does not work with MDL files, it reads the objects (and other information from the BGL file) into an internal scenery representation. So to do this you would have to read both the BGL and the MDL files you want to use into such a representation. Then you can start to manipulate the internal representation to the result you want. But you manually have to take care of things like GUIDs, placements that don't get corrupt, etc. So probably easier to just use MCX :)
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
That's probably only a few lines of code to add, I'll see if I can add something :)
1561495937663.png


I'm currently on business trip, so it will be a few days before it's in the development release...
 

tgibson

Resource contributor
Hi,

Yes, it's there. It's the button just to the right of the green arrows. Make sure you are using the latest development version, NOT the stable version.
 
Top