Modding:How To Find A Virtual Texture: Difference between revisions

From Baldur's Gate 3 Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 24: Line 24:
   
   
                      <attribute id="AttachBone" type="FixedString" value="" />
                      <attribute id="AttachBone" type="FixedString" value="" />
                     <attribute id="AttachmentSkeletonResource" type="FixedString" value="" />
                     <attribute id="AttachmentSkeletonResource" type="FixedString" value="" />
                     <attribute id="BlueprintInstanceResourceID" type="FixedString" value="" />
                     <attribute id="BlueprintInstanceResourceID" type="FixedString" value="" />
                     <attribute id="BoundsMax" type="fvec3" value="0.5363549 1.713599 0.176041" />
                     <attribute id="BoundsMax" type="fvec3" value="0.5363549 1.713599 0.176041" />
                      <attribute id="BoundsMin" type="fvec3" value="-0.5405712 0.6668076 -0.219203" />
                      <attribute id="BoundsMin" type="fvec3" value="-0.5405712 0.6668076 -0.219203" />
                     <attribute id="ClothColliderResourceID" type="FixedString" value="" />  
                     <attribute id="ClothColliderResourceID" type="FixedString" value="" />  
                    <attribute id="HairPresetResourceId" type="FixedString" value="" />
                    <attribute id="HairPresetResourceId" type="FixedString" value="" />
                     <attribute id="HairType" type="uint8" value="0" />
                     <attribute id="HairType" type="uint8" value="0" />
                     <attribute id="ID" type="FixedString" value="8e7bcc4a-2b65-d704-1cf0-a1a3bc8b8bd3" />  
                     <attribute id="ID" type="FixedString" value="8e7bcc4a-2b65-d704-1cf0-a1a3bc8b8bd3" />  
                     <attribute id="MaterialType" type="uint8" value="44" />
                     <attribute id="MaterialType" type="uint8" value="44" />
  '''                  <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_C_Body" /> (bolded for importance!)'''
  '''                  <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_C_Body" /> (bolded for importance!)'''
[cut for length]




We scroll down and find
We scroll down and find


                             <attribute id="LOD" type="uint8" value="0" />
        <attribute id="LOD" type="uint8" value="0" />
   
     '''<attribute id="MaterialID" type="FixedString" value="57a6fd6e-c00d-60eb-5e52-31560b95332b" />'''
                             '''<attribute id="MaterialID" type="FixedString" value="57a6fd6e-c00d-60eb-5e52-31560b95332b" />'''
          <attribute id="ObjectID" type="FixedString" value="HUM_M_ARM_Bandit_C_Body.HUM_M_ARM_Bandit_C_Body_Mesh.0" />
             </node>
                             <attribute id="ObjectID" type="FixedString" value="HUM_M_ARM_Bandit_C_Body.HUM_M_ARM_Bandit_C_Body_Mesh.0" />
   
                       </node>


The material ID is what we need. We scroll back up to the start of the file and search that.
The material ID is what we need. We scroll back up to the start of the file and search that.
Line 62: Line 48:


                  <node id="Resource">
                  <node id="Resource">
                     <attribute id="DiffusionProfileUUID" type="FixedString" value="" />
                     <attribute id="DiffusionProfileUUID" type="FixedString" value="" />
                     <attribute id="ID" type="FixedString" value="57a6fd6e-c00d-60eb-5e52-31560b95332b" />
                     <attribute id="ID" type="FixedString" value="57a6fd6e-c00d-60eb-5e52-31560b95332b" />
                     <attribute id="MaterialType" type="uint8" value="22" />
                     <attribute id="MaterialType" type="uint8" value="22" />
   
                   <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_A_Body" />
'''                   <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_A_Body" />'''
 
 
And we do see that it shares a texture with the other bandit models.
And we do see that it shares a texture with the other bandit models.


At the end of the material we find
At the end of the material we find


 
             <node id="VirtualTextureParameters">                  
                        <node id="VirtualTextureParameters">
              <attribute id="Enabled" type="bool" value="True" />
                     
              <attribute id="ExportAsPreset" type="bool" value="True" />
                        <attribute id="Enabled" type="bool" value="True" />
              <attribute id="GroupName" type="FixedString" value="Texture Map" />
           '''<attribute id="ID" type="FixedString" value="d53fa1a1-aa8e-2564-1077-42f6c36086c5" />'''
                             <attribute id="ExportAsPreset" type="bool" value="True" />
              <attribute id="Index" type="int32" value="0" />
             <attribute id="ParameterName" type="FixedString" value="virtualtexture" />
                             <attribute id="GroupName" type="FixedString" value="Texture Map" />
                </node>
   
                           '''<attribute id="ID" type="FixedString" value="d53fa1a1-aa8e-2564-1077-42f6c36086c5" />'''
                             <attribute id="Index" type="int32" value="0" />
                              <attribute id="ParameterName" type="FixedString" value="virtualtexture" />
                          </node>




Line 100: Line 72:
   
   
                     '''<attribute id="GTexFileName" type="FixedString" value="b049a62336641c449903f6ec8b4dae67" />'''  
                     '''<attribute id="GTexFileName" type="FixedString" value="b049a62336641c449903f6ec8b4dae67" />'''  
                     <attribute id="ID" type="FixedString" value="d53fa1a1-aa8e-2564-1077-42f6c36086c5" />
                     <attribute id="ID" type="FixedString" value="d53fa1a1-aa8e-2564-1077-42f6c36086c5" />
                     <attribute id="Localized" type="bool" value="False" />
                     <attribute id="Localized" type="bool" value="False" />
                     <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_A_Body" />
                     <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_A_Body" />
                     <attribute id="Prefetch" type="bool" value="False" />
                     <attribute id="Prefetch" type="bool" value="False" />
                     <attribute id="PrefetchMipLevel" type="int8" value="-1" />
                     <attribute id="PrefetchMipLevel" type="int8" value="-1" />
                     <attribute id="ReferencedColorSpaces" type="uint32" value="6" />
                     <attribute id="ReferencedColorSpaces" type="uint32" value="6" />
                     <attribute id="SourceFile" type="LSString" value="" />
                     <attribute id="SourceFile" type="LSString" value="" />
                      <attribute id="VirtualTextureLayerConfig" type="uint32" value="3" />
                      <attribute id="VirtualTextureLayerConfig" type="uint32" value="3" />
                     <attribute id="_OriginalFileVersion_" type="int64" value="144115205255725056" />
                     <attribute id="_OriginalFileVersion_" type="int64" value="144115205255725056" />
                 </node>
                 </node>



Revision as of 14:26, 2 January 2024

This tutorial requires Modder's Multitool, LSLib v19 and a knowledge of how to find things with the multitool.

How to find the mesh

First thing you need to find the item is its name -the exact item name it has. For example, 'The Deathstalker Mantle'.

Put the name(or the NPC's name, to lead you to their CharacterVisuals entry) in the modder's multitool index search. This should lead you to its entry in the english.loca file.

Take the handle (a handle is h[string of numbers], similar to an UIID) and search that.

This should lead you to the roottemplate of the item. (if it doesnt have one in the roottemplate, it's in the parenttemplate's file instead)

You can then find its mesh mapkey. Search that and you should find the meshes lsx entry.(You can skip the above if you know the mesh name.)

Finding it with the mesh name

Search the mesh name. You may need to append it with HUM_M_ instead of whatever race you are looking for, as most of the gtex are under hum m arm meshes. The same applies with HUM F and female specific meshes. Some meshes also share textures so you may need to remove the _a or _broken appendage if you aren't getting any matches.

We like 'HUM_M_ARM_Bandit_C_Body' so we search this in the multitool.

It has an entry in Shared\Public\Shared\Content\Assets\Characters\Humans\[PAK]_Male_Armor\_merged.lsf' so we click convert & open' for that.

We CTRL+F HUM_M_ARM_Bandit_C_Body and find a mesh entry for it.

  <node id="Resource">

                    <attribute id="AttachBone" type="FixedString" value="" />
                   <attribute id="AttachmentSkeletonResource" type="FixedString" value="" />
                   <attribute id="BlueprintInstanceResourceID" type="FixedString" value="" />
                   <attribute id="BoundsMax" type="fvec3" value="0.5363549 1.713599 0.176041" />
                    <attribute id="BoundsMin" type="fvec3" value="-0.5405712 0.6668076 -0.219203" />
                   <attribute id="ClothColliderResourceID" type="FixedString" value="" /> 
                   <attribute id="HairPresetResourceId" type="FixedString" value="" />
                   <attribute id="HairType" type="uint8" value="0" />
                   <attribute id="ID" type="FixedString" value="8e7bcc4a-2b65-d704-1cf0-a1a3bc8b8bd3" /> 
                   <attribute id="MaterialType" type="uint8" value="44" />
                  <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_C_Body" /> (bolded for importance!)


We scroll down and find

       <attribute id="LOD" type="uint8" value="0" />
    <attribute id="MaterialID" type="FixedString" value="57a6fd6e-c00d-60eb-5e52-31560b95332b" />
        <attribute id="ObjectID" type="FixedString" value="HUM_M_ARM_Bandit_C_Body.HUM_M_ARM_Bandit_C_Body_Mesh.0" />
           </node>

The material ID is what we need. We scroll back up to the start of the file and search that.

We find

                <node id="Resource">
                   <attribute id="DiffusionProfileUUID" type="FixedString" value="" />
                   <attribute id="ID" type="FixedString" value="57a6fd6e-c00d-60eb-5e52-31560b95332b" />
                   <attribute id="MaterialType" type="uint8" value="22" />
                 <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_A_Body" />

And we do see that it shares a texture with the other bandit models.

At the end of the material we find

            <node id="VirtualTextureParameters">                    
            <attribute id="Enabled" type="bool" value="True" />
            <attribute id="ExportAsPreset" type="bool" value="True" />
            <attribute id="GroupName" type="FixedString" value="Texture Map" />
         <attribute id="ID" type="FixedString" value="d53fa1a1-aa8e-2564-1077-42f6c36086c5" />
            <attribute id="Index" type="int32" value="0" />
            <attribute id="ParameterName" type="FixedString" value="virtualtexture" />
              </node>


So we search d53fa1a1-aa8e-2564-1077-42f6c36086c5. Luckily for us it is in the same file. (If it isn't you may need to search the multitool with it.


<node id="Resource">

                   <attribute id="GTexFileName" type="FixedString" value="b049a62336641c449903f6ec8b4dae67" /> 
                   <attribute id="ID" type="FixedString" value="d53fa1a1-aa8e-2564-1077-42f6c36086c5" />
                   <attribute id="Localized" type="bool" value="False" />
                   <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_A_Body" />
                   <attribute id="Prefetch" type="bool" value="False" />
                   <attribute id="PrefetchMipLevel" type="int8" value="-1" />
                   <attribute id="ReferencedColorSpaces" type="uint32" value="6" />
                   <attribute id="SourceFile" type="LSString" value="" />
                    <attribute id="VirtualTextureLayerConfig" type="uint32" value="3" />
                   <attribute id="_OriginalFileVersion_" type="int64" value="144115205255725056" />
               </node>

b049a62336641c449903f6ec8b4dae67 is the correct string. Now you can extract it from the virtual textures.

Lslib

Lslib v19 lets you unpack just specific gtp files via the gtex name.

Alternately you can just unpack all the VT into one folder and just search with Windows Search, but this is extremely file heavy and not recommended.