"GraphicDatabase.Get<Graphic_Multi>" drawSize argument seems to do nothing

Started by Thirite, November 12, 2016, 09:41:45 AM

Previous topic - Next topic

Thirite

I'm playing around with detouring the PawnGraphicSet class and have noticed when trying to change the scale of a pawn's hair, I get no effect.

eg:
_this.hairGraphic = GraphicDatabase.Get<Graphic_Multi> (_this.pawn.story.hairDef.texPath, ShaderDatabase.Cutout, new Vector2(2,2), _this.pawn.story.hairColor);

afaik this ought to draw the hair at twice the size but it does literally nothing. I know the script is being executed but nothing changes when I modify that argument- to Vector2.zero or whatever. Any clues?

mrofa

Draw size is changed in Draw() function, i think its in pawn rederer
All i do is clutter all around.

Thirite

So the value given by PawnGraphicsSet is not actually used? That seems bizarre. I'll have to look at the PawnRenderer class when I get home today.

1000101

Not all graphics classes use all fields.  Decompile the specific graphics class to see what it does, how it does it and what data can be fed into it (xml).
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Thirite

It seems DrawMeshNowOrLater doesn't take a scale or transform argument. But I wonder how do young animals get scaled then? Decompiled RenderPawnInternal method in case anyone is interested in having a quick look. I'm sort of at a loss.

kaptain_kavern

I don't know about C# but in the XML files you define a graphic drawsize and path for each lifestages.

    <lifeStages>
      <li>
        <label>yorkshire terrier puppy</label>
        <bodyGraphicData>
          <texPath>Things/Pawn/Animal/YorkshireTerrier/YorkshireTerrier</texPath>
          <drawSize>0.48</drawSize>
        </bodyGraphicData>
        <dessicatedBodyGraphicData>
          <texPath>Things/Pawn/Animal/Dessicated/CritterDessicatedSmall</texPath>
          <drawSize>0.48</drawSize>
        </dessicatedBodyGraphicData>
      </li>
      <li>
        <bodyGraphicData>
          <texPath>Things/Pawn/Animal/YorkshireTerrier/YorkshireTerrier</texPath>
          <drawSize>0.75</drawSize>
        </bodyGraphicData>
        <femaleGraphicData>
          <texPath>Things/Pawn/Animal/YorkshireTerrier/YorkshireTerrier</texPath>
          <drawSize>0.73</drawSize>
        </femaleGraphicData>
        <dessicatedBodyGraphicData>
          <texPath>Things/Pawn/Animal/Dessicated/CritterDessicatedSmall</texPath>
          <drawSize>0.75</drawSize>
        </dessicatedBodyGraphicData>
      </li>
      <li>
        <bodyGraphicData>
          <texPath>Things/Pawn/Animal/YorkshireTerrier/YorkshireTerrier</texPath>
          <drawSize>0.9</drawSize>
          <shadowData>
            <volume>(0.20, 0.3, 0.20)</volume>
            <offset>(0,0,-0.08)</offset>
          </shadowData>
        </bodyGraphicData>
        <femaleGraphicData>
          <texPath>Things/Pawn/Animal/YorkshireTerrier/YorkshireTerrier</texPath>
          <drawSize>0.89</drawSize>
        </femaleGraphicData>
        <dessicatedBodyGraphicData>
          <texPath>Things/Pawn/Animal/Dessicated/CritterDessicatedSmall</texPath>
          <drawSize>0.9</drawSize>
        </dessicatedBodyGraphicData>
      </li>
</lifeStages>

Thirite

I'll have to track down where the bodyGraphicData for non-humanlikes gets used. Clearly the drawSize is used there