Jump to content

Adding softbody meshes using Vago's g1m_xml tool


fgh1t6

Recommended Posts

Posted

Many thanks to @vagonumero13 for giving us this new powerful tool. I just tried his idea of adding meshes --- making my self a little more trouble by trying the softbody meshes. The purpose was to add suspender strips to MOM_033 mini thong mod: 

fgCut_MOM033_minThong_title_noskirt.jpg.222f9fa6e4f69ac0747fed5bc4164d05.jpg

(Mod is attached)

There is  no point to open a new topic just for a little mod, so I will also show how I add the softbody meshes with the g1m_xml tool. I assumed you already know how to import/export and handle VB/IB  with Blender.

Actually, Vago has shown us the steps to add meshes :

But he was trying to transplant meshes from one g1m file to another, so steps are a bit complicated to ensure the mesh format is right. But if you know how to handle VB/IB with Blender, it is much easier to merged the mesh with one already exist in the target g1m file. Instead of "adding" meshes, we can just duplicate exist meshes and edit them in Blender later. Thus no need to handle the size calculations. All you need to do is copy and paste, and fine tune a few numbers. 

First of all, check the model in Blender, to decide which meshes to be duplicated. In this case, it would be mesh 13 and 14. Since the last mesh is 18, so new meshes would be 19 and 20.  Now, drop the MOM_COS_033. g1m to g1m_xml.exe. So You got a "MOM_COS_033.g1m.xml" file. 

 

1. Open the xml file, search "SubmeshesSection" , looking for "Submesh idx " to locate the mesh block. Inside the block, marked down the "VB value" and "IB value" values. They are the file names need to be duplicated in the "MOM_COS_033" folder. You may think the value would be the same as the submesh idx, but they are not always be the same. In this case, they are not. So, the file we need to duplicated in the folder would be: VB_12.bin, IB_12.bin, VB_13.bin and IB_13.bin. Copy and paste them and rename to the last file count +1, For this case, they are : VB_18.bin, IB_18.bin, VB_19.bin abd IB_19.bin. Remember the last mesh we checked in Blender is 18, so the newly added mesh would be 19 and 20.  Mark down the information: mesh 19->file 18, mesh 20 -> file 19.

 addMesh_0.jpg.cf348b9e5f3187ae60cacbe8caa9b048.jpg

2. Now copy these two Blocks and paste them at the end of the  "SubmeshesSection" section, just after the last block <Submesh idx = "18">. Rename the duplicated block to 19 and 20. Also change the "VB value" and "IB value" to match the .bin files we duplicated, which are "18" and "19" in this case.  

addMesh_0_1.jpg.eb9a247acbec674eb97e08fd4b2200bd.jpg

 

3. Scroll down to the <MeshesSection>. Here, don't look at the "<Mesh idx =xx>" header, just look inside each block for the <Submeshes value = xx>. Found the block contains the submeshes we are copying, in this case, "13" and "14". Instead of duplicate these blocks, we just ass the new submesh number in.
   Change <Submeshes value ="13"/> to <Submeshes value ="13,19"/> , and change <Submeshes value ="14"/> to <Submeshes value ="14,20"/>

 

addMesh_0_2.jpg.40be729e3cfecc10045abe53f49fcea1.jpg

4. Half way through! Scroll to the top of the xml file,and do a search for "VertexSection". Remember the files we duplicated in step 1, VB_12.bin and VB_13.bin ? So found the entry of these files:
    <VB idx="12" vertex_size="116" u_00="0" u_0c="0" binary="VB_12.bin" />
    <VB idx="13" vertex_size="116" u_00="0" u_0c="0" binary="VB_13.bin" />
   No need to worry the numbers, just copy and paste them at the end of this section. and change the "idx=" and "binary=" to match the .bin files we renamed. So we have:
    <VB idx="18" vertex_size="116" u_00="0" u_0c="0" binary="VB_18.bin" />
    <VB idx="19" vertex_size="116" u_00="0" u_0c="0" binary="VB_19.bin" />
   Notice that the file name is not matching the submesh index in our case : mesh 19-> file VB_18.bin ; mesh 20-> file VB_19.bin

 

addMesh_1.jpg.790273442853d7eb52113a4d4177f2f5.jpg

 

5. Now scroll down one section to the <LayoutSection>. Do the same copy & paste, change the <Layout idx="12"> and <Refs value="12" /> to <Layout idx="18"> and <Refs value="18" />; <Layout idx="13"> and <Refs value="13" /> to <Layout idx="19"> and <Refs value="19" />

 

addMesh_2.jpg.13b1b684e962a327db8d8437b11787b5.jpg


6. Search "IndicesSection", go to <IndicesSection> section. Just repeat Step 4 for the IB files.

addMesh_3.jpg.105dd5554ab793314deccf080ddc2108.jpg

7. Now save the xml and drop it to g1m_xml.exe to update the g1m file. Drop the g1m file to g1m_export_with_vgmap.bat to get the new set of VB/IB to work in Blender.

 


Part II: Change the mesh's texture

 

Since the two new meshes were copied from skin meshes, they are using skin texture now. After working in Blender for modification, soft body weighting, assign new vgmap, export and g1m_imort..... finally, you got your new g1m file. Now drop it to g1m_xml to update all the files, and open the xl again.
Search "MeshesSection", go to <MeshesSection> , locate the entries we modified in step 3 of previous part. we have:
            <Mesh idx="7">
                <Type value="@F3040298" />
                <U_10 value="0x20004" />
                <Nun_ID value="2" />
                <Submeshes value="13,19" />
            </Mesh>
            <Mesh idx="8">
                <Type value="@F3040298" />
                <U_10 value="0x20004" />
                <Nun_ID value="3" />
                <Submeshes value="14,20" />
            </Mesh>
    
"Type value" is the key. It decides what kind of material the mesh is. You can got these codes for different parts from different g1m files. These codes must be used with the correct "U_10 value" meshes. The "U_10 value" tells the type of mesh:
U_10 value = "0x20000" is the most common one, I call it normal mesh. U_10 value = "0x20001" /U_10 value = "0x20002" seem share same type of Type codes. They are these "4D" vertex or using "unnamed bones". Finally, U_10 value = "0x20004" is the soft body meshes.
For the 1st type, the "Nun_ID value" is always -1. For the other two type, this is the index of the control body. If you have worked in Blender with the softbody plug in, you will know after importing softbody, there are 2,4,or 6 parent control groups. They are index as: 0: Left Breast, 1: Right Breast, 2: Left Butt, 3: right Butt, 4 : left thigh, 5: right thigh
In this case, 2 and 4 , 3 and 5 are combined to as 2, 3 only. Thus, mesh 13 is controlled by left Butt group.     

So we know Type value="@F3040298" is for softbody skin. Check this g1m file out! There are another "U_10 Value = 0x20004" meshes!
            <Mesh idx="2">
                <Type value="@11380057" />
                <U_10 value="0x20004" />
                <Nun_ID value="2" />
                <Submeshes value="8" />
            </Mesh>
            <Mesh idx="3">
                <Type value="@11380057" />
                <U_10 value="0x20004" />
                <Nun_ID value="3" />
                <Submeshes value="9" />
            </Mesh>
 Mesh 8 and 9. Check them out in Blender. They are the softbody stocking! So, Type value="@11380057" is for softbody stocking style fabric, which is perfect for my stocking suspender mod. So I will just take my 19 and 20 meshes from teh skin block and add them into these blocks:
            <Mesh idx="2">
                <Type value="@11380057" />
                <U_10 value="0x20004" />
                <Nun_ID value="2" />
                <Submeshes value="8,19" />
            </Mesh>
            <Mesh idx="3">
                <Type value="@11380057" />
                <U_10 value="0x20004" />
                <Nun_ID value="3" />
                <Submeshes value="9,20" />
            </Mesh>
.....
            <Mesh idx="7">
                <Type value="@F3040298" />
                <U_10 value="0x20004" />
                <Nun_ID value="2" />
                <Submeshes value="13" />
            </Mesh>
            <Mesh idx="8">
                <Type value="@F3040298" />
                <U_10 value="0x20004" />
                <Nun_ID value="3" />
                <Submeshes value="14" />
            </Mesh>
 
 That is it. Save and drop to g1m_xml.
 
 Now how about creating your own material block? I tried but not successful at all. The section seems have a size limit. Add new softbody blocks will push the last few blocks out resulting meshes disappeared.
 I did remember to correct the "Count1 value" and "Count2 value". Replacing one <U_10 value="0x20000" /> block with <U_10 value="0x20004" /> will push the last two blocks out, all meshes inside these block disappeared.
But replace a <U_10 value="0x20001" /> or <U_10 value="0x20002" /> block with a <U_10 value="0x20004" /> block works well. Remember you can put several meshes into one block.

 

OK. I did some omre test, and found It may be the rick of

            <Count1 value="17" />
            <Count2 value="3" />


They are talking about how many items of different type submeshs. In the <SubmeshesSection> section, each submesh block has a "<U_00 value="XX" >".  U_00 value="53" is the common type, counted by "Count1 value",  U_00 value="61" (or other values) is special type, caounted by "Count2 value". In the  <MeshesSection>, all U_00 value="53" type mesh block should go first. That is the "Count1 value" counting. the following "Count2 value" blocks should be for the U_00 value="61" type submeshes.

 

So, our newly added block should be  inserted at idx=15, 16, and the old 15, 16,17 should be moved to 17,18,19 like this:

            <Mesh idx="15">
                <Type value="@11380057" />
                <U_10 value="0x20004" />
                <Nun_ID value="2" />
                <Submeshes value="19" />
            </Mesh>
            <Mesh idx="16">
                <Type value="@11380057" />
                <U_10 value="0x20004" />
                <Nun_ID value="3" />
                <Submeshes value="20" />
            </Mesh>
            <Mesh idx="17">
                <Type value="@A44C33DB" />
                <U_10 value="0x20000" />
                <Nun_ID value="-1" />
                <Submeshes value="16" />
            </Mesh>
            <Mesh idx="18">
                <Type value="@9485FBD1" />
                <U_10 value="0x20004" />
                <Nun_ID value="0" />
                <Submeshes value="17" />
            </Mesh>
            <Mesh idx="19">
                <Type value="@9485FBD1" />
                <U_10 value="0x20004" />
                <Nun_ID value="1" />
                <Submeshes value="18" />
            </Mesh>

 

fgCut_MOM033_minThong_noSKirt.zip

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...