• 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 v5 ExportTVecBGL not creating a bgl

Messages
1,588
Country
unitedstates
I am testing to see if I can create high power transmission cables between towers. I am thinking using terrain vectors as a method to string the cables from pole to pole. For my tests I am using line data from some OSM powerlines and CreateTVecRailroad simply to see if I can get a script to create a railroad bgl. The area is small so I have tried it with 'Split Grid' as a typical step and without that. So far no luck.

Question - Should I leave my line data as a "line" or convert it first to a polygon? (I've tried both ways without success)

Here's my simple script:
ImportOGR|B:\CA\Section_70\Obstacles\CA_Section_70_powerLines.shp|*|*|NOREPROJ
ImportOGR|B:\CA\Section_70\Masks\CA_BV77_mask.shp|*|*|NOREPROJ

#SplitGrid|LOD13|* (tried with this included and left out - faster when not included)

AddAttribute|FROMFILE="CA_Section_70_powerLines.shp"|String;objType|power_line
BooleanFeatures|INTERSECTION|objType="power_line"|FROMFILE="CA_BV77_mask.shp"|1

LineToPolygon|objType="power_line"|1|String;polyType|railroad (tried with this included and with it left out)
CreateTVecRailroad|polyType="railroad"|{dde116bf-0e97-4eb6-a9ec-7ef93d9f2d0e}

ExportTVecBGL|B:\CA\Section_70\CA_BV77\Obstacles\PowerLines|Cables

Here is the results - You can see this issue is this line:
10:37 AM ExportTVecBGL Information unable to open shapefile .\rrxCables_0.shp

but I have never seen this error message before so not sure how to move forward.


Create vector bgl issue.jpg
 
Hi,

They are made from lines.

The event log contains a message that says the shp could not be opened, so it seems that's where the issue is. It seems scenProc made 13 lines. I'm not behind my PC now to check why that could go wrong.
 
Thanks, Arno for checking into this. A little sigh of relieve that I am on the right track with this script.

My next question is the step CreateTVecRailroad... will these steps ONLY for the type of vector in the steps name or can I replace railroads for whatever type of vector I want... in my case I hope to swap out railroads for cables?
 
Hi,

As you can see the only thing you can pass to the terrain vector railroads is a GUID. This is a class as defined in the terrain vector configuration file and basically determines which texture is drawn on the line, what the width is, etc. You can also configure that objects are placed along the line, e.g. to have lights along a road. But you can sort of limitated in what you can configure by how the terrain vectors works.

I think the utility line is probably most close to what you want. That is used to place the power pylons in the default scenery along lines.

As for the error from shp2vec, I do see that with my test script as well. I need to figure out what is broken.
 
Hi,

I just remembered where the error comes from. The shp2vec tool is broken in P3D v5 and v6 SDK, I guess you are probably using that SDK. You need to use the shp2vec tool from an older SDK and then it will work. I don't think the tool actually changed since FSX, so it does not matter which SDK you use.
 
Thx for the quick update. Yes, I am planning on using this for utility lines... but the actual lines (as well as the pylons which I have already created). When I tried this I did not see the CreateTVecUtility step. I guess my next question is will I be able to use an object and not a texture (one way to find out!). I suppose I could always create a cable from a texture but would prefer an object. I will use my P3Dv4 shp2vec and see how it goes.
 
When making utility lines you get objects only normally. By default it is the towers, but if you modify the terrain vector configuration you can probably get cables as well.
 
So I swapped out Shp2vec P3Vv5 for P3Dv4 and that is now working. However I cannot get my test cable to show up still as a cvx.

1. Question - Does the cable need/have to have a texture? The object is a simple black round solid tube.
2. I created a cable as an object. I did not create a texture for it as it is a solid black color and figured I would not need one. If I export it in scenProc as an autogen object it appears as it should following the line data.
3. I then edited the terrain.cfg file to include my cable. I then closed and restarted P3D to update the terrain.cfg file. I also did this with my scenProc script.
4. Using the step: CreateTVecUtility|objType="power_line"|{485678b9-95d1-4915-974c-2be003bd9fd6}. <-- My GUID for my cable. I right-click to see the drop down list of all the TVec's but my "cables" is not listed. Why? Could this be why I am not seeing it in P3D even though cvxCables.bgl is being created? The cable is in my default.xml file as an object (class & object GUIDs created... again it works as an autogen object).

I went back and edit the script to create a simple 2-lane road and that is working. The cars are moving between tpwers. I do not see the actual road on the ground but I believe that is because I am sing photoreal scenery which overrides that.

See anything that I am missing?
 
Hi,

The entries for the auto completion are read from the terrain.cgf file. Do you have the right FS version set as your preferred version in the scenProc options? Else it might be read from another FS version than you expect.

I never tried to place an object that why myself. I think in the terrain.cfg you probably need to refer to the GUID of the MDL, not the GUID of the autogen class in the default.xml file.
 
Did a lot of testing over the weekend which led me to some observations. First, I did double-check my scenProc options to ensure every path was pointing in the right direction. I have all paths pointing to P3Dv5 with the exception of shp2vec which now points to P3Dv4.

My script will create cvx bgls like roads, road bridges and railroad bridges. So I feel good about the script working as written. I can also create library object as autogen (my cable), so I know my mdl/bgl for the object is correct.

Question 1 - If the object/texture is NOT present in your scenProc cvx GUID drop-down list will scenProc skip in creating that object? Here is what I am noticing. My object is in the terrain.cfg file but is not in your list. But neither is any other AutoObjects in the file such as default telephone lines. Only "texture" type objects are shown in your list. When I tried to create cvx.bgl of the P3D default telephone lines nthe bgls are created but nothing is shown in P3D. Remind you these are default. So, it appears "AutoObjects" will not appear in your list or be created but"texture" types will show in the list and show in P3D.

Question 2 - Could it be because you have the step LineToPoint you figured you would not need a repeat of objects in the CreateTVec step? Thus scenProc ignores those in CreateTVex?

Question 3 - Why are there the different types of CreateTVec... railroad, road, utility? They are not hard coded as I was able to create a railroad bridge using the CreateTVecUtilty step?
 
Question 1 - If the object/texture is NOT present in your scenProc cvx GUID drop-down list will scenProc skip in creating that object? Here is what I am noticing. My object is in the terrain.cfg file but is not in your list. But neither is any other AutoObjects in the file such as default telephone lines. Only "texture" type objects are shown in your list. When I tried to create cvx.bgl of the P3D default telephone lines nthe bgls are created but nothing is shown in P3D. Remind you these are default. So, it appears "AutoObjects" will not appear in your list or be created but"texture" types will show in the list and show in P3D.
No, the code completion is only to help you. But any GUID you enter will be used in the BGL file.
You are right that only texture types are shown, because you can't place an object directly, they are used by the texture types as far as I know. But I would need to double check that.
Question 2 - Could it be because you have the step LineToPoint you figured you would not need a repeat of objects in the CreateTVec step? Thus scenProc ignores those in CreateTVex?
No, see comment above. The objects should be linked to the line/texture somehow. I don't think you can place them seperately as terrain vectors.
Question 3 - Why are there the different types of CreateTVec... railroad, road, utility? They are not hard coded as I was able to create a railroad bridge using the CreateTVecUtilty step?
Check the SDK, that's how the shp2vec tool works.
 
Ok, that is interesting answers. Regarding your answer to question 1, if what you say is correct how is it that bridges are created as they are objects and I don't see them attached to a ground texture. Looks like they are being placed directly.

Maybe I would need to create a transparent texture (if that is possible), and attach my cable object to that? Worth a try. I see they do this for adding telephone poles next to a road as an example.
 
Hi,

I just had a look at the terrain.cfg file. Most vector types in shp2vec reference a texture guid from the terrain file. The texture definition can reference certain objects with the VectorAutogen line in the texture entry. As far as I know that is how the terrain vectors work, I don't think you can reference the objects directly (but I must admit that I never tried that).

As far the bridges, I am not sure if I have ever seen bridges placed as terrain vectors. I believe most bridges in the default scenery are made with XML code.
 
Just thought I would show you that a default P3D object (the railroad bridge) can be used a CVX. This is created in scenProc. So why I am unable to see my object in the drop-down listing? Yes, I know you said it has no impact on the processing and is merely to make selection easier. I guess I would feel more comfortable if I could see it in the list. From what I have read it sure sounds like you can create custom CVX objects and textures? Still testing different Ideas.

Railroad bridge object used as a vector object.jpg
 
Did you add a new texture to the texture.cfg file? That should show up in the dropdown list for sure.

When you made the bridge, did you call a texture or an object from the texture.cfg file?
 
For the screenshot above, no, I did not add a texture. All I did was select railroad bridges from the drop-down list. And from what I can see that is an object not connected to any ground texture. ( thinking to myself, could it be that the tracks on the bridge are some form of elevated texture?) Why I cannot see why my cable object is not see in the drop-down list is still a mystery. I have tried both using its class GUID and its object GUID in scenProc but no go. Once again, the object IS recognizable if I create an autogen library object so I must have my GUIDs correct.

So my next approach is to see if I can "attach" my cable to a default railroad tracks texture. They explain this in the SDK (like adding telephone poles to a road texture). Studying the terrain.cfg on how they do this. If that works then I could replace the railroad texture with my own custom transparent texture. Not sure if I can even add a custom CVX ground texture or if everything is hard-coded?

For the texture test I have selected the railroads texture to represent my cables. Looks like they are running correctly. I had to remove my ground photo scenery in order for them to show up.

Using reailroad texture to show my cables.jpg


According to SDK, an xml is created for SHP2VEC to process. I take it scenProc is doing the same? I only bring this up because the GUID for railroads in the drop-down list is different that the GUIDs below:
<?xml version="1.0"?>
<metadata xml:lang="en">
<FlightSim>
<Geometry clipLevel="11"></Geometry>
<AttributeSet>
<AttributeBlock name="Railways" guid="{33239EB4-D2B8-46F5-98AB-47B3D0922E2A}">
<Field name="Uuid" type="GUID" />
</AttributeBlock>
<AttributeBlock name="Texture" guid="{1B6A15BB-05FB-4401-A8D1-BB520E84904C}">
<Field name="Guid" type="GUID" />
</AttributeBlock>
</AttributeSet>
</FlightSim>

</metadata>
 
Last edited:
GaryGB responded to my thread about texture paths and in doing so has provided a huge a huge an mount of resources on the subject of custom CVXs (thx Gary!), so I will be diving into that good mess, ha! Think I already see one reason why stuff is not showing. Maybe a "Christmas Miracle" :santahat:
 
Hi,

Yes, scenProc makes that kind of XML file for shp2vec and also writes the SHP files.

When you selected railroad_bridges you are using this texture entry from the texture.cfg file:

Code:
// Misc vector types - railroad bridges
[Texture.203]
Name=Railroad_Bridges
Color=FF808000
guid={02055F95-7075-463F-A3F9-BA9976869612}
LegacyId=1213
VectorAutogen={6DF183A5-1F4A-9C46-B708-A24D772FC75A} (Railroad Bridge 2 (aka gen_bridge05))
ExcludeAutogen=Yes
RenderToTexture=No
Water=No

It's the VectorAutogen line that links it to specifc objects to use for the bridge:

Code:
// Railroad Bridge 1 (aka gen_bridge02)
[Autogen.12.0.0]
guid={6DF183A5-1F4A-9C46-B708-A24D772FC75A}
LegacyId=12
AutoObject={18B41D45-749E-47F8-B6E5-133835D7CD57} (gen_bridge02_2)
AutoObjectEnd={9ED413C1-90DF-4635-84C9-FD3EDA671CFB} (gen_bridge02)
ObjectSize=50
ObjectEndSize=100
Offset=0
Density=100
MinAutogenDensity=20
PlaceOnWater=Yes
RandomHeading=No

So when you added your cables did you add both a texture and an autogen entry in the texture.cfg file?
 
That was going to be my next test., to "attach" my cable to a texture be it a default one to test or create one of my own. We're gettin' there I think.

Also just wanna wish you a happy Christmas and thanks for all your insight and help over the past several months. Maybe after the new year we can take a look at water detection once again. :)
 
That was going to be my next test., to "attach" my cable to a texture be it a default one to test or create one of my own. We're gettin' there I think.
Sounds like a good plan.
Also just wanna wish you a happy Christmas and thanks for all your insight and help over the past several months. Maybe after the new year we can take a look at water detection once again. :)
Best wishes to you as well. After the summer I started with a new MCX feature and that has kept me busy since then. It's a lot of fun :). Once it's done I'll see what thing to work on next, the water detection might be one.
 
Back
Top