2023年10月19日木曜日

The Meshes of ModularAnimalRobotBiped

 

Tails

Power parts

Pelvises

Necks

Legs

Heads

Bodies

Arms

Animation patterns of ModularAnimalRobotBiped

 







How To Use ModularAnimalRobotBiped.

https://www.youtube.com/watch?v=nUGIblZhw9Q

Modular Animal Robot Biped is an asset that allows you to create characters with various patterns by combining parts consisting of legs, pelvis, torso, neck, head, tail, and arms.


You can change the mesh, material, and size of each part by opening BP_AnimalRobotBipedAnimatedCharacter and changing the variable AnimalRobotBipedPattern.

- Three patterns of materials are available for each part.

Materials can also be changed randomly in bulk.
If you turn on IsChangeMaterialPattern, it will be set randomly, and if you turn on IsFixMaterialPattern, it will be unified to the material specified in FixedMaterialPattern.

When RandomColor is turned on, a random parameter with a spread of ColorRandomnessIntensity centered on CenterColor will be set to the material.

Turning on IsRandomMesh sets the mesh in a random pattern.
When IsRandomSize is turned on, the size of each part will be set randomly within the range of 0.8-1.2.

When randomness is on, the variables change randomly each time you change the variable.
These randomnesses are applied when you spawn into the scene, so they won't look the same in the viewport.
If you have a pattern you want to use, use the variable values as follows.
1. Copy the AnimalRobotBipedPattern of the character in the scene
2.Open BP_AnimalRobotBipedAnimatedCharacter and turn off randomness.
3. Paste the AnimalRobotBipedPattern.

By using EUW_BipedCharacterAnimatedSpawn, you can place Xnumber x Ynumber BP_AnimalRobotBipedAnimatedCharacters in a random pattern in the scene.

Control rigs are set on the legs and arms.
The pelvic suspension has a spring that expands and contracts according to your movements.

In the demo scene, you can check the behavior of the third-person character.

BP_AnimalRobotBipedProceduralCharacter is similar to BP_AnimalRobotBipedAnimatedCharacter, but the walking animation is procedural. 

画像サイズの一括変更

WindowsでImageMagick
https://imagemagick.org/index.php
でフォルダとサブフォルダ内のpng画像ファイルのサイズを1024x1024に変える方法
コマンドプロンプトでフォルダに移動し

 forfiles /S /M *.png /C "cmd /c magick mogrify -resize 1024x1024 @path

を実行

2023年9月27日水曜日

選択した複数のメッシュについてアーマチュアも含めて個別にFBXとしてエクスポートするBlender Pythonスクリプト

 import bpy


# 選択されたメッシュオブジェクトを取得

selected_meshes = [obj for obj in bpy.context.selected_objects if obj.type == 'MESH']


for mesh in selected_meshes:

    # すべてのオブジェクトの選択を解除

    bpy.ops.object.select_all(action='DESELECT')

    

    # メッシュを選択

    mesh.select_set(True)

    

    # メッシュに関連付けられているアーマチュアを探す

    armature = None

    if mesh.parent and mesh.parent.type == 'ARMATURE':

        armature = mesh.parent

        armature.select_set(True)

    

    # アクティブなオブジェクトを設定 (エクスポートの際に必要)

    bpy.context.view_layer.objects.active = mesh

    

    # FBXとしてエクスポート

    bpy.ops.export_scene.fbx(

        filepath=f"path_to_save/{mesh.name}.fbx",

        use_selection=True,

        mesh_smooth_type='FACE',

        bake_anim=False,

        add_leaf_bones=False,

        primary_bone_axis='X',

        secondary_bone_axis='Y',

        global_scale=1.0

    )


2023年9月26日火曜日

BlenderでFBXの一括Export

import bpy

import json


# テキストファイルからエクスポートリストを読み込む

with open("your_filepath/export_list.txt", "r") as file:

    export_list = json.load(file)


# 各オブジェクトグループをFBXとしてエクスポート

for group in export_list:

    # すべてのオブジェクトの選択を解除

    bpy.ops.object.select_all(action='DESELECT')

    

    # グループ内のオブジェクトを選択

    for obj_name in group:

        obj = bpy.data.objects.get(obj_name)

        if obj:

            obj.select_set(True)

    

    # アクティブなオブジェクトを設定 (エクスポートの際に必要)

    bpy.context.view_layer.objects.active = bpy.data.objects.get(group[0])    

    

    # FBXとしてエクスポート

    bpy.ops.export_scene.fbx(

        filepath=f"your_filepath/{group[0]}.fbx",
        #filepath=f"path_to_save/{'_'.join(group)}.fbx",

        use_selection=True,
         # 出力設定色々

        mesh_smooth_type='FACE',

        bake_anim=False,

        add_leaf_bones=False,

        primary_bone_axis='X',

        secondary_bone_axis='Y',

        global_scale=0.01 

    )





----------------------------------------------------------------

[

    ["Mesh1", "Armature1"],

    ["Mesh2", "Mesh3"],

    ["Armature1"]

]

みたいなテキストファイルを読み込んで使用する

2023年8月24日木曜日

Change the texture group of the selected textures.

 import unreal


# エディタ内で選択されたアセットを取得

selected_assets = unreal.EditorUtilityLibrary.get_selected_assets()


for asset in selected_assets:

    if isinstance(asset, unreal.Texture2D):

        # Texture GroupをCharacterに設定

        asset.set_editor_property('LODGroup', unreal.TextureGroup.TEXTUREGROUP_CHARACTER)

        # アセットの変更を保存

        unreal.EditorAssetLibrary.save_loaded_asset(asset)





 #他の値に変更する場合はTEXTUREGROUP_CHARACTERの代わりに以下のEnumを使用する

 #https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/TextureGroup.html