Scans the provided .obj file for ATTR_manip_* manipulator commands and generate a series of sound attachments which can be piped into a new file.
- Clone the repo and run
npm installoryarn install. - Create an
events.jsonfile with your events using this format:
{
"BUTTON": "/model/mymodel/switches/button",
"ROTARY_SMALL": "/model/mymodel/switches/rotary1",
"ROTARY_MEDIUM": "/model/mymodel/switches/rotary2",
"ROTARY_LARGE": "/model/mymodel/switches/rotary3",
"SWITCH": "/model/mymodel/switches/switch"
}Obviously replacing the events names with your own. An example events.json.example file is included that you can use as a starting point. Rename it as events.json and edit at will.
./generate_snd.js [options] <path/to/input.obj> > <path/to/output.snd>
input.objaircraft cockpit file.output.snd.snd compatible format which you can include into your own definition.options:-i, --ignorelines: Pass a comma-separated list of line numbers to ignore from the cockpit file.
Alternatively, you can install the tool globally, with npm install -g on the project directory. Then you could open the shell on any directory and directly execute:
generate_snd path/to/input.obj > path/to/output.snd
Currently, manipulator support is as follows:
ATTR_manip_command: YESATTR_manip_command_axis: NOATTR_manip_push: YESATTR_manip_toggle: YESATTR_manip_delta: YESATTR_manip_wrap: YESATTR_manip_wheel: NO (*)ATTR_manip_command_knob: NOATTR_manip_switch_up_down: NOATTR_manip_switch_left_right: NOATTR_manip_axis_knob: NOATTR_manip_axis_switch_up_down: NOATTR_manip_axis_switch_left_right: NO
(*) Requires knowledge of the previous command
As you can see, I implemented just the manipulators I needed for the project I had at hand, but feel free to collaborate with more implementations and submit your pull request.