P3D v4 Blender VC Gauge Texture Placement

#1
Hi,

I'm making my first VC in P3Dv4 with Blender. I have made my initial VC which shows in P3Dv4. I am trying to add textures to my gauges and they show in the blender render, but the textures do not show in sim. I am just trying to add a texture at the minute and then I will try adding a needle for the ASI.

Any guidance or pointers would be welcome.

 

tgibson

Resource contributor
#2
Have you added any other textures to your model and got them to show up in the sim or is this the first one? If the first one, what format is the BMP file you added to the sim's texture folder? You cannot use the standard 24 bit BMP file that most paint programs create. That will display in Blender, but not in the sim.

Another question - are you intending on having separate bitmaps for every gauge? This would be most inefficient, better to combine them all on one large bitmap.
 
#3
Hi,

I have added some textures for the external model which are visible from the VC. I also added a dummy panel to add 2D gauges using the $ identifier (pink and blue panel texture coloured for position checking). I am trying to make one 3D gauge at the moment as a test. I thought if I made each gauge individually with its own bitmap I could then keep them as stock drop them into future projects?

I have tried opening the bitmap in Image Tools and exporting it as 24 bit and also flipping it in DXTbmp. Also tried DTX1 format.

Do I need to bake it like the external textures?

I have done so many things now, I think I have confused myself on the process to make a texture.

 
#4
I deleted the ASI gauge and inserted a duplicate of one of the other blank gauges and UV mapped it to a new image without alpha and it now shows as black in the sim.

I added my ASI texture to the image and saved it as a 1024 x 1924, 24 bit RGB bitmap. It still shows in blender, but not in the sim.

 
#6
I have tried all day today, but I can't find what I'm doing wrong. I have used DDS files just like I did with the external textures, but despite everything I try. nothing shows up in P3Dv4.

I followed kpgamemods video "Blender to FSX(How to Use Texture Maps Part 1) and the only thing I can see is that at 13:49 into the video Krispy's ASI gauge becomes visible on the gauge face in Blender Edit Mode, whereas mine does not. It is only visible when I press shift+z to see the render.





 
#7
At last, I seem to have solved my problem and my texture now displays on the ASI. When I reviewed the material menu's the Custom Properties window had additional properties, which I think populated when experimenting with the Aircraft Material Params window and selecting "Is virtual cockpit panel texture". Removing the old material and starting from fresh without selecting "Is virtual cockpit panel texture", resulted In the texture appearing in the sim.





Animation of the ASI needles next.
 

n4gix

Resource contributor
#8
That "Is virtual cockpit panel texture" parameter is only used whenever you wish to display a gauge from either a .gau/.dll file or an XML file.
 
#10
Please can someone help me with my ASI needles that do not seem to appear in sim as I can't see what I am doing wrong. Also my other animations for the VC do not display in sim when I add the ASI needles. If I remove the needles from my blender model, the other animations return.

I have added two needles to my ASI. The longer needle is on a scale of 0 to 100 and the shorter needle on a scale of 0 to 1,000. I have tried keyframe lengths of 100 and 500, but reverted to 200 as this seemed to be the default. Keyframe 0 at 0 degrees and zero knots. Keyframe 100 at 180 degrees and either 50 knots or 500 knots depending on needle and then keyframe 200 at 360 degrees for 100 knots and 1,000 knots.

I have added the code below to my modeldef file and it initializes in blender ok.


XML:
<Animation name="needle_asi_p111a"                      guid="7e4ca4d3-2d74-4433-819a-33f77daeba10" type="Sim" typeParam="AutoPlay"  length="200" typeParam2="needle_asi_p111a" />
    <PartInfo>
    <Name>needle_asi_p111a</Name>
    <AnimLength>200</AnimLength>
    <Animation>
      <Parameter>
        <code> (A: AIRSPEED INDICATED,KNOTS) 0.2 *</code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_AIRSPEED_KNOTS</TooltipID>
    </MouseRect>
  </PartInfo>
   
    <Animation name="needle_asi_long"                      guid="c5af7e87-be3c-448b-6795-dbc99d711913" type="Sim" typeParam="AutoPlay"  length="200" typeParam2="needle_asi_long" />
    <PartInfo>
    <Name>needle_asi_long</Name>
    <AnimLength>200</AnimLength>
    <Animation>
      <Parameter>
        <code> (A: AIRSPEED INDICATED,KNOTS) 2 *</code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_AIRSPEED_KNOTS</TooltipID>
    </MouseRect>
  </PartInfo>

 
Last edited:
#11
Could be the empty space in your variable call. Change:
Code:
(A: AIRSPEED INDICATED,KNOTS) 0.2 *
to:
Code:
(A:AIRSPEED INDICATED,KNOTS) 0.2 *
see if that helps.
 

n4gix

Resource contributor
#12
That is most likely the problem. Even the tiniest extra 'space' will kill all animations following the error. Here is one I caught yesterday morning. Note the extra 'space' before the comma:
Code:
  <PartInfo>
    <Name>ATR_CAPT_Wiper_Anim</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:CAPT_WIPER_POS ,number)
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>
 
#13
Thank you both, that fixed the problem. Both needles and all other animations now displaying in sim.

The 100's needle works fine, but the 10's needle only completes the first 360 degree rotation for the first 100 knots and then stops at 360 degrees and then rotates anti-clockwise again as the airspeed drops below 100 knots.

Is there any way to keep the 10's needle rotating for every 100 knots?

 
#14
Code:
(A:AIRSPEED INDICATED,KNOTS) 100 % 2 *
By taking the modulo (100 %), you make sure that the variable stays within its range. Also, make sure not to use <lag> for any animations that are supposed to turn around 360 degrees.

Btw. why did you settle on an animation length of 200? I always scale my animation in a way that the math is easier. So in this case it'd make sense to have an AnimLength of 100 and you can save one operation:
Code:
(A:AIRSPEED INDICATED,KNOTS) 100 %
 
#16
Thank you. I will try adding the 100%.

I chose 200 animation length to reduce the amount of changes that might be causing it to not display. After the help I was given, I think it was the extra space and lack of capital C that was stopping it.

I will try going back to 450 animation length for the short needle and 100 for the long needle.
 

n4gix

Resource contributor
#19
Is that actually still a thing? I always thought that the sim interpolates the keyframes in between anyway.
Just for giggle and grins, I once animated what would normally require 100 frames to use only 4* frames. It still worked perfectly! So yes, the sim will interpolate the keyframes. :teacher:

Actually, I suspect one could get away with only 2 frames, but I didn't try it out.

*NB: 4 frames because of the need to have intermediate keys:
0 = 0
1 = 25
2 = 50
3 = 75
4 = 100
 
Top