Skip to content
The Chat Archive
gpt-4o-2024-05-13· OpenAI WildChat-4.8M (AI2)

when exporting sfm models from blender back into sfm, what's the whole export path thing…

  1. User

    when exporting sfm models from blender back into sfm, what's the whole export path thing about?

  2. Assistant

    When exporting models from Blender back into Source Filmmaker (SFM), the "export path" refers to the directory structure and formats required by SFM to properly recognize and use the models. Here’s a breakdown of what it involves:

    1. Model Export Format: SFM primarily uses the Source Engine's model format, which involves several specific files: .smd/.dmx for model data, .vta for facial flexes, and the final compiled .mdl file along with several auxiliary files like .vtx, .vvd, etc.

    2. Export Path in Blender: When exporting from Blender, you typically save your model in an intermediary format compatible with the Source Engine tools, such as .smd or .dmx. During the export, you specify an output directory. It's important that these files are organized correctly to ensure they can be compiled without errors.

    3. Directory Structure: The directory structure is crucial for the subsequent steps. Generally, this structure looks something like this:

      • Models Directory: Usually something like models/your_model_name/
      • Materials Directory: Typically materials/models/your_model_name/
    4. Model Compilation: The next step involves compiling the exported .smd or .dmx files using a tool like Crowbar or the Source SDK tools. This process converts your intermediary files into the Source Engine’s .mdl format. During compilation, the tool needs to know where to find the various assets, which is where the export path becomes relevant.

    5. QC File: A critical component in model compilation is the QC (.qc) file, which is a script used by the Source Engine’s studiomdl compiler to define how to compile the model. This file includes paths to the model data, textures, hitboxes, animations, etc. Example:

      $modelname "your_model_name/your_model.mdl"
      $body "body" "your_model.smd"
      $cdmaterials "models/your_model_name/"
      
      • $modelname should match the directory structure where the compiled model will go.
      • $body should point to the exported model file.
      • $cdmaterials should reflect the path to the textures.
    6. Material Path: Textures and materials for the model must reside in the correct directory structure within the materials folder. The paths specified in your Blender export settings and the QC file should correspond to this structure.

    Workflow Example:

    1. Export from Blender:

      • Export your model as your_model.smd to a directory like C:/sfm_export/models/your_model_name/.
      • Export textures to C:/sfm_export/materials/models/your_model_name/.
    2. QC File Setup:

      $modelname "your_model_name/your_model.mdl"
      $body "body" "your_model_name/your_model.smd"
      $cdmaterials "models/your_model_name/"
      
    3. Compile using Crowbar (or another compiler):

      • Point Crowbar to the directory with your QC file.
      • Compile the model, specifying the correct game directory as the output path.
    4. Placement:

      • Place the resulting files (.mdl, .vtx, .vvd, etc.) in the SFM game directory structure, typically something like Steam/steamapps/common/SourceFilmmaker/game/usermod/models/your_model_name/.
      • Place the texture files in Steam/steamapps/common/SourceFilmmaker/game/usermod/materials/models/your_model_name/.

    Following these steps ensures that SFM can find and correctly use your model and its associated textures. The "export path" primarily helps keep all the necessary files organized and correctly referenced throughout the process.