#author("2025-04-07T15:24:27+09:00","default:admin","admin") #author("2025-05-01T18:46:59+09:00","default:admin","admin") *''3D Characters'' [#r8bb1e0c] Using 3DCG production software or web services, you can add 3D characters or modify the pre-installed 3D characters. This section describes how to use the readily available 3D production software Blender and a web service called Mixamo. Blender version 2.83 or later is supported; how to use Blender is not discussed here. #contents **Data Specifications for 3D Characters [#d29ff239] 3D characters require model, textures, and motion data. Creating and modifying them requires knowledge of 3D graphics and the prescribed software. The model formats supported by Bakin are ''FBX format'' and ''VRM format''. This section describes the model specifications in FBX format. For VRM format models, see [[.vrm format models:https://rpgbakin.com/pukiwiki_en/?3D+Characters#j317a3a7]]. ***Model Data [#lf69af4c] &size(14){''1. Model (.fbx)''}; |File Format|FBX format is supported.| |Data Format|FBX 7.4 (FBX 2014) is recommended.&br;Both ASCII and binary formats are supported.&br;If you are importing models created with versions prior to FBX 7.4 (FBX 2014), you can enable the Optimization Option setting in the lower left corner of the Asset Picker when importing models into Bakin.&br;(However, it may not be displayed correctly.)&br;For details, see the "Import to Bakin" section below.| |Polygon Shape|Polygons other than triangular polygons are not displayed correctly.&br;Triangulated polygonization should be performed beforehand, or the Optimization Option setting should be enabled when importing models into Bakin.&br;(Triangular polygonization is automatically performed when the Optimization Option is enabled.)| |Size|The size of a terrain 1 block in Bakin is the same size in Blender as a primitive cube (dimensions 1m, scaling 0.5). &br;The standard character size pre-installed in Bakin is made to fit in a single terrain block.| |Materials|Multiple materials can be set for a single model.| |File Names|Please use only Latin letters and numbers.| |Maximum Number of Joints|The maximum number of joints in a skeleton structure is 1365 per model.&br;However, this limit varies between a minimum of 341 and a maximum of 1365, depending on the machine spec, according to the OpenGL specification.| |Weight Influence|(If the maximum number of weights exceeds 4, the one with the highest weight will be adopted first.)| #br //- モデルデータにモーションデータを含めた FBX を作成する場合は、モデルファイルに複数のアニメーションを設定し、モデルとベイク処理したアニメーションをまとめて 1 つの FBX ファイルとして出力します。 //なお、モーションの作業単位は 60fps です。(ベイク処理とは、アニメーションをモデルの頂点情報に焼き付ける処理のことです。) //- モーションデータだけを含んだ FBX を作成する場合、キャラクターモデルのボーンにはアニメーションを付けずに、メッシュ(ポリゴン)とスケルトン構造だけの FBX ファイルとして出力します。 ***Texture Data [#rc0a5066] &size(14){''2. Textures (.bmp and .png)''}; |File Format|BMP or PNG format is supported.| |File Names|Please use only Latin letters and numbers.| |Pixel Size|The recommended pixel size for textures is a number called a power of 2, such as 64 x 64, 128 x 128, 256 x 256, or 512 x 512.&br;Sizes such as 256 x 128 are also acceptable.&br;Setting a texture with a size other than a power of 2 may cause display problems.| |Transparent|Transparency can be expressed in the following ways&br;BMP Formats: Setting the Alpha Channel&br;PNG Format: Setting transparent area| |PBR (Physical Based Rendering)|Bakin uses PBR (Physical Based Rendering) for more realistic textures.&br;When using PBR rendering, it is recommended that three types of textures be set for one model: albedo map, normal map, and mask map.&br;See [[3D Textures;:https://rpgbakin.com/pukiwiki_en/?3D+Textures]] for more information on each texture.| // また、マスクマップがなくても、マスクマップで制御される設定はマテリアルプロパティによりある程度調整が可能です。 ★★★これは3Dテクスチャの説明にうつすつもりです。でもマテリアルのシェーダーの設定でカバーできるってことだと思うので表現を変える。 // #ref(追加に必要なファイル1.png) //• テクスチャファイルの例 //アルベドマップ テクスチャ //#ref(追加に必要なファイル2.png) //ノーマルマップ テクスチャ //#ref(追加に必要なファイル3.png) //マスクマップ テクスチャ //#ref(追加に必要なファイル4.png) //#br ***Motion Data [#e6eade3e] &size(14){''3. Motion Files (.fbx)''}; The supported FBX version and format are the same specifications as for the model file section. |File Format|FBX format is supported.| |File Names|Feel free to name them as you wish.&br;It would be easier to work with if you include a specific string, such as mot_MotionName(Latin letters and numbers).fbx. &br;Example: mot_walk.fbx, mot_wait.fbx, mot_run.fbx| |Working Unit|Frame Rate should be 60fps.| |Skeleton Structure and Bone Name|Please make sure it is the same as the model file.| **Advice on Adding/Modifying Models (FBX format) [#v6c11c9d] This section describes the process of adding models in FBX format and modifying motions. See [[.vrm Format Models:https://rpgbakin.com/pukiwiki_en/?3D+Characters#j317a3a7]] for the process of adding VRM format models. ***Motion Data Types [#t117d132] There are two ways to set up motions for a model. Decide which method you prefer. 1. Combining Model and Motions as One FBX File 2. Separating Model and Motions as Separate FBX Files - ''1. Combining Model and Motions as One FBX File'' The mesh (polygons), skeleton structure and motion data are combined into a single model file (FBX). The advantage of this method is that there is only one file to import into Bakin, making it easy to handle. --''How to Create Data on Blender'': In Blender, add each new motion at Dove Sheet > Actions and work with the Fake User pressed. #ref(./Blender-DopeSheet-en.png,60%) - ''2. Separating Model and Motions as Separate FBX Files'' Create separate files: a model file (FBX) with the mesh (polygon) and skeleton structure, and motion files (FBX) with the skeleton structure and motion data. The advantage of this method is that models with the same skeleton structure can share the same motions even if they have different mesh (polygon) shapes. However, models that share motion must also match each other in bone names and lengths. (*The human characters in the [[Game Gallery]]>“3D Tutorial” project use this method.) ***Export a Model from Bakin [#t5400678] If you want to modify a model that is pre-installed in Bakin, export the model from Bakin. In this section, we will use the model in the [[Game Gallery]]>3D Tutorial project to explain the process. - First, open the 3D tutorial project and select the following in the Resources > [[Models]] list. ---sb_SampleCast_model_A ---motion_AB Folder - Press the Export button at the top of the list to export to a folder of your choice. #ref(./3DCharacter_ExportfromBakin.png,50%) - ''.def File'' Exporting a model that has already been imported into Bakin will generate a .def file at the export destination. This file contains the material and texture association settings, so there is no need to re-configure the material settings when importing the model into Bakin. Even without a def file, materials and textures can be linked on Bakin. //#ref(standard_A2.png) //#br ***Blender Preferences [#eff5b8f5] Before importing a file exported from Bakin into Blender, set up the Blender environment. (The following Blender screenshots are settings in version 3.6). - ''Scene Units'' Please make sure that the scene units are set as follows. If the settings are different, the model will not be properly sized for FBX export. #ref(./ENシーンの単位.png) #br - ''Frame Rate'' The frame rate should be set to 60 fps. #ref(./Blender-60fps-en.png) #br ***Import into Blender [#g3289fa4] Import the file exported from Bakin into Blender. Launch Blender, select File > Import > FBX, and import with the following settings: #ref(./Blender-FBX-ImportSettings-EN.png) #br After importing the model into Blender, edit the polygon mesh and textures to your liking as needed. - ''Blender Texture Node Settings'' If you connect the textures as shown below in Blender, a_n_rm shader is automatically created and an "Albedo, Normal, and Mask" will be assigned when imported into Bakin. #ref(./Blender-NodeSetting-en.png) #br //***Blenderのエクスポートするフォルダを用意する //追加したい素材のファイルを⼊れるフォルダを⽤意します。 //このフォルダは追加の際に⼀時的に使⽤するだけで、ファイルの場所やフォルダ名は問いません。 //追加したモデルは、ゲームファイルフォルダ内のresフォルダ下へ、同じファイル名の別ファイルとして追加されます。 // //⽤意したフォルダの直下にモデルファイル(.fbx)とテクスチャファイル(.png)を⼊れます。 //設定ファイル(.def)がある場合はそれも同じフォルダに入れておきます。 //★★★例:[standard_A]フォルダに、追加したい素材(standard_A)を⼊れた場合 //#ref(standard_A1.png) ***Export from Blender [#z6e70f29] After editing of the model and motions is complete in Blender, export the data from Blender. - ''1. Combining Model and Motions as One FBX File'' Exporting with the following settings will result in a single FBX file with the model and motions. --''Export Settings'' FBX export settings should be configured as follows. #ref(./Blender-FBX-ExportSettings-en.png) ---''When Using a Normal Map'' When using shaders with configurable normal maps, be sure to turn on “Tangent Space” in the FBX Export Settings. (If turned off, it will not display correctly in Bakin.) #br ---''&color(red){(!)};''If you are using a version of Blender newer than 2.83 and the data exported with the above settings is displayed 90 degrees down on Bakin, you may be able to improve the situation by checking the “Transform > Use Space Transformation” checkbox on the FBX export screen. //#ref(Blender_空間の変換を使用.png) #ref(Blender_UseSpaceTransform.png) - ''2. Separating Model and Motions as Separate FBX Files'' Two types of fbx files need to be exported. -- Model Data: This data includes mesh + skeleton structure. This should be exported using the Export Settings described in 1. above. -- Motion Data: This data includes skeleton structure + motion data. With the mesh (other than polygons) selected in the editor, in addition to the Export Settings described in 1. above, turn on the “Selected Objects” checkbox in the Export Dialog to output the data. #ref(Blender-SelectedObjects-en.png) ***Import to Bakin [#q7a87c0e] - ''Importing the Model'' +Click the Add button in the Resources > [[3D Stamps]] entry tree and select the Asset Picker > "Local Files" tab. Or drag and drop the FBX file you want to import into the entry tree. #ref(./3DCharacter_ImporttoBakin_1.png,50%) #br --''Attention When Importing from Resources > Models'' It can also be imported from Resources > [[Models]], but the model must be "stamped" in order to place it on maps or make it usable in games.For more information on "Stamps," please visit [[What are 'Stamps'?]]. #br +Open the folder containing the model you wish to add and select the FBX file. If necessary, turn on "Optimization (Triangulation)" in the lower left corner of the Asset Picker. The scale is basically set to "1". #ref(./3DCharacter_ImporttoBakin_2.png,50%) #br --When “ Optimization” is turned on, the following processes are performed automatically. ---Skin weight normalization ---Polygon triangulation ---Applying Scale ---For FBX formats earlier than FBX7.4, conversion to FBX7.4 #br If the model file was not imported correctly, turn off "Optimization". #br +Press [Add and Exit]. A 3D stamp is generated with the imported model as the graphic. In this case, the "Model", "Material" and "Texture" information in the FBX file will be registered in Bakin. (Motions need to be imported separately. See below.) #ref(./3DCharacter_ImporttoBakin_4.png,50%) #br +If there is a material in the project that has "all the same texture" as the FBX material to be imported, the "Material Sharing" dialog opens. In this dialog you can choose whether to share materials or not. Materials can be reassigned in Resources > 3D Stamps even after importing. #br By assigning existing materials with all the same textures to an imported model, you can share materials with other models in the project. #br --''Advantages/Disadvantages of Sharing'' ---''<Advantages>'' ~-By simply adjusting one material, you can adjust all objects that share the material. //~-無駄なマテリアルデータを持つ必要がなくなります。 ~-The number of material data in the game can be reduced. ---''<Disadvantages>'' ~-It is no longer possible to adjust the texture of only one of the objects that share a material. (You can also stop sharing by copying the shared material after importing it into Bakin and reassigning it to the 3D stamp.) #br ''&color(red){(!)};'' Please consider using the "Internal Format Settings" function in Game Definition > Project Settings > [[Game Engine Settings:https://rpgbakin.com/pukiwiki_en/?Project+Settings#z806f86b]]. #ref(./Material_ImportedMaterialsDialog.png,50%) #br --''The "Material Sharing" dialog offers the following options:'' --- ''Automatically Assign Materials'' Automatically assign materials with the same textures in the project. If there are multiple target materials, the first material registered in the project will be assigned. All materials that have not been set up with textures will be imported as new materials. #br --- ''Add All as "New Materials"'' Import all materials as new materials, even if there are materials in the project that use the same textures. Select this option if you do not want to share materials with other stamps or models. #br --- ''Manually Select Materials to Assign'' For each material in the model to be imported, manually select a material in the project that uses the same textures. If there are multiple target materials, you can choose which one to assign. For materials that are not set with textures, assign them from among an "untextured material" in the project. #br --''What does "all textures are the same material" mean?'' A material in which all the textures specified for the material match (including the case where no textures are specified). For example, if a material has textures specified for the albedo map, normal map, and mask map, as shown in the figure below, all three must match. #ref(./Material_Imported Materials_1.png,50%) #br +The model data of the 3D stamped models will also be added as an entry in Resources > [[Models]]. The storage location of the added file will be displayed in [Model Settings > Basic > Folder Name]. In addition, a texture folder is automatically created and the textures are stored in this folder. #ref(./3DCharacter_ModelList.png,50%) #br //#ref(BAKIN への追加⽅法3.png) #br Assets added using [Local Files] will be differentiated from the system assets [reserved] that have been registered from the beginning and will be displayed in black. #br User assets are saved in the game file when the game is saved. The original files are not used as is. #br - ''Importing Motions'' +Click on Resources > 3D Stamps > Stamp Settings (right side) > Motion Settings > Motion field. In Asset Picker > Resources, select and add the model you just imported. #ref(./3DCharacter_ImporttoBakin_5.png,50%) #br This generates a "motion set" and assigns the motion set to the 3D stamp. #br +Go to Resources > Motions. Select the motion set you just added in the motion set list on the left side of the screen. #ref(./3DCharacter_ImporttoBakin_6.png,50%) #br --''Combining Model and Motions as One FBX File'' The motions included in the FBX are automatically registered in the motion list on the right side of the screen as a result of the previous operation. ---If there are multiple motions (actions) in a motion file, they are loaded as separate motions. #br --''2. Separating Model and Motions as Separate FBX Files'' In this case, you will need to manually add motions to the motion set. Click on the “Add Motion” button in the Motion List, go to the Asset Picker > "Local Files" tab, and add the FBX files for the motion. #ref(./3DCharacter_ImporttoBakin_7.png,50%) #br #br ''&color(red){(!)};''When imported into Bakin, motions are initially set to "no looping". If you wish to loop the animation, go to Resources > Motion Properties and turn on the "Loop" setting for the relevant motion.#ref(./3DCharacter_Motion_Loop.png,50%) #br ''&color(red){(!)};''The added motion FBX will be registered under Resources > Models. #br +cBy setting the motion names to the specified names, the motions will be linked to the actions in the game. For example, if the motion name is "walk", it will be used as the motion for the cast to walk. See [[Motion Name Rules]] for motion names. #ref(./3DCharacter_Motion_Rename.png,50%) #br ***Update Models and Motions after Import[#gf4addc3] After importing a model or motion into Bakin, if you have changed the content of the original FBX file, you can update the data in Bakin as follows: +Go to Resources > Models and select the appropriate entry. +Press "Update Information". #ref(./3DCharacter_Model_ReImport.png,50%) #br +If you change the frames of a motion, go to Resources > Motions, select the relevant motion set, and change the number of start/end frames in its motion list. ---- **.vrm Format Model [#q3343850] You can use .vrm format models as 3D characters. **VRM Format Models [#q3343850] You can use VRM format models as 3D characters. VRM models can be created using [[Vroid Studio:https://vroid.com/studio]], for example. You can also use shape keys in the VRM file. ***Adding VRM Models [#ke01b9ff] Click the Add button in the Resources > 3D Stamps entry tree and select the VRM model to be imported from the "Local Files" tab of the Asset Picker. - Motions and materials pre-installed in Bakin are automatically assigned upon import. ***Importing VRM Models [#jbdac781] Click the Add button in the 3D Stamp list under Resources > [[3D Stamps]] and select the VRM file you wish to import from the “Local Files” tab of the Asset Picker. The motions pre-installed in Bakin are automatically assigned upon import. The motions to be assigned are located in Resources>Motions>reserved folder>VRM. - Blend shapes must be assigned separately. Go to Resources > Blend Shapes, press the Add button, and select the VRM model you have already imported from the "Ready to Use" tab of the Asset Picker. - The following restrictions apply to motion at this time: - ''Limitation on Motions'' The following limitation exists at this time: -- If the base model has different bone lengths, those motions cannot be mixed. //VRM0.x用の場合、hipsに移動が入っていなければ可能です //-- ベースモデルがVRM0.xとVRM1.0のモーションは混在できません。★★★混在OKになりましたっけ?→OKです - ''&color(red){(!)};''In some cases, VRM format models use large texture sizes, which can affect the operation of tools and games. (loading, etc., takes longer and runs slower) Please consider using the “Internal Format Settings” function in Game Definition > Project Settings > [[Game Engine Settings:https://rpgbakin.com/pukiwiki_en/?Project+Settings#z806f86b]]. - ''Note on Textures'' (!)In some cases, VRM format models use large texture sizes, which can affect the operation of tools and games. (loading, etc., takes longer and runs slower) Please consider using the “Internal Format Settings” function found in Game Definition > [[Project Settings]]>Game Engine Settings. - ''Files Generated on Import'' The following fbx file is automatically generated in the folder where the VRM file to be imported was located. Please use them as needed. |.vrm.x100.fbx|This file is a VRM model converted to standard fbx.| |.vrm.humanoid.fbx|This is a file in which the bones are simplified and converted to bone names in line with Unity's Humanoidbody.| |.vrm.mixamo.fbx|This file further simplifies the bones and makes them easier to import into Mixamo.| - ''Blend Shape Settings'' You can blend shape keys contained in a VRM model to set the expression. Go to Resources > [[Blend Shapes]], press the Add button, and select the VRM model you have already imported from the “Ready to Use” tab of the Asset Picker. See [[Blend Shapes]] for more information on how to blend shape keys. ***Adding Motions with Mixamo to VRM Models [#dbf28686] To add motions using Mixamo (https://www.mixamo.com/) for motions that are automatically assigned upon import, follow the steps below. The following assumes that you have already imported a VRM model into your Bakin project. +Log in to Mixamo (https://www.mixamo.com/). #br +Press the "Upload Character" button. #br +Drag and drop the following model under the folder where Bakin is installed into the dialog. (The file path will change depending on where you installed Bakin.) C:\Program Files (x86)\Steam\steamapps\common\BAKIN\contents\templates\3DAssetTutorial\res\model\SampleMan_vrm\SampleMan_vrm.fbx +Drag and drop the generated .vrm.mixamo.fbx of the model. #br +Select a motion from the left column of Mixamo. #br +Fine-tune with the right parameters as needed. #br +When you have finished making adjustments, click the Download button. Download Settings are set in the following: ---Format: FBX Binary (.fbx) ---Skin: Without Skin ---Frames per Second: 60 ---Keyframe Reduction: none #br Up to this point, this is the process on Mixamo. #br +In Bakin, open Resources > Motions, copy and paste reserved>VRM>SampleMan_vrm_sample_motion #br +Select the pasted SampleMan_vrm_sample_motion_2 and click "Add Motion" in the motion list on the right side of the screen. #br +From the "Local Files" tab of the Asset Picker, select the FBX file you just downloaded from Mixamo and click "Add and Exit" #br +Change the "Motion Name" of the data added to the motion list as appropriate, and set whether or not to loop. (If you want motions to be assigned automatically in battles, etc., please see the [[list of motion name rules:https://rpgbakin.com/pukiwiki_en/?Motion+Name+Rules]].) #br +Go back to Resources > 3D Stamps and select the stamp (created from the VRM model) to which you want to add motions. #br +Click on the “Motion Settings > Motions” field of the properties on the right side of the screen. #br +In the “Ready to Use” tab of the Asset Picker > “Motions”, select the motion set you just created. #br This is the end of adding motions. If you wish to add more new motions, repeat steps 4 through 6 (working in Mixamo) and 8 through 10. //***VRM1.0モデルのモーションの作り方 [#k43b4774] //Blenderを使う //VRM1.0対応 //Vroid StudioでVRM1.0モデルを作成する //BlenderにVRMモデルを読みこむ //Blenderで改造する //Blenderからエクスポートする