Difference between revisions of "Cmc"

From Custom Map Makers Wiki
Jump to: navigation, search
Line 14: Line 14:
  
 
Download CMC from Custom Map Makers. And copy it to a conveniant location
 
Download CMC from Custom Map Makers. And copy it to a conveniant location
 +
 +
=== Creating a ''clip model'' ===
 +
 +
Create an new map, import the model to clip for reference and place its origin at the center of the map (''ie,'' at coordinates 0 0 0), do not rotate or scale the model. Create the clip brush around your model, once finished you can remove the model and save the ''clip model'' map.
 +
  
 
=== Commandline argument ===
 
=== Commandline argument ===
Line 34: Line 39:
 
  -ls, --list-shaders  list all shaders
 
  -ls, --list-shaders  list all shaders
 
  -c model:pattern, --clip model:pattern
 
  -c model:pattern, --clip model:pattern
                      clip models with clip pattern file
+
                  clip models with clip pattern file
 
  -u clip/shader, --unclip clip/shader
 
  -u clip/shader, --unclip clip/shader
          delete brushes using "clip/shader"
+
      delete brushes using "clip/shader"
 
  -o ofilename, --output ofilename
 
  -o ofilename, --output ofilename
          output file
+
      output file
 
  -d, --debug
 
  -d, --debug
 
  -v, --version
 
  -v, --version
Line 47: Line 52:
  
 
     python cmc.py --clip model/mymodel/mymodel.md3:maps/clip_pattern.map \
 
     python cmc.py --clip model/mymodel/mymodel.md3:maps/clip_pattern.map \
    --output maps/mymap_clipped.map maps/mymap.map
+
--output maps/mymap_clipped.map maps/mymap.map
  
 
     maps/mymap.map
 
     maps/mymap.map
Line 64: Line 69:
  
 
     python cmc.py --clip model/mymodel/mymodel.md3:maps/clip_pattern.map \
 
     python cmc.py --clip model/mymodel/mymodel.md3:maps/clip_pattern.map \
    --clip model/mymodel/anothermodel.ase:maps/clip_anotherpattern.map
+
--clip model/mymodel/anothermodel.ase:maps/clip_anotherpattern.map
    --output maps/mymap_clipped.map maps/mymap.map
+
--output maps/mymap_clipped.map maps/mymap.map
  
 
CMC accepts any number of model/clip_pattern pair using multiple "--clip" options
 
CMC accepts any number of model/clip_pattern pair using multiple "--clip" options

Revision as of 21:40, 8 September 2011

CMC

CMC is a commandline tool for semi-automatic clipping of models for Q3map2 map files. The approach carried by CMC is to automaticaly insert clip brushes into a map file following a "clip model" (ie, a standalone map file) provided by the user. CMC consists of a python script and is licenced under beerware revision 42. Beware, the licence will be strongly enforced.

Error.png Don't blame the tool if you forgot to backup your map...


Usage

Requierements

CMC requires a working Python environment, and the argparse library (shipped with Python starting from version 2.7).

Installation

Download CMC from Custom Map Makers. And copy it to a conveniant location

Creating a clip model

Create an new map, import the model to clip for reference and place its origin at the center of the map (ie, at coordinates 0 0 0), do not rotate or scale the model. Create the clip brush around your model, once finished you can remove the model and save the clip model map.


Commandline argument

Getting help

   python cmc.py --help

display a help message:

 usage: cmc.py [-h] (-ls | -c model:pattern | -u clip/shader) [-o ofilename] [-d] [-v] ifile

Q3map2 map model clipper

positional arguments:
ifile                 q3map2 map file

optional arguments:
-h, --help            show this help message and exit
-ls, --list-shaders   list all shaders
-c model:pattern, --clip model:pattern
                  clip models with clip pattern file
-u clip/shader, --unclip clip/shader
      delete brushes using "clip/shader"
-o ofilename, --output ofilename
      output file
-d, --debug
-v, --version

I map therefore I am

Clipping a model

   python cmc.py --clip model/mymodel/mymodel.md3:maps/clip_pattern.map \
--output maps/mymap_clipped.map maps/mymap.map
   maps/mymap.map

This is the path to the map to process.

   --output maps/mymap_clipped.map

This instruct CMC to output the new map into the file "maps/mymap_clipped.map" (highly recommended). Without this option, CMC will overwrite the input file

   --clip model/mymodel/mymodel.md3:maps/clip_pattern.map

This instruct CMC to clip every instance of model "model/mymodel/mymodel.md3" (This is not the path to the md3 file, but the model name as it appears in the entity window in GtkRadiant), according to the clip model from file maps/clip_pattern.map.

Clipping multiple models at once

   python cmc.py --clip model/mymodel/mymodel.md3:maps/clip_pattern.map \
--clip model/mymodel/anothermodel.ase:maps/clip_anotherpattern.map
--output maps/mymap_clipped.map maps/mymap.map

CMC accepts any number of model/clip_pattern pair using multiple "--clip" options