SB3Utility (GUI + Script) - Glossary & Tutorials

Status
Not open for further replies.

enimaroah

Modding Dai Shogun
Apr 8, 2013
491
323
My intention in this thread is to build a place for beginners of modding 3D eroge and the main focus is 3D. SB3Utility can also be used for extraction of game files which are not related to 3D and explaining is fine here also.

The examples will come from all games which SB3Utility supports, Illusion's in the first place, but also games from TeaTime/FullTime and REAL/Interheart.

Please refrain from asking about specialities from specific games, like "How is tranparency handled in AG3?" or "Which unknowns do I have to set in the material of clothes for HET?" For those questions I hope there will be extra threads.




SB3U exploring basics:
  1. from the Windows explorer drag and drop a pp file into SB3U. Note: you can drop several pp files at once! Note also: you can drop a folder into SB3U!
  2. On the left you will find an area where all opened pp files reside. Find the small arrow down element which allows switching between pp files.
  3. Below are several tabs, like .xx and Other. Click on them.
  4. Double clicking an xx unit opens an xx editor in the middle area of SB3U. The left part is for selection, the right part for changing things.
  5. Click the Mesh tab on the left and select one for showing in the renderer on the right hand side.
  6. By using Shift-Click and Ctrl-Click you can select several meshes for rendering.
  7. If you click beside a mesh name you can clear the renderer and no mesh is shown.
  8. Back to the pp files. Directly below a pp file's name is a menu which allows to Export the selected units from the tab below. E.g. XX or TTY units! With Add Files... you can import such units. Those two functions work like decrypters. But after you have imported something or changed something in an editor, you must Save from the pp menu otherwise your changes are lost!



Still wanted and appreciated: Tutorials from you! I closed the thread since people posted off-topic several times. But if you want to contribute here, please let me know!
 
Last edited:
Glossary

When reading my tutorials and explanations about SB3Utility (abbreviated SB3U / SB3UGS) some terms are important to recognize. Many 3D programs use the same terms with an other meaning and that's why I define even the simplest terms here. If something is related to one company only it is written in the following colour schema: Illusion, Tea Time, REAL.

Vertex
A vertex consists of
  • a position in 3D space with X, Y and Z coordinates,
  • a Normal also with X, Y and Z coordinates which is used for lighting,
  • a 2D coordinate pair UV which defines a point on a Texture,
  • upto four references to Bones and Weights used for animation. All these fields are empty for unskinned Meshes/Submeshes.
    Although the same fields are present in an ODF, all used skins are stored in a seperate section (ENVL). REAL doesn't even have these fields in the vertex structure and stores it in the SKIC section.
Normal
Normals exist in two flavors. In Sb3U only vertex normals are visible in the renderer and are referred to in dialogs. They are not present in MQO files and must be computed by Sb3U. Three vertices build a face which are used to compute a face normal. Adjacent faces have common vertices. The vertex normal is computed as a sum of all face normals - faces that the vertex is part of. Because of the order in which the vertices are considered the vertex normal points in a direction which is defined as outward.
Sb3U shows the difference when you look at the face from the other side. If Culling is active, then the face is invisible. Switching off Culling shows the face regardless of position and direction of the camera. The renderer has an option to display vertex normals.

UV
They are also called texture coordinates, which define a point in 2D space on an image. They are found in MQO files at the definition of the faces. Three UVs because of the three vertices per face. Metasequoia would store more (and more vertices per face), but the games need triangulated faces and Sb3U displays error messages when importing faces with more than three vertices.

Submesh (Mesh Object)
Submeshes have a list of vertices and faces, can be switched off with the unknowns, and can use one Material. They are always contained in a Mesh. ODFs store references to Textures here.

Mesh
A mesh is a container for Submeshes, can also be switched off with it's unknowns and has a special form of vertex list called the Duplicate Vertex List. Most importantly it hangs in a Frame which is called Mesh Frame. The Bone List is also kept here.

Frame
A frame is part of a hierarchy with each node being a frame. This hierarchy is shown in Sb3U in the Object Tree. Each frame has a transformation matrix which deforms everything below the frame. And below means the children of this frame: meshes and other frames. The transformation matrix defines translation, rotation and scaling. Being part of a hierarchy means, that each child receives the transformations from it's parent, grand-parent, grand-grand-parent and so forth until the Root Frame is reached.

Bone
Bones used by all mesh objects are kept in a list in the mesh. In ODFs each mesh object has it's own bone list. They reference a frame called Bone frame. Each bone has a transformation matrix which is usually additionally applied to each animation. If no animation is used then the transformation matrix defines the Rest pose. Selecting a bone in the object tree highlights that bone.

Material
The properties of materials change how the used Textures look. In XX units references to Textures are stored here. ODFs can include several property sets for a material.

Texture
A texture is an image, which is stored in a pp file, then you find the texture in the Img tab. Or it can be stored in a XX unit and you can select it in the Texture tab. ODFs store only their name; the image itself lies in same folder as the ODF. Selection is the same as if it would lie in a XX unit. Depending on the selection in the launcher textures are taken from the game's TEXH, TEXM and TEXL folder respectively. Only a texture's name is stored in the REM.

Animation Track
An animation track is a container for every change of a bone over time. And such a change is called keyframe. Illusion puts several animations for a character one after the other by appending the keyframes to the same track.

Animation Clip
An animation clip just says where one single animation starts and ends and at which speed the animation should be played.
 
Make your own costume - Part 4

Step 1: Create a pp File

Step 2: Merging Parts of Costumes

Step 3: Cutting Overlapping Pieces of Clothes in Metasequoia

Step 4: [size=+1]Normals need correction[/size]

Required for this tutorial is SB3Utility 0.4.42.54 gamma or later.

The normals of a female body mesh as in each costume are replaced from the normals in the SVIEX units. There are three of those units and they are selected according to current girl's breast size.

The approximation in SB3Utility requires correct normals for a reference costume and correct normals for your new costume. These sets are compared and the nearest vertex of the referenced mesh is taken, it's index is searched in the reference SVIEX unit and that vertice's normal is copied to your new costume's SVIEX unit. You dont have to learn that by heart, but the important thing is that you have to take care of your new body's meshes and supply good normals.

In the previous steps of the tutorial we copied meshes and when the edited result from Metasequoia was imported we used the "Copy Nearest" method for normals. The vertices of those meshes found always original vertices at the same locations. So the normals are okay. But since it is an important requirement, I still start with creating them fresh.

  1. Select the mesh cw_O_body_24_01 and activate the display of normals in the renderer. Zoom in to the seam, to the connecting parts of the body you edited in Metasequoia.
    MakeYourOwnCostume-Step4-01.jpg
    3188d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg

  2. click Normals.... Just click okay.
    MakeYourOwnCostume-Step4-02.jpg
    3189d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg
    Note the forking normals. Every vertex has only one normal. What you see is two vertices at the same position having different normals. This will cause lighting problems and the adjacent faces were unequally lit. (The effect in a game would be less noticeable, because the faces aren't on one plane.)

  3. click Normals... again and change the value to positive(!) 0.00001. This computation takes much longer!
    MakeYourOwnCostume-Step4-03.jpg
    3190d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg
    Normals computed in this way consider faces of other submeshes. And if these faces are adjacent the face normals are nicely summed up. The result is that we see only one (vertex) normal at this position, although we know that there are two vertices.

  4. For the SVIEX approximation we need a known-good reference. Use a costume which is close to your new one. For the tutorial the naked body is such a known-good reference. Open prpr_00_02.pp / cw_body_99_00.xx. You dont need to select any mesh, but the reference costume must have been opened. Then press Alt-N or choose SviEx Normal Approximation from the main menu.
    MakeYourOwnCostume-Step4-04.jpg
    3191d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg
    Select the source first - the known-good reference, which is cw_body_99_00.xx. In my case you see only one mesh in the list to right: cw_O_body_99_00. This is because my version of the uncensor has the breasts as submeshes of the body. There is another version of the uncensor out there with an additional mesh for the breasts. If you would have that version then you would have to see an additional mesh here! It might be different because the knowledge of SVIEX units was not known when the uncensor was made. If you see that, stop here and
    • either join the breasts back into the body mesh with the same indices as you see in Source Submeshes
    • or use prpr_00_02.pp / cw_body_99_00.xx from the original media as known-good reference.
  5. The harder part is done, here comes an easier for the Selected Target Meshes. "cw_body_567_01.xx -> prpr_99_tclb_567.pp" should already be selected. And cw_O_body_24_01 and RuTou (only present in some uncensors) should be present in the list box to the right. No? In that case you haven't selected the meshes before. Do it now (CTRL-click to select additional meshes) then press Alt-N and fill "Correctly Lit Meshes" again. If you have the breasts in the body mesh then you only need to select the body. The goal is to have all meshes selected which need normals in SVIEX units.
    MakeYourOwnCostume-Step4-05.jpg
    3192d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg

  6. When you select the mesh(es) note the submeshes relevant for the breasts. The vertices around the uncensor are affected by the original SVIEX unit. Therefore, you must include the submesh for it.
    MakeYourOwnCostume-Step4-06.jpg
    3193d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg
    The reference uses the red marked submeshes: 0 (body), 3 (breast), 4 (breast), 5 (uncensor).

    MakeYourOwnCostume-Step4-07.jpg
    3194d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg
    Our target will use two submeshes of cw_O_body_24_01: 2 (uncensor), 3 (edited body) and both submeshes of RuTou (not shown in screenshot).

    MakeYourOwnCostume-Step4-08.jpg MakeYourOwnCostume-Step4-09.jpg
    3195d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg
    3196d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg
    Enter "2, 3" below cw_O_body_24_01, and use "-1" for RuTou. -1 means all submeshes for that mesh. RuTou has two submeshes and we want both, so it's fine. But you could also write "0, 1" instead.

  7. Use the defaults for the squared distance and the other options. Only use other modes if the result isn't satisfying.

  8. Finally Approximate Target Normals and test it with a flat-chested girl.

MakeYourOwnCostume-Step4-10.jpg
3197d1384178272-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step4-01.jpg
 
Last edited:
Make your own costume - Part 1

Step 1: [size=+1]Create a pp File[/size] (kind of archive) for it. See also the "Premium Play Darkness Modding Guide" in the wiki.

Step 2: Merging Parts of Costumes

Step 3: Cutting Overlapping Pieces of Clothes in Metasequoia

Step 4: Normals need correction


  1. Copy a small pp file containing a costume, e.i. prpr_99_10.pp to a new name. The name should contain the number of the costume. This costume number must be unique across your installation. All pp files are considered!

    Current restrictions:
    • Maximum costume number is 98 for the original client. Higher numbers cause lighting problems, especially for girls with small breasts. Use the client from Enter75 to use higher numbers.
    • If you are using Enter75's client, dont use costume numbers (costume_number % 256) == 255. The part of code I have seen would do the same unwanted behaviour for (costume_number % 256) == 99. This unwanted behaviour includes skipping the SVIEX units (workaround available).
    In this example I will use 567. So copy the pp file to prpr_99_tclb_567.pp into the same folder. The part in the middle means "the costumeless bride". To show the number in the pp's filename is not required but good practice because of the costume number's uniqueness.

    With this file in your installation you should not start poser or game until you reach the last line of this post.

  2. Copy the costume into your created pp file

    Open prpr_02_00.pp with (or drop this file into) SB3Utility. The bride's costume is every unit beginning with cw_body_24_.

    In the XX tab, select cw_body_24_00.xx and cw_body_24_01.xx. Then choose from the pp file's menu: Sufiles, Export.... Repeat that in the XA tab with cw_body_24_00.xa. Skip the Imgage tab (explained soon). Continue in the Other tab with the eleven subfiles for this costume plus cw_clothes_24_00.lst.

    Rename the exported files according to the new costume number, except for the two LST files ending with _siru. LST units include normal text, have a look at them. They reference semen textures. We will use the textures already inside the copied pp file and therefore we use the two LST units in the pp file too.

    Open prpr_99_tclb_567.pp with SB3Utility. From the pp file's menu you can delete selected subfiles of the current tab. Delete cw_body_58_*.xx, cw_body_58_*.xa and the cw_body_58_*.* units from the Other tab, except for the *_siru.lst units which you will Rename accordingly.

    Important for the name in Customize are the ched*.lst units. Double click ched_00_11.lst. The original costumes are defined in prpr_04_00.pp / ched_00_00.lst. Open that unit too and copy the last four numbers into the clipboard. Paste them into our ched_00_11.lst at the correct place. Mind the format, the values are TAB separated. Change the first number of the line to a fantasy number. Yes there is a rule, dont mind.

    From the pp file's menu Add Files... the exported and renamed files.

  3. You will save and test alot. Change the extension for backups of pp files from the pp file's menu to something different than .pp!

    Save the pp file. Test it!
 
Last edited:
Make your own costume - Part 2

Step 1: Create a pp File

Step 2: [size=+1]Merging Parts of Costumes[/size]

Step 3: Cutting Overlapping Pieces of Clothes in Metasequoia

Step 4: Normals need correction


  1. Additionally to your new pp file open prpr_00_02.pp which includes the naked body. We will fill the gaps of the body caused by removing clothes with it.

  2. Open cw_body_99_00.xx with a double click. Be careful not to use cw_body_99_01.xx!
    The meshes inside both XX units look the same, but I haven't tested if the vertex indices and submesh indices are the same and there are SVIEX units for cw_body_99_00.xx only.
    In the middle of SB3Utility the XX editor has opened. On the left are views for navigating through all components of the XX unit. While on the right you see an editor for each type of components.

    The overall structure of the XX unit can be seen in the Object Tree. Select "All Root" and the root frame's details are shown on the right. Nothing much to see, but the Name field has changed which indicates that you selected the frame with that name.

  3. On to the next navigation tab "Mesh" and select cw_O_body_99_00. This selection has two effects. The renderer shows the mesh and the mesh editor on the right shows some details. Click on the first of the submeshes and watch the changes in the renderer. Then click on the second submesh. We want these two for filling the body and completing the arms. Illusion's submeshes have no name and we have to refer to them by using their index which starts with 0.

  4. Submeshes are not exported alone. They are always exported together. You can select more meshes (CTRL-Click or SHIFT-Click) before exporting and then all selected meshes will be exported into one file. Before that, you have to select the format. We want to export a bit more than has been explained until now: bones and weights. Therefore, choose: FBX 2012.2 from the list, then click Export. Note the export path in the Script window in the bottom right corner of SB3Utility.

  5. Drop the exported file (most likely {game folder}\data\prpr_00_02\cw_body_99_00\meshes0.fbx) into SB3Utility. A workspace window opens and shows the file's contents or better the structure and elements of it.

    In the same area, behind the workspace, bring your pp file to the front with a click on the arrow pointing down at the top.*​

  6. Open cw_body_567_01.xx, select mesh cw_O_body_24_01 and click Goto Frame. You will be taken into the Object Tree of the current XX edtior with the Mesh Frame being selected. (Glossary!) Make a small excursion...
    and unfold 84 bones. Click on a01_J_ToesL_01 and look at the left foot in the renderer. The different colours show the different Bone Weights of the selected Bone, important for skeletal bone animations. You can have the bones displayed in the renderer. Check that option in the renderer's menu. Okay, scroll up again and make the mesh frame visible, in case it has been scrolled out of sight.
    Click on Mesh in the Object Tree again to have the details of the mesh visible for comparison with the imported mesh in the workspace.

  7. Bring the workspace of meshes0.fbx to the front, uncheck the mesh cw_O_body_99_00, check only submesh with index 1. Directly after import the submesh's Base is set to it's own index, but that can be changed and we will do this soon.

    From the workspace drag cw_O_body_99_00 onto cw_O_body_24_01 in the Object Tree. A dialog opens from which you want to change the default options of the Method to Merge. You have memorized the mesh? Click on OK, then click on Mesh below the mesh frame again, and you should see arms!

  8. Now the same with the body, but this time we change the submesh's option in it's context menu. Uncheck submesh 1, check submesh 0, then Right-Click submesh 0 to see the context menu and uncheck Replace Original Submesh. Drag the mesh into the Object Tree as before, using the same options.

  9. Finally, Remove the meshes of the costume: cw_O_hana_24_01, cw_O_weding_24_01 and cw_O_wedingfril_24_01. Do such deletions as last action before saving. This way you can check for gaps or overlapping meshes easily.
* I have written the tutorial without navigation with the "Quick Access" window. So you can use this instead of the given navigation instructions, of course.
 
Last edited:
Make your own costume - Part 3

Step 1: Create a pp File

Step 2: Merging Parts of Costumes

Step 3: [size=+1]Cutting Overlapping Pieces of Clothes in Metasequoia[/size]

Step 4: Normals need correction


If you are missing some buttons in your version when you compare it to the screenshots, uncheck File / Basic Mode from the menu.

  1. Metasequoia works best with the MQO format. Export cw_O_body_24_01 as MQO and drop the file into Metasequoia. If you choose Open the current scene will be cleared, while Insert would add the contents of the MQO to the scene.
    MakeYourOwnCostume-Step3-01.jpg
    3284d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
    Note, I will now use the older term "Mesh Object" instead of submesh. The word has been changed in the new implentation of SB3Utility. Older tutorials and GUI elements of SB3Utility use that term of Metasequoia, but both mean the same.

  2. Okay, a bit of navigation in Metasequoia first.
    Press CTRL-F, without any selection you see the visible mesh objects nicely centered. If you would have selected something then only your selection would have been centered.

    The main view in the center can show the scene in two different ways. Switch between four window style and one window style with the button at the top with the four quarters.

    Choose Select from Command Panel / Edit / Command. Check Pt and uncheck CObj in the Edit Options. This allows to select every vertex, and not only vertices of the selected mesh object (Top right: Object Panel, the selected line). Also uncheck Fr directly below the main menu.

    Click above the highest vertex, hold the left mouse button and pull diagonally until you have a few vertices in the opened rectangle. Then release the mouse button. Press CTRL-F again. Uhh, too near? Use the mouse wheel to get some more distance, at least until the camera is outside of the body.

    Activate Fr and then hold the right mouse button and move the mouse to a side. Hold down the wheel and pull up until you see the throat. Find a position with the mouse where no vertex is highlighted. If you cant find such a position, get nearer. Then select a few vertices of the throat, and observe what you selected by holding the right mouse button and moving the mouse in a circular fashion. This time the vertices of the backside were not selected!
    We will perform horizontal cuts through the legs and want to select vertices of the front and the back. Therefore, uncheck Fr.

  3. The first column in the Object Panel shows eye symbols for mesh objects which are currently shown. Enable only the original body cw_O_body_24_01[0] and the original legs cw_O_body_24_01[2]. Examine where both are overlapping. You see that the body is tightened at the connection, where our naked body copy is straight. Select all vertices being different to the naked body plus one more line.
    MakeYourOwnCostume-Step3-02.jpg
    3285d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
  4. Make sure that you have only the original body displayed, then use the menu function Edit / Invert all the selection of vertices. Then press Delete.
    MakeYourOwnCostume-Step3-03.jpg
    3286d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
  5. Double click onto cw_O_body_24_01[0] in the Object Panel and choose a colour which is easy to see.
    MakeYourOwnCostume-Step3-04.jpg
    3287d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
  6. Select the new body mesh object cw_O_body_24_01[4] and limit the selection to this mesh object: check CObj.
    Then select some lines of vertices below the last line we want to retain.
    MakeYourOwnCostume-Step3-05.jpg
    3288d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
  7. Scroll out and SHIFT-select all the vertices down to ground.
    MakeYourOwnCostume-Step3-06.jpg
    3289d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
  8. Delete.
    MakeYourOwnCostume-Step3-07.jpg
    3290d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
  9. Join the old body which is just the few lines for the connection to the legs with the new body we cutted just now. Left-click cw_O_body_24_01[0], hold the mouse button and drop it onto cw_O_body_24_01[4].
    MakeYourOwnCostume-Step3-08.jpg
    3291d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
    Yes, we want that.

  10. Activate Fr and select a vertex of the former rim. The number of selected vertices is shown at status line at the bottom.
    MakeYourOwnCostume-Step3-09.jpg
    3292d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
    Joining mesh objects does not eliminate vertices at the same position! Those unwanted vertices waste gpu memory and bandwidth and can cause problems with skeletal bone animations. We have not to care for morphs here and therefore should delete these vertices.

  11. CTRL-A to select all vertices = 3700. Then choose Object / Join closed vertices, leave it at 0.0 and press OK.
    MakeYourOwnCostume-Step3-10.jpg
    3293d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
    Check the seam again, at least some positions. If there are still two vertices at the same location, then scroll in as near as you can and you will see that they have slightly different positions. Join with the same function again and increase the distance a bit, e.g. 0.05.

  12. Save it. We are ready here!

  13. Drop the result into SB3Utility, find the mesh frame in the Object Tree. Now take care of the Base of the last submesh (the others haven't been edited so uncheck them). This last submesh has to target the naked original body submesh 4 and we want to replace it. Use the Merge method and leave the defaults of the other options as they are. They are different this time, because MQO files can neither transport normals nor bones nor bone weights. The nearest method searches in the targetted base submesh for the nearest vertex and uses it's normals or bones respectively. This takes a while, and even longer if the nearest cant be found in the target submesh and you therefore use Mesh as Nearest mode. In our example here, the Submesh mode is fine.
    View attachment 3295
    3295d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
  14. In Metasequoia we have joined two mesh objects, and this we have to repeat here. Delete the first submesh.

Well done!
3294d1384282420-sb3utility-gui-script-glossary-tutorials-makeyourowncostume-step3-01.jpg
Issues:
  • We lost the garter although we haven't touched the mesh.
  • Our copy of the vertices for the connection to the legs shows a slightly different colour. The reason is that the bodies have different UV maps.
  • Fingernails are missing. Yes, but you are now equipped to fix that.
 
Last edited:
This simple example for AA2 combines two existing hair types to a new one. It demonstrates how to transfer meshes and even animations for hair elongation and finally how the physics can be combined.

Tools needed for this tutorial: SB3U(G+S) v0.7.0ε or later and BPStool v1.3

  1. Creating a new slot in the maker
    1. As a base I took #7 from 付毛 ("Hair Extension"). This style consists of AS00_23_07_00.{xx, xa, bps} from jg2e02_03_00.pp. Drag the pp file into SB3UGS. The units can be found in the .xx, .xa and Other tab of the pp file. Select and Export... them from the Subfiles menu one by one.
    2. The "Hair Extensions" are defined in jg2e_00_02_03_00.lst of jg2e00_00_00.pp. LST units can be found the Other tab. Double click to open them. Scroll down. The numbering ends with 26. So rename the three files to AS00_23_27_00.* These names have to be put in a new line in the LST like this:
      Code:
      28	jg2e%s02_02_examples.pp	%s00_23_27_%02d.xx	%sAS00_23_27_%02d.xa	%s00_23_27_%02d.%s	0	A00_20_00_00_00.tga
      I used a separate pp file for this example, but you can use the orignal pp file as well. Dont forget to increase the number in the first line!
      Code:
      0	28	0	0	0	0	0
    3. If you would like to add a mirrored hair style later you just use 01 at the end of the names instead of 00, e.g. AS00_23_07_01.{xa, xa, bps}. Dont increase the number in the LST unit.
    4. Insert the renamed files into the destination pp file with the pp file's menu item Sufiles / Add Files...
    5. A pp file (or any other file) is never saved automatically! If any of the pp tabs is active press CTRL-S or use the pp file's menu for saving.
    6. Test the new slot in the maker!
  2. Adding a strand of hair to our base style
    1. Slot #1 from the "Hair Extension" is used in this example. The non-mirrored one is AS00_23_01_00.{xx, xa, bps).
    2. Dont export anything, just open AS00_23_01_00.xx. And also open your AS00_23_27_00.xx.
    3. Open a workspace from the main menu or by pressing CTRL-W.
    4. From AS00_23_01_00.xx drag A00_N_kamiOtop into the workspace. This frame and its children defined the skeleton of the strand of hair. And the mesh should be the last object to be transported into a xx.
    5. Drag the mesh frame A00_O_kamiO00 into the workspace. And yes, you could have dragged AS00_N_kami instead of the two. When transporting a mesh you should be aware of the required skeleton and transfer it along with the mesh.
    6. Select the frame A00_J_kamiOtop.
    7. Now switch to the AS00_23_27_00.xx. Use Expand All in the ObjectTree.
    8. Select the frame A00_J_kamiOtop and switch back to AS00_23_01_00.xx for comparison of the matrices. They are different! So we need that frame, but we must rename it after insertion. Every frame must be unique in an xx!
    9. Switch to AS00_23_27_00.xx again. Drag A00_J_kamiOtop from the workspace onto A00_N_kamiOtop and replace with the Add option. The result is an invalid hierarchy in the xx, because of the two frames named A00_N_kamiOtop. Rename the new one which is the last child of A00_N_kamiOtop, e.g. to A00_J_kamiOtop_01.
    10. Continue with the mesh frame A00_O_kamiO00. Drag it onto A00_O_kamiO00's parent named A00_N_kamiO. Again use the Add option and rename the mesh frame to A00_O_kamiO00_01.
    11. Expand A00_O_kamiO00_01 and all its children. Both formerly renamed frames are used as bones. Correct both bone names as well!
      CombiningHair04.jpg
    12. Test the new slot in the maker! The strand should be present, but alas completely stiff and not elongatable.
  3. Elogating the strand of hair
    1. AS00_23_01_00.xa from jg2e02_03_00.pp holds the animation of the original strand. We have two independent skeletons and the problematic frame A00_J_kamiOtop isn't an animation track. Therefore we can simply add the other tracks.
    2. Close all other XA units except for AS00_23_01_00.xa and select A00_O_kamiO00 in AS00_23_01_00.xx. Select FBX 2014.1 in Format Options, then press Export. Note the path of the export file in the Script window.
    3. Open AS00_23_27_00.xa
    4. Drop the export file into SB3UGS. From that workspace drag Animation0 onto any track of AS00_23_27_00.xa and apply with default options.
    5. Make both meshes visible in the renderer by using the Mesh tab of AS00_23_27_00.xx and CTRL-Click on both meshes. You cant do that in the ObjectTree. Multi-selection of meshes is possible only in the Mesh tab.
    6. Then switch to AS00_23_27_00.xa and use the animation slider for a preview.
      CombiningHair09.jpg
    7. Test the new slot in the maker! The strand should be present and elongatable, but still completely stiff.
  4. Integrating the strand's physics
    1. BPS units can be made human readable with the BPStool. It is a command line tool, but can be integrated into SB3UGS.
      Select AS00_23_27_00.bps and from the pp file's menu click Subfiles / Register Tool.... Browse to BPStool.exe and put "/decode {0}" without quotation marks into Decoding Arguments, "/encode {0}" without quotation marks into Encoding Arguments. Then Register and Close.
    2. Double click on AS00_23_01_00.bps and AS00_23_27_00.bps. The text representation has two groups. The first shows bone parameters and the second defines how pairs of bones are linked. Copy the five bone parameters and adapt the problematic bone frame name. Also continue the numbering of the ids in BoneExt7. The first has to be changed from "x0000F5CF, x00000000" to "x0000F5CF, x00070000", because of the seven bones already present. Copying the second group for the four bone pairs requires to continue the numbering in the first triplet and the adaption of the ids. The definition of the first pair would begin with "i0, i7, i8" and the id "x0000F5CF, x00070000". Adapt numBones to 12 and numData1 to 10.
    3. Test the new slot in the maker! The new slot should be fully functional now.
      CombiningHair11.jpg
 
[size=+1]Small excursion about external materials and textures[/size]

The files are taken from Honey Select release version, but the principle applies to all Unity based games.

Load cf_shorts_04.unity3d and open Animator p_cf_shorts_11_00.
Select Mesh cf_O_shorts_d and note the message in the Log window:
cf_O_shorts_d[0] has an external Material FileID=1 PathID=-4868027318105399293
ExternalMatsAndTexs-01.jpg
Unselect the Animator. Nothing should be selected now.
From the file's Options menu click "View Data". Last lines of the output are:
References
FileID=1: guid=00000000-0000-0000-0000-000000000000 type=0 filePath="" assetPath="archive:/cab-05785cb2276d2d34983aef7c43515e6e/cab-05785cb2276d2d34983aef7c43515e6e"
ExternalMatsAndTexs-02.jpg

Search in the whole abdata folder for that Cab-String "CAB-05785cb2276d2d34983aef7c43515e6e". I recommend TotalCommander for this.
You will find many files with that CAB-String (all ending _04) if you search case insensitive!
If you do it right then you will find mat_cha_04.unity3d. Drag it into Sb3UGS.

Now refresh the Mesh by clicking it in the Mesh list.
ExternalMatsAndTexs-03.jpg

Note two things:
  1. The Material has been loaded and Textures too, because they are in the same file.
  2. In the mat file more materials have been loaded (shown in bold face). But they are not available for selection yet. To use loaded resources either close and reopen the Animator or switch to the Object Tree and press "Refresh" at the bottom.
    ExternalMatsAndTexs-04.jpg
    The grey foreground colour in the Object Tree marks external assets. Remaining question: why haven't all materials in that been loaded? The file with the shorts references only those four.

Select the material and use "Copy -> New".
ExternalMatsAndTexs-05.jpg
Local assets are black. Externals are grey. This is important when using them and since they have the same name they are marked accordingly.
Note also that our shorts file got new tabs for Materials and Textures. This file didn't have any of them before and all types are registered.
Currently new types make this file invalid for the game! You get a message in the game's log file:
The AssetBundle '{your file path}' can't be loaded because it was not built with the right version or build target.
In this case you have to change the Inventory offset in the file's menu. - Fixed in SB3UGS_v1.2.7 and later versions.
ExternalMatsAndTexs-06.jpg

Now remove the external material cf_M_shorts_11_00. The mesh shows up like at the beginning. Though you could switch to the new local copy.
Do something else instead and reload the shorts file! Two messages are shown in the Log:
The given key was not present in the dictionary.
Remember we have removed the material from the material file which is still in Sb3UGS. If you see this message then usually a file is broken. This can happen e.g. when you edit files standalone and Sb3UGS doesn't even know the referencing file.
 
Last edited:
[size=+1]External materials and textures - Part 2[/size]

The files are taken from Honey Select release version, but the principle applies to all Unity based games.

Start Sb3UGS and open ca_head_06.unity3d alone.
ExternalMatsAndTexs2-01.jpg
ca_head_06.unity3d has one external reference which is always shown checked.

If you open another file which is unreferenced then this will be added to the list unchecked.
ExternalMatsAndTexs2-02.jpg
Here mat_cha_02.unity3d has been opened.

Check that entry to link the current file with this file. The link is one way only. It points to mat_cha_02.unity3d in this case, but mat_cha_02.unity3d will not get linked to ca_head_06.unity3d. You will get a message for this in the Log window.

Open the "Material & Texture Animator" by double clicking some materials and/or textures in mat_cha_02.unity3d.

Switch to ca_head_06.unity3d, open Animator p_acs_head_veil_hut and select MeshRenderer acs_head_veil_hut_base. Open the selection for materials.
ExternalMatsAndTexs2-04.jpg

When you switch the material to such an external asset the material and textures are not copied into your file. You will not find a tab for Materials and Textures in your file. The submesh just references this material.



External references can be used now. See AssetBundleManifest post and the next release of Sb3UGS



Example for a head accessory with external Material
 
Last edited:
Re: [Mod Discussion] (Illusion) Honey♥Select (ハニーセレクト)

[size=+1]A simple example for a studio item.[/size]

List File
  • It is possible to use your own, but this would make it more complicated. So use abdata\studio\list\itemlist\honey\01.unity3d directly. I use 01.unity3d because it is currently the lastest file.
  • open ItemList_Honey_01_Sheet2. What is the highest ID?
    In the first column is the row number. The third column is labeled 識別番号 and this is where we find the ID.
  • Use an incremented row number and ID when you copy all other fields into a new line. Note the slashes!
    Code:
    9		293	7	vibe	studio/itemobj/honey/obj77.unity3d	p_item_vibe_copy
  • open ItemList_Honey_01_Sheet1 and add the number of new lines to the third column labeled 終了行.
    Code:
    2	2	9	7

Mod Geometry and Resources File
  • abdata\studio\itemobj\honey\00.unity3d is too big for a template so I used abdata\h\obj05.unity3d copied it to studio/itemobj/honey/obj77.unity3d.
  • change the CABString
  • rename the Animator to p_item_vibe_copy
Done! The item is standalone and ready in the studio - pink, of course, but working.


Fixing the Pinkness
  • In your obj77.unity3d use "Dump AssetBundle" from the file's File menu [not the main menu]. In the Log window you can see which external files might have been used. It is only one here. Open that file.
  • If not already open then open the p_item_vibe_copy Animator and select mo_hs_ha_bai_00 from the Mesh list.
  • If you have opened the correct mat_* file then the Material selected for the first submesh will be listed as mm_hs_ha_bai_00. Select the material from the "Materials used" list or switch to the Material list and select it from there.
  • Note the tooltip on "Copy -> New", then click it. If you had not switched to the Materials list, then do so now.
  • Note the changes when you select your local copy. The "Used in Mesh" becomes empty. And when you unselect it, the original material is grey while the copied is black. This shows whether a resource is internal or external.
  • Switch to the Mesh list and select mo_hs_ha_bai_00 again. Change the material of the first submesh to mm_hs_ha_bai_00_Copy.
Done, and pinkness healed!
SimpleExample01.jpg
 
Status
Not open for further replies.

Users who are viewing this thread

Latest profile posts

FedericoV wrote on Otokonoko's profile.
Sorry, I downloaded your file for 聖奴隷学園2~完全調 but I don't understand how I'm supposed to install it. Can you help me?

Thx in advance.
Playing Irresistible Mistakes (Toma)!
A-9000 wrote on zhonyk's profile.
Hi zhonyk! The v26547 from Poison and hard to find that you uploaded 1 year ago is down:

https://www.anime-sharing.com/threads/191129-poison-孕み鬼~鬼畜異形に蹂躙される巨乳鬼娘~-crack.1339132/