CREATING YOUR OWN COMMAND TYPES
This section is an explains how to define group types in the file Janus_CommandTypes.cfg.

Like Janus_GroupTypes.cfg, Janus_CommandTypes.cfg is structured like an INI file and they contain identical parameters, although command types have some syntactical differences.

Basics
First, be aware that commands are applied to groups, and that their priority is lower than of group. This was discussed earlier in the Group-Command Relationship section.

Second, command types distinguish between active and other groups, and layer types. This changes their syntax from group types. Here is an example:

[MyCommandType]
ACTIVE.FG.UBC=true
OTHER.BG.UBC=false
GLOBAL.BG.UBA=black

The first element (ACTIVE, OTHER, or GLOBAL) is called the group indicator. The second element (FG or BG) is the layer indicator. The third element is the directive which may be a group directive or a scene directive. An equals sign follows and then the value of the directive is inputted.

Whitespaces to left or right of the equals sign is not allowed.

Going back to the example command type above, we translate what it means:

ACTIVE.FG.UBC=true
(if the group being processed is the active group, and if the command is being run as a foreground layer, then turn the group's UnseenByCamera parameter 'on'.

OTHER.BG.UBC=false
(if the group being processed is one of the other groups, and if the command is being run as a background layer, then turn the group's UnseenByCamera parameter 'off'.

GLOBAL.BG.UBA=black
(whatever group is being processed – active or other -, and if the command is being run as a background layer, then switch the UnseenByAlpha parameter of that group to “Constant Black”.

Command types can use scene directives in the form of the directive SCENE.CMD. An example will illustrate this. For example we have a command type such as:

[specialBTY]
inherit=BTY
SCENE.CMD=fogtype2
SCENE.CMD=fogColor255,255,255

Then we have a command that calls this type:

specialBTY.BG.bgColor0,0,0.box

What actually happens here is that Janus will append the values of the parameters of SCENE.CMD into the current pass:

specialBTY.BG.bgColor0,0,0.fogtype2.fogColor255,255,255.box

Furthermore SCENE.CMD can also accept group directives.

SCENE.CMD=UBABOTHON

However, since SCENE.CMD appends it to the subcommand for execution, its behavior changes so that you are not able to utilise layer indicators.

Syntax
All As explained in the overview, directives executed as a subcommand is different syntactically when it is used as a directive in a command type. The syntax for directives in command types is identical to group types, and as such you can look at them in the Syntax section of Creating Your Own Group Types. The only addition to command types, however, is the SCENE.CMD directive. A SCENE.CMD directive will append the directive's value into the subcommand before executing it. You may use SCENE.CMD directives as many times as you need.

SCENE.CMD=fogMinDist"535.25"
SCENE.CMD=outputsubdir"occ"
SCENE.CMD=RENDERLINESOFF

Command Inheritance
Inheritance in command types are very powerful because it gives you more options to work with. By designing building blocks of smaller parameters, you can use these building blocks for larger command types. Take this example of a shadow-catcher command type.

[SHDC]
//catches shadows only
//active replaces with shadowCatcher.srf
INHERIT=BTYRAW
INHERIT=BTY2
ACTIVE.BOTH.SRF="shadowCatcher.srf"
SCENE.CMD=outputsubdir"shdc"
SCENE.CMD=fogtypeoff

The SHDC command type is already inheriting BTYRAW and BTY2 (which we won't get into at this point). But it also has its own parameters. If I apply this command type, all active groups will have their surfaces replaced with my shadowCatcher.srf. Now, let's say I didn't want any self-shadowing to occur. I just want it to receive shadows from others. But I also want to keep my options open, and create another command type instead of overwriting this. So this is how I will write this new command type.

[SHDC_EX]
//extrovert shadowcatcher
INHERIT=BTYRAW
INHERIT=BTY2
INHERIT=SHDC
ACTIVE.BOTH.SS=false;

So what you see is that I have inherited three command types, including the SHDC command type. But then I overrule the SS (SelfShadow) parameter by specifying a new value.

Frankly, this is all there is to creating command types. Janus already comes with a slew of command types that I personally have used in production and it forms the base of every other command type I've created thus far. You can build upon them, or build your own base. It's up to you.

'Vis' and 'Runtime' Directives
Because not all user-defined command types are directly used, they can be optionally hidden from the GUI. If you use the vis (visible) directive (value: true or false).

Furthermore, some command types are only mean to be used as a run-time command. In this case, specifying the runtime directive (value: true or false) will make the particular command type appear only in the run-time commands list.

[MyCommandType]
inherit=BTY
vis=true
runtime=false