2024年4月22日月曜日

Efficient Use of Blender Assets

-How to bake actions in Blender

http://eizouasobi.blogspot.com/2024/04/how-to-bake-actions-in-blender.html


-How to split actions in Blender

http://eizouasobi.blogspot.com/2024/04/how-to-split-actions-in-blender.html


-How to use in game engine

https://eizouasobi.blogspot.com/2019/01/how-to-use-in-game-engine.html


Formatting Animation Name Files for Use with ActionMaking.py

If the animation number files attached to your assets are not in the correct format for use with the ActionMaking.py script, please use the FormatAnimationNamesAnimColonNum.py script to adjust them.


This script performs the following tasks:

-Removes empty lines and trailing colons: This step cleans up unnecessary formatting that may interfere with processing.

-Replaces spaces with colons: This adjustment is made for lines where the frame range and animation name are separated by spaces instead of colons, ensuring consistency in data format.

-Checks and adjusts the position of name and frame data: This part verifies whether the line format is 'frames:name' or 'name:frames' and adjusts accordingly.

-Processes frame data: Depending on the number of listed frame ranges, the script selects the appropriate frames (the middle ones if there are four frames, the first two if there are three).

For example, a file with lines like:

50-80-110-140:WalkForward:

IdleToTrot:3850-3880-3910

will be changed to:

WalkForward:80-110

IdleToTrot:3850-3880

If there are any extraneous comments or notes that cannot be adjusted by this script, please remove them before running the script.

2024年4月20日土曜日

How to split actions in Blender

One of the ways to further utilize animation assets in Blender is to split actions. Here is a step-by-step guide on how to split actions.


Step 1: Baking the Animation

First, bake the animation in Blender. This involves solidifying the animation data and making any necessary adjustments such as removing root motion. For detailed instructions, please refer to this link.


Step 2: Preparing a Text File for Action Splitting

Prepare a text file in the following format to split actions:

WalkForward:10-40

WalkRight:50-80

If the format of the animation names in the text file differs (e.g., "10-40 WalkForward"), please adjust the format using the script provided at this link.


Step 3: Using the ActionMaking.py Script

Open the ActionMaking.py script from Blender’s text editor. Set the file_path to the path of the text file prepared in Step 2, and set the original_action_name to the name of the action you want to split.


Step 4: Running the Script

Select the target armature and run the Run Script. This will appropriately split the specified action based on the text file, making each action available as a separate item.


ActionMaking.py


import bpy


# Function to load animation names and frame ranges from a text file

def load_animation_data(file_path):

    with open(file_path, 'r') as file:

        animation_data = [line.strip().split(':') for line in file if line.strip()]

    return [(data[0], tuple(map(int, data[1].split('-')))) for data in animation_data]


# Function to duplicate the specified action and set up each copy as an independent animation clip

def duplicate_and_setup_actions(obj, original_action_name, animation_data):

    original_action = bpy.data.actions.get(original_action_name)

    if not original_action:

        print("Original action not found:", original_action_name)

        return


    for anim_name, (start_frame, end_frame) in animation_data:

        # Duplicate the action and assign a new name

        new_action = original_action.copy()

        new_action.name = anim_name


        # Trim the action's keyframes to the specified frame range

        for fcurve in new_action.fcurves:

            keyframe_points = [kp for kp in fcurve.keyframe_points if start_frame <= kp.co.x <= end_frame]

            fcurve.keyframe_points.clear()

            for kp in keyframe_points:

                fcurve.keyframe_points.insert(frame=kp.co.x - start_frame, value=kp.co.y)


        # Optionally set the new action to the object (for demonstration, not always necessary)

        obj.animation_data.action = new_action


# Main execution block

if __name__ == "__main__":

    file_path = "C:\BlenderAsset\AnimationNames1.txt"  # Set the file path appropriately

    obj = bpy.context.object  # Get the current object

    original_action_name = "Action"  # Name of the original action to duplicate


    # Load animation data from the file

    animation_data = load_animation_data(file_path)

    # Duplicate and set up actions

    duplicate_and_setup_actions(obj, original_action_name, animation_data)


How to bake actions in Blender

1.Select all bones in Pose Mode.

2.Go to the menu in the 3D Viewport and select Pose -> Animation -> Bake Action.

3.Ensure these five options are set before clicking OK:

-Set the Start Frame.

-Set the End Frame.

-Check the box for Visual Keying.

-Check the box for Clear Constraints.

-For Bake Data, select Pose.

This should consolidate everything into a single action.






2024年4月1日月曜日

Avian Adventure MR

Avian Adventure MR is an MR action game consisting of four stages.  You can control a bird flying around a real room to collect fruits and coins.

Overview:

 In the entrance scene, you can select a stage and start each stage by clicking the start button. The game begins when you press the grip and trigger buttons at the same time, and a bird comes out of the cage. You can take off with the left controller's Y button and control it with the left and right thumbsticks. Scores are added when you collect lemons growing from the walls of the real room or coins in the air. Touching enemy that appear along the way will cause damage and reduce HP, and the game is over when HP reaches zero. The game clears after one minute, and the score you earned is recorded. The top ten rankings are displayed in the entrance.


Detailed Instructions and Precautions:

If the logo matching the shape of the room does not appear in the entrance scene, the room model setup is incomplete. Please close the app and run the room scan in the settings. If you do not know how to set it up, you can also scan the room model by running the Quest 3's First Encounter app.

-In the entrance, you can reset the position of the menu panel using the start button on the left controller.

-During the game, pressing the start button on the left controller will switch the display of the hand menu.

-In the entrance menu and hand menu, you can toggle on and off the music and controller vibration.

-The content of the cube displayed in the entrance changes with each stage clear. This cube can be moved by gripping the corner with the controller and its size can be changed.

Avian Adventure MR privacy policy

 1. Data Collection Explanation:

Our app does not collect any personal data from users. We respect your privacy and ensure that no personal information is gathered.


2. Data Usage Explanation:

Since our app does not collect any personal data, we do not use any user data for any purpose.


3. Data Deletion Policy:

As no personal data is collected or stored by our app, there is no need for a data deletion request.


4. Data Protection Compliance:

Our organization and app comply with data protection regulations. We do not collect or store any user data, thereby eliminating the risk of security vulnerabilities related to data privacy.

2024年1月24日水曜日

Room Reflect Shooter MR privacy policy

1. Data Collection Explanation:
Our app does not collect any personal data from users. We respect your privacy and ensure that no personal information is gathered.

2. Data Usage Explanation:
Since our app does not collect any personal data, we do not use any user data for any purpose.

3. Data Deletion Policy:
As no personal data is collected or stored by our app, there is no need for a data deletion request.

4. Data Protection Compliance:
Our organization and app comply with data protection regulations. We do not collect or store any user data, thereby eliminating the risk of security vulnerabilities related to data privacy.

Room Reflect Shooter MR

 Overview:

This is an MR shooting game consisting of three stages. In the entrance scene, you select a stage and click the start button to begin each stage. Enemies appear on the walls of the real room, and you shoot them down with fireballs released by pulling the controller's trigger. The fireballs reflect off the walls of the real room. The game ends after a set time, resulting in either game clearance or the appearance of a boss. Defeating the boss results in game clearance. Upon clearing the game, your score is recorded based on the type of enemies defeated, with rankings up to the top 10.

Detailed Instructions and Cautions:

-If the walls matching the room's shape do not appear in the entrance scene, the room model setup is incomplete; close the app and perform a room scan in the settings.

If you don't know how to set it up, you can also scan the room model by running the First Encounter app for Quest3.

-In the entrance, you can reset the position of the menu panel using the start button on the left controller.

-During the game, pressing the start button on the left controller toggles the hand menu display.

In the entrance or hand menu, you can toggle the music and controller vibration on and off.

-You can fire up to five fireballs at once.

-Fireballs disappear after hitting an enemy, yourself, or after five seconds.

-Fireballs, whether yours or the enemy's, cause damage if they hit your head, and the game ends in game over if you take a certain amount of damage.


Privacy Policy