Flexi-Blender is an innovative script tool that leverages the power of Python scripting within Blender to automate the process of animating characters using data from CSV files. This script tool is designed to streamline the animation workflow by importing 3D matrix data from CSV files and applying it directly to character animations in Blender, allowing for a more efficient and streamlined animation process.
To get started, you'll first need to set up your environment correctly and ensure you have the necessary dependencies installed.
Before you begin, make sure you have Blender installed on your system.
-
Clone the repository to your local machine.
git clone https://github.com/flexitrace/flexi-blender.git -
Open the Blender application and load the
model.blendfile from the cloned repository. -
Before running the main script, execute the
setup_env.pyscript within Blender to install the requiredpandaspackage. You can do this by opening the script in Blender's text editor and running the script (or by using the built-in Python console).
import pip
pip.main(['install','pandas~=2.1.0'])- Run the Animation Script Now, open the csv_to_animation.py script in the script tab or text editor within Blender, and execute it. Once run, the animation data will be applied to the character rig, animating it according to the data in the sample.csv file.
Once the environment is set up, you can use the csv_to_animation.py script to animate your character with the 3D matrix data from the sample.csv file. Here's how to use the script:
Load the csv_to_animation.py script in Blender's text editor. Run the script. This script reads data from the sample.csv file and uses it to animate the character in the model.blend file.
Here's a brief explanation of the main components of the csv_to_animation.py script:
LOC_OR_GLOB: Specifies whether the transformations are in local or global coordinates.
OBJECT_NAME: The name of the object to be animated.
ARMATURE_NAME: The name of the armature controlling the object.
CSV_FILE: The path to the CSV file containing the animation data.
MATRIX_LOC_OR_GLOB: Specifies which coordinate system (local or global) to use from the LOC_OR_GLOB list.
csv_to_animation2(obj, arm, csv_file, loc_or_glob)
This function takes the object name, armature name, CSV file path, and coordinate system as arguments, and animates the character based on the data in the CSV file.
We welcome contributions to the Flexi-Blender project! Please feel free to open an issue or create a pull request with your improvements or suggestions.