### Initiate Skin Model Training Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Run this command to start the skin model training process. Modify the task configuration file as needed. ```python python run.py --task=configs/task/train_rignet_skin.yaml ``` -------------------------------- ### Create Virtual Environment Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Recommended setup using Conda to manage project dependencies. ```bash conda create -n UniRig python=3.11 conda activate UniRig ``` -------------------------------- ### Install Blender Addon Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Installs the modified VRM addon for Blender from the project root. ```bash python -c "import bpy, os; bpy.ops.preferences.addon_install(filepath=os.path.abspath('blender/add-on-vrm-v2.20.77_modified.zip'))" ``` -------------------------------- ### Install Dependencies Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Commands to install required Python packages and specific versions of PyTorch-related libraries. ```bash python -m pip install torch torchvision python -m pip install -r requirements.txt python -m pip install spconv-{you-cuda-version} python -m pip install torch_scatter torch_cluster -f https://data.pyg.org/whl/torch-{your-torch-version}+{your-cuda-version}.html --no-cache-dir python -m pip install numpy==1.26.4 ``` -------------------------------- ### Initiate Skeleton Model Training Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Run this command to start the skeleton model training process. Training configuration is managed through task YAML files. ```python python run.py --task=configs/task/train_rignet_ar.yaml ``` -------------------------------- ### Download Model Checkpoints Source: https://context7.com/vast-ai-research/unirig/llms.txt Automatically downloads pre-trained model checkpoints from Hugging Face. Use to get local paths for skeleton and skinning prediction models. ```python from src.inference.download import download # Download skeleton prediction checkpoint skeleton_ckpt = download('experiments/skeleton/articulation-xl_quantization_256/model.ckpt') # Returns local path to downloaded checkpoint # Download skinning prediction checkpoint skin_ckpt = download('experiments/skin/articulation-xl/model.ckpt') # Available checkpoints on Hugging Face (VAST-AI/UniRig): # - skeleton/articulation-xl_quantization_256/model.ckpt # - skin/articulation-xl/model.ckpt # - skin/skeleton/model.ckpt ``` -------------------------------- ### Direct Python Usage for Mesh Extraction Source: https://context7.com/vast-ai-research/unirig/llms.txt Python functions for extracting and processing 3D model files. Use to get a list of files, run extraction, and save processed data. ```python # Direct Python usage for extraction from src.data.extract import extract_builtin, get_files, load, clean_bpy from src.data.extract import process_mesh, process_armature, get_arranged_bones, save_raw_data # Get list of files to process files = get_files( data_name='raw_data.npz', inputs='model1.fbx,model2.glb', # Comma-separated files input_dataset_dir='./dataset_raw', output_dataset_dir='./dataset_clean', require_suffix=['obj', 'fbx', 'FBX', 'glb', 'gltf', 'vrm'], force_override=False, warning=True ) # Run extraction on file list extract_builtin( output_folder='./dataset_clean', target_count=50000, # Max faces after simplification num_runs=1, id=0, time='2024_01_01_12_00_00', files=files ) ``` -------------------------------- ### Clone Repository Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Initial step to download the UniRig source code. ```bash git clone https://github.com/VAST-AI-Research/UniRig cd UniRig ``` -------------------------------- ### Preprocess Data for Training Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Use this script to preprocess your custom dataset for training. Ensure `input_dataset_dir` and `output_dataset_dir` are correctly set in the configuration file. ```bash bash launch/inference/preprocess.sh --config configs/data/ --num_runs ``` -------------------------------- ### Generate Skinning Weights for Multiple Models Source: https://context7.com/vast-ai-research/unirig/llms.txt Process multiple rigged models in a directory to generate skinning weights. Specify the input directory containing rigged models and the output directory for skinned models. ```bash bash launch/inference/generate_skin.sh \ --input_dir skeleton_models/ \ --output_dir skinned_results/ ``` -------------------------------- ### Generate Skinning Weights with Custom Task Config Source: https://context7.com/vast-ai-research/unirig/llms.txt Use a custom configuration file for the skinning weight prediction task. This allows for fine-tuning inference parameters. ```bash bash launch/inference/generate_skin.sh \ --input examples/skeleton/giraffe.fbx \ --output results/giraffe_skin.fbx \ --skin_task configs/task/custom_skin_inference.yaml ``` -------------------------------- ### Run Skinning Prediction via Python Source: https://context7.com/vast-ai-research/unirig/llms.txt Execute skinning weight prediction using the main Python script. Specify the task configuration, input rigged model, output path, and the name of the skeleton prediction file. ```bash python run.py \ --task=configs/task/quick_inference_unirig_skin.yaml \ --input=examples/skeleton/giraffe.fbx \ --output=results/giraffe_skin.fbx \ --npz_dir=tmp \ --data_name=predict_skeleton.npz ``` -------------------------------- ### Generate Skeleton from Input File Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Execute this script to generate a skeleton from an input file using the specified inference task configuration. ```bash bash launch/inference/generate_skeleton.sh --input examples/giraffe.glb --output examples/giraffe_skeleton.fbx --skeleton_task configs/task/rignet_ar_inference_scratch.yaml ``` -------------------------------- ### Run Skinning Weight Prediction Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Commands for predicting skinning weights based on an existing skeleton. ```bash # Skin a single file bash launch/inference/generate_skin.sh --input examples/skeleton/giraffe.fbx --output results/giraffe_skin.fbx # Process multiple files in a directory bash launch/inference/generate_skin.sh --input_dir --output_dir ``` -------------------------------- ### Render preview image Source: https://context7.com/vast-ai-research/unirig/llms.txt Generates a preview image of the model at a specified resolution. ```python raw_data.export_render( path="output/preview.png", resolution=(256, 256) ) ``` -------------------------------- ### Extract and Preprocess 3D Models using Bash Source: https://context7.com/vast-ai-research/unirig/llms.txt Command-line tools for extracting and preprocessing 3D model files into a standardized npz format. Use for single model extraction or batch processing for training. ```bash # Extract and preprocess a single model bash launch/inference/extract.sh \ --input examples/giraffe.glb \ --output_dir tmp/ # Batch preprocess models for training bash launch/preprocess.sh \ --config configs/data/rignet.yaml \ --num_runs 4 \ --force_override true \ --faces_target_count 50000 # Preprocess with custom suffix filter bash launch/preprocess.sh \ --config configs/data/rignet.yaml \ --require_suffix "fbx,FBX,glb,gltf" \ --num_runs 8 ``` -------------------------------- ### Export Render Source: https://context7.com/vast-ai-research/unirig/llms.txt Renders a preview image of the model. ```APIDOC ## [METHOD] export_render ### Description Generates a preview image of the current model state. ### Parameters #### Request Body - **path** (string) - Required - Output image path - **resolution** (tuple) - Optional - Image resolution (width, height) ### Request Example raw_data.export_render(path="output/preview.png", resolution=(256, 256)) ``` -------------------------------- ### Generate Skeleton for Multiple Models Source: https://context7.com/vast-ai-research/unirig/llms.txt Process multiple 3D model files in a directory to generate skeletons. Specify input directory and output directory. ```bash bash launch/inference/generate_skeleton.sh \ --input_dir my_models/ \ --output_dir results/ ``` -------------------------------- ### Export FBX with detailed options Source: https://context7.com/vast-ai-research/unirig/llms.txt Configures specific rigging parameters such as bone extrusion, vertex group limits, and normalization during FBX export. ```python raw_data.export_fbx( path="output/rigged_model.fbx", extrude_size=0.03, # Size of bone extrusion group_per_vertex=4, # Max vertex groups per vertex (-1 for all) add_root=False, # Add a root bone do_not_normalize=False, # Skip weight normalization use_extrude_bone=True, # Create extruded bone visuals use_connect_unique_child=True, # Connect bones with single child extrude_from_parent=True, # Extrude direction from parent use_tail=True, # Use predicted tail positions custom_vertex_group=None # Override skinning weights ) ``` -------------------------------- ### Exporter Utilities Initialization Source: https://context7.com/vast-ai-research/unirig/llms.txt Imports necessary classes for data handling and exporting. This snippet sets up the environment for using the Exporter utility and loading raw data. ```python from src.data.exporter import Exporter from src.data.raw_data import RawData import numpy as np # Load data and export with custom options raw_data = RawData.load("dataset_clean/model/raw_data.npz") ``` -------------------------------- ### Generate Skinning Weights for Single Model Source: https://context7.com/vast-ai-research/unirig/llms.txt Predict per-vertex skinning weights for a 3D model that already has a skeleton. Specify the input rigged model and the output path for the skinned model. ```bash bash launch/inference/generate_skin.sh \ --input examples/skeleton/giraffe.fbx \ --output results/giraffe_skin.fbx ``` -------------------------------- ### Run Custom Skeleton Inference Task Source: https://context7.com/vast-ai-research/unirig/llms.txt Bash script to launch a custom skeleton inference task. Specify input model, output path, and the configuration file for the skeleton task. ```bash bash launch/inference/generate_skeleton.sh \ --input examples/giraffe.glb \ --output results/giraffe_skeleton.fbx \ --skeleton_task configs/task/custom_skeleton_inference.yaml ``` -------------------------------- ### Export skeleton visualization Source: https://context7.com/vast-ai-research/unirig/llms.txt Exports skeleton structures as OBJ files, supporting both single files and sequential exports. ```python raw_data.export_skeleton("output/skeleton.obj") raw_data.export_skeleton_sequence("output/skeleton") # Creates skeleton_0.obj, skeleton_1.obj, etc. ``` -------------------------------- ### Skinning Training Configuration Source: https://context7.com/vast-ai-research/unirig/llms.txt Configuration for training skinning prediction models. This YAML file specifies components, optimizer, and various loss functions for skinning prediction. ```yaml # configs/task/train_rignet_skin.yaml - Skinning training config mode: train experiment_name: &experiment_name train_rignet_skin epochs: &epochs 300 components: data: rignet_bs2 transform: train_rignet_skin_transform model: unirig_skin system: skin optimizer: __target__: adamw lr: 0.00005 weight_decay: 0.25 loss: vertex_loss: 5.0 normalization_loss: 10.0 skin_l1_loss: 0.3 bce_loss: 1.0 skin_zero_l1_loss: 1.0 skin_non_zero_l1_loss: 1.0 trainer: num_nodes: 1 devices: 8 precision: bf16-mixed max_epochs: *epochs accelerator: gpu strategy: fsdp accumulate_grad_batches: 2 ``` -------------------------------- ### Visualize Dataset Data Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Loads raw dataset files and exports them as FBX models. ```python from src.data.raw_data import RawData raw_data = RawData.load("dataset_clean/rigxl/12345/raw_data.npz") raw_data.export_fbx("res.fbx") ``` -------------------------------- ### Merge Full Skinning Prediction with Original Model Source: https://context7.com/vast-ai-research/unirig/llms.txt Integrate the predicted skinning weights into the original 3D model. This results in a fully rigged asset with animation-ready skinning. ```bash bash launch/inference/merge.sh \ --source results/giraffe_skin.fbx \ --target examples/giraffe.glb \ --output results/giraffe_rigged.glb ``` -------------------------------- ### Run Inference Script for UniRig Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Execute this bash script to perform inference using the specified input, output, and task configuration. ```bash bash launch/inference/generate_skin.sh --input examples/skeleton/giraffe.fbx --output results/giraffe_skin.fbx --skin_task configs/task/rignet_skin_inference_scratch.yaml ``` -------------------------------- ### Generate Skeleton with Mesh Simplification Source: https://context7.com/vast-ai-research/unirig/llms.txt Customize the mesh simplification process during skeleton generation by setting a target face count. This can reduce complexity for large models. ```bash bash launch/inference/generate_skeleton.sh \ --input examples/giraffe.glb \ --output results/giraffe_skeleton.fbx \ --faces_target_count 30000 ``` -------------------------------- ### Inference Task Configuration for UniRig Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Configure this YAML file for inference tasks after training. Ensure `resume_from_checkpoint` points to your trained model. ```yaml mode: predict debug: False experiment_name: test resume_from_checkpoint: experiments/train_rignet_skin/last.ckpt components: data: quick_inference system: skin transform: inference_skin_transform model: unirig_skin data_name: raw_data.npz writer: __target__: skin output_dir: ~ add_num: False repeat: 1 save_name: predict export_npz: predict_skin export_fbx: result_fbx trainer: max_epochs: 1 num_nodes: 1 devices: 1 precision: bf16-mixed accelerator: gpu strategy: auto inference_mode: True ``` -------------------------------- ### Skeleton Training Configuration Source: https://context7.com/vast-ai-research/unirig/llms.txt Configuration for training skeleton prediction models. This YAML file defines components, optimizer, scheduler, loss functions, trainer settings, wandb integration, and checkpointing. ```yaml # configs/task/train_rignet_ar.yaml - Skeleton training config mode: train debug: False experiment_name: &experiment_name train_rignet_ar epochs: &epochs 400 components: data: rignet tokenizer: tokenizer_rignet transform: train_rignet_ar_transform model: unirig_rignet system: ar_train_rignet optimizer: __target__: adamw lr: 0.00025 weight_decay: 0.04 scheduler: __target__: one_cycle_lr max_lr: 0.0001 pct_start: 0.1 anneal_strategy: cos div_factor: 5.0 final_div_factor: 10.0 epochs: *epochs loss: ce_loss: 1.0 dis_loss: 0 trainer: num_nodes: 1 devices: 4 precision: bf16-mixed accelerator: gpu strategy: ddp wandb: name: *experiment_name offline: False tags: [*experiment_name, unirig] checkpoint: monitor: val_loss_j2j filename: best-model-{epoch:02d}-{loss_sum:.4f} save_top_k: 1 mode: min save_last: True ``` -------------------------------- ### Run Skeleton Prediction Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Commands for generating skeletons from 3D models using the pre-trained model. ```bash # Process a single file bash launch/inference/generate_skeleton.sh --input examples/giraffe.glb --output results/giraffe_skeleton.fbx # Process multiple files in a directory bash launch/inference/generate_skeleton.sh --input_dir --output_dir # Try different skeleton variations by changing the random seed bash launch/inference/generate_skeleton.sh --input examples/giraffe.glb --output results/giraffe_skeleton.fbx --seed 42 ``` -------------------------------- ### Generate Skeleton for Single Model Source: https://context7.com/vast-ai-research/unirig/llms.txt Use this command to generate a skeleton structure for a single 3D model file. Specify input and output paths. ```bash bash launch/inference/generate_skeleton.sh \ --input examples/giraffe.glb \ --output results/giraffe_skeleton.fbx ``` -------------------------------- ### Run Skeleton Prediction via Python Source: https://context7.com/vast-ai-research/unirig/llms.txt Execute skeleton prediction using the main Python script. Specify the task configuration, input model, output path, and a random seed. ```bash python run.py \ --task=configs/task/quick_inference_skeleton_articulationxl_ar_256.yaml \ --input=examples/giraffe.glb \ --output=results/giraffe_skeleton.fbx \ --seed=12345 \ --npz_dir=tmp ``` -------------------------------- ### Validate Rignet Dataset Metrics Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Run this command to validate the metrics mentioned in the UniRig paper. This is intended for academic usage. Ensure the processed dataset is downloaded and extracted. ```python python run.py --task=configs/task/validate_rignet.yaml ``` -------------------------------- ### Load and Export 3D Model Data with RawData Source: https://context7.com/vast-ai-research/unirig/llms.txt Handles processed 3D model files, including mesh, skeleton, and skinning weights. Use for loading, accessing properties, and exporting to various formats like FBX, OBJ, and point clouds. ```python from src.data.raw_data import RawData, RawSkeleton, RawSkin import numpy as np # Load processed model data from npz file raw_data = RawData.load("dataset_clean/rigxl/12345/raw_data.npz") # Access mesh properties print(f"Vertices: {raw_data.N}") # Number of vertices print(f"Faces: {raw_data.F}") # Number of faces print(f"Joints: {raw_data.J}") # Number of joints # Access data arrays vertices = raw_data.vertices # Shape: (N, 3) vertex_normals = raw_data.vertex_normals # Shape: (N, 3) faces = raw_data.faces # Shape: (F, 3) joints = raw_data.joints # Shape: (J, 3) skin = raw_data.skin # Shape: (N, J) skinning weights parents = raw_data.parents # List of parent indices names = raw_data.names # List of joint names # Export to FBX with full rigging raw_data.export_fbx( path="output/model.fbx", extrude_size=0.03, # Bone visualization size group_per_vertex=4, # Max bones per vertex add_root=False, # Add root bone use_extrude_bone=True, # Use extruded bone display ) # Export individual components raw_data.export_mesh("output/mesh.obj") raw_data.export_skeleton("output/skeleton.obj") raw_data.export_pc("output/pointcloud.obj", with_normal=True) # Save modified data raw_data.save("output/modified_data.npz") # Load skeleton-only data raw_skeleton = RawSkeleton.load("results/predict_skeleton.npz") raw_skeleton.export_fbx("output/skeleton_only.fbx") # Load skin-only data raw_skin = RawSkin.load("results/predict_skin.npz") print(f"Skin weights shape: {raw_skin.skin.shape}") ``` -------------------------------- ### Generate Skeleton with Custom Seed Source: https://context7.com/vast-ai-research/unirig/llms.txt Generate a skeleton with variations by specifying a random seed. This can produce different skeleton structures for the same input. ```bash bash launch/inference/generate_skeleton.sh \ --input examples/giraffe.glb \ --output results/giraffe_skeleton.fbx \ --seed 42 ``` -------------------------------- ### Inference Configuration for Skeleton Generation Source: https://github.com/vast-ai-research/unirig/blob/main/README.md This YAML configuration is used for predicting skeleton generation after training. Ensure `resume_from_checkpoint` points to your trained model. ```yaml mode: predict debug: False experiment_name: test resume_from_checkpoint: experiments/train_rignet_ar/last.ckpt # final ckpt path components: data: quick_inference # inference data system: ar_inference_articulationxl # any system without `val_interval` or `val_start_from` should be ok tokenizer: tokenizer_rignet # must be the same in training transform: train_rignet_ar_transform # only need to keep the normalization method model: unirig_rignet # must be the same in training data_name: raw_data.npz writer: __target__: ar output_dir: ~ add_num: False repeat: 1 export_npz: predict_skeleton export_obj: skeleton export_fbx: skeleton trainer: max_epochs: 1 num_nodes: 1 devices: 1 precision: bf16-mixed accelerator: gpu strategy: auto ``` -------------------------------- ### Export Skeleton Source: https://context7.com/vast-ai-research/unirig/llms.txt Exports skeleton visualizations as static files or sequences. ```APIDOC ## [METHOD] export_skeleton / export_skeleton_sequence ### Description Exports the skeleton visualization. export_skeleton_sequence creates multiple files for animation frames. ### Parameters #### Request Body - **path** (string) - Required - Output file path or prefix ### Request Example raw_data.export_skeleton("output/skeleton.obj") raw_data.export_skeleton_sequence("output/skeleton") ``` -------------------------------- ### Rignet Data Configuration Source: https://context7.com/vast-ai-research/unirig/llms.txt Configuration for the Rignet dataset, specifying input/output directories, and parameters for training and validation datasets including shuffling, batch size, and number of workers. ```yaml # configs/data/rignet.yaml input_dataset_dir: &input_dataset_dir ./dataset_inference output_dataset_dir: &output_dataset_dir ./dataset_clean train_dataset_config: shuffle: True batch_size: 12 num_workers: 24 pin_memory: True persistent_workers: True datapath_config: input_dataset_dir: *output_dataset_dir use_prob: True num_files: 50000 data_path: rignet: [ [./datalist/rignet_train.txt, 1.0], ] validate_dataset_config: shuffle: False batch_size: 1 num_workers: 1 pin_memory: False persistent_workers: False datapath_config: input_dataset_dir: *output_dataset_dir use_prob: False data_path: rignet: [ [./datalist/rignet_test.txt, 1.0], ] ``` -------------------------------- ### Transfer Rigging Between Models Source: https://context7.com/vast-ai-research/unirig/llms.txt Combines predicted skeleton and skinning weights with original 3D models. Use the `transfer` function to apply rigging from a source model to a target model, preserving textures. ```python from src.inference.merge import merge, transfer # Transfer rigging from source to target model transfer( source='results/giraffe_skin.fbx', # Rigged model with skeleton target='examples/giraffe.glb', # Original model with textures output='results/giraffe_final.glb', # Output rigged model add_root=False ) ``` -------------------------------- ### Custom Skeleton Inference Task Configuration Source: https://context7.com/vast-ai-research/unirig/llms.txt Configuration for custom skeleton inference. This YAML file specifies the mode, experiment name, checkpoint to resume from, components for data handling and model inference, and writer settings for output. ```yaml # Custom skeleton inference task mode: predict debug: False experiment_name: custom_skeleton_inference resume_from_checkpoint: experiments/train_rignet_ar/last.ckpt components: data: quick_inference system: ar_inference_articulationxl tokenizer: tokenizer_rignet transform: train_rignet_ar_transform model: unirig_rignet data_name: raw_data.npz writer: __target__: ar output_dir: ~ add_num: False repeat: 1 export_npz: predict_skeleton export_obj: skeleton export_fbx: skeleton trainer: max_epochs: 1 num_nodes: 1 devices: 1 precision: bf16-mixed accelerator: gpu strategy: auto ``` -------------------------------- ### Export point cloud with normals Source: https://context7.com/vast-ai-research/unirig/llms.txt Exports point cloud data to an OBJ file with optional normal data included. ```python raw_data.export_pc( path="output/pointcloud.obj", with_normal=True, normal_size=0.01 ) ``` -------------------------------- ### Generate Skinning Weights with Custom Data Name Source: https://context7.com/vast-ai-research/unirig/llms.txt Specify a custom data name for the skeleton prediction results when generating skinning weights. This is useful if the default name is not used. ```bash bash launch/inference/generate_skin.sh \ --input examples/skeleton/giraffe.fbx \ --output results/giraffe_skin.fbx \ --data_name predict_skeleton.npz ``` -------------------------------- ### Merge Predicted Skeleton or Skin with 3D Model Source: https://github.com/vast-ai-research/unirig/blob/main/README.md Use this script to combine predicted skeleton or skin data with your original 3D model. Ensure you use the predicted skinning result for proper skinning. ```bash # Merge skeleton from skeleton prediction bash launch/inference/merge.sh --source results/giraffe_skeleton.fbx --target examples/giraffe.glb --output results/giraffe_rigged.glb ``` ```bash # Or merge skin from skin prediction bash launch/inference/merge.sh --source results/giraffe_skin.fbx --target examples/giraffe.glb --output results/giraffe_rigged.glb ``` -------------------------------- ### Export Point Cloud Source: https://context7.com/vast-ai-research/unirig/llms.txt Exports the model as a point cloud with optional normal data. ```APIDOC ## [METHOD] export_pc ### Description Exports the point cloud representation of the model. ### Parameters #### Request Body - **path** (string) - Required - Output file path - **with_normal** (boolean) - Optional - Include normal data - **normal_size** (float) - Optional - Size of the normals ### Request Example raw_data.export_pc(path="output/pointcloud.obj", with_normal=True, normal_size=0.01) ``` -------------------------------- ### Merge Skeleton Prediction with Original Model Source: https://context7.com/vast-ai-research/unirig/llms.txt Combine the predicted skeleton with the original 3D model. This creates a rigged model while preserving original textures and materials. ```bash bash launch/inference/merge.sh \ --source results/giraffe_skeleton.fbx \ --target examples/giraffe.glb \ --output results/giraffe_rigged.glb ``` -------------------------------- ### Export FBX Source: https://context7.com/vast-ai-research/unirig/llms.txt Exports a rigged model to FBX format with configurable rigging and skinning options. ```APIDOC ## [METHOD] export_fbx ### Description Exports the rigged model to an FBX file with specific bone and skinning parameters. ### Parameters #### Request Body - **path** (string) - Required - Output file path - **extrude_size** (float) - Optional - Size of bone extrusion - **group_per_vertex** (int) - Optional - Max vertex groups per vertex - **add_root** (boolean) - Optional - Add a root bone - **do_not_normalize** (boolean) - Optional - Skip weight normalization - **use_extrude_bone** (boolean) - Optional - Create extruded bone visuals - **use_connect_unique_child** (boolean) - Optional - Connect bones with single child - **extrude_from_parent** (boolean) - Optional - Extrude direction from parent - **use_tail** (boolean) - Optional - Use predicted tail positions - **custom_vertex_group** (any) - Optional - Override skinning weights ### Request Example raw_data.export_fbx(path="output/rigged_model.fbx", extrude_size=0.03, group_per_vertex=4) ``` -------------------------------- ### Export Mesh Source: https://context7.com/vast-ai-research/unirig/llms.txt Exports the raw mesh to common 3D formats. ```APIDOC ## [METHOD] export_mesh ### Description Exports the mesh data to a file. Supported formats include OBJ and PLY. ### Parameters #### Request Body - **path** (string) - Required - Output file path ### Request Example raw_data.export_mesh("output/mesh.obj") ``` -------------------------------- ### Export mesh formats Source: https://context7.com/vast-ai-research/unirig/llms.txt Exports the raw mesh data to OBJ or PLY formats. ```python raw_data.export_mesh("output/mesh.obj") # OBJ format raw_data.export_mesh("output/mesh.ply") # PLY format ``` -------------------------------- ### Programmatic Merge with Explicit Parameters Source: https://context7.com/vast-ai-research/unirig/llms.txt Use this function to merge models programmatically by providing explicit parameters for vertices, joints, skinning weights, parent indices, joint names, and tail positions. Ensure all required data is loaded correctly before calling merge. ```python from src.data.raw_data import RawData, RawSkin import numpy as np raw_skin = RawSkin.load('results/predict_skin.npz') raw_data = RawData.load('results/predict_skeleton.npz') merge( path='examples/giraffe.glb', # Original model path output_path='results/rigged.glb', # Output path vertices=raw_skin.vertices, # Sampled vertices joints=raw_skin.joints, # Joint positions skin=raw_skin.skin, # Skinning weights (N, J) parents=raw_data.parents, # Parent indices names=raw_data.names, # Joint names tails=raw_data.tails, # Tail positions add_root=False, # Add root bone is_vrm=False # VRM format export ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.