コード例 #1
0
CommandLineHandler::CommandLineHandler()
  : CommandLineHandlerBase("convertmeshfile")
{
    add_default_options();

    m_filenames.set_exact_value_count(2);
    parser().set_default_option_handler(&m_filenames);

    m_print_bboxes.add_name("--print-bounding-boxes");
    m_print_bboxes.add_name("-b");
    m_print_bboxes.set_description("print mesh bounding boxes");
    parser().add_option_handler(&m_print_bboxes);
}
コード例 #2
0
CommandLineHandler::CommandLineHandler()
  : CommandLineHandlerBase("dumpmetadata")
{
    add_default_options();

    parser().add_option_handler(
        &m_format
            .add_name("--format")
            .set_syntax("format (valid values: xml, markdown)")
            .set_description("set the dump format")
            .set_exact_value_count(1)
            .set_flags(OptionHandler::Required));
}
コード例 #3
0
CommandLineHandler::CommandLineHandler()
  : CommandLineHandlerBase("updateprojectfile")
{
    add_default_options();

    m_filename.set_exact_value_count(1);
    parser().set_default_option_handler(&m_filename);

    m_to_revision.add_name("--to-revision");
    m_to_revision.add_name("-r");
    m_to_revision.set_description("update the project to this revision (by default, update to the latest revision)");
    m_to_revision.set_syntax("revision");
    m_to_revision.set_exact_value_count(1);
    parser().add_option_handler(&m_to_revision);
}
コード例 #4
0
CommandLineHandler::CommandLineHandler()
  : CommandLineHandlerBase("makefluffy")
{
    add_default_options();

    m_filenames.set_exact_value_count(2);
    parser().set_default_option_handler(&m_filenames);

    m_curves.add_name("--curves");
    m_curves.add_name("-n");
    m_curves.set_description("set the total number of curves to generate");
    m_curves.set_syntax("count");
    m_curves.set_exact_value_count(1);
    m_curves.set_flags(OptionHandler::Required);
    parser().add_option_handler(&m_curves);

    m_length.add_name("--length");
    m_length.add_name("-l");
    m_length.set_description("set the base length of the curves");
    m_length.set_syntax("length");
    m_length.set_exact_value_count(1);
    m_length.set_flags(OptionHandler::Required);
    parser().add_option_handler(&m_length);

    m_length_fuzziness.add_name("--length-fuzziness");
    m_length_fuzziness.add_name("-lf");
    m_length_fuzziness.set_description("set the amount of length variation");
    m_length_fuzziness.set_syntax("fuzziness");
    m_length_fuzziness.set_exact_value_count(1);
    m_length_fuzziness.set_default_value(0.6);
    parser().add_option_handler(&m_length_fuzziness);

    m_root_width.add_name("--root-width");
    m_root_width.add_name("-rw");
    m_root_width.set_description("set the width at the curves roots");
    m_root_width.set_syntax("width");
    m_root_width.set_exact_value_count(1);
    m_root_width.set_flags(OptionHandler::Required);
    parser().add_option_handler(&m_root_width);

    m_tip_width.add_name("--tip-width");
    m_tip_width.add_name("-tw");
    m_tip_width.set_description("set the width at the curves tips");
    m_tip_width.set_syntax("width");
    m_tip_width.set_exact_value_count(1);
    m_tip_width.set_flags(OptionHandler::Required);
    parser().add_option_handler(&m_tip_width);

    m_curliness.add_name("--curliness");
    m_curliness.add_name("-c");
    m_curliness.set_description("set the amount of curliness");
    m_curliness.set_syntax("curliness");
    m_curliness.set_exact_value_count(1);
    m_curliness.set_default_value(1.5);
    parser().add_option_handler(&m_curliness);

    m_presplits.add_name("--presplits");
    m_presplits.add_name("-p");
    m_presplits.set_description("set the number of presplits to apply to the curves");
    m_presplits.set_syntax("presplits");
    m_presplits.set_exact_value_count(1);
    m_presplits.set_default_value(0);
    parser().add_option_handler(&m_presplits);

    m_include.add_name("--include");
    m_include.add_name("-i");
    m_include.set_description("only consider object instances whose names match a given regex");
    m_include.set_syntax("regex");
    m_include.set_exact_value_count(1);
    m_include.set_default_value(".*");          // match everything
    parser().add_option_handler(&m_include);

    m_exclude.add_name("--exclude");
    m_exclude.add_name("-e");
    m_exclude.set_description("exclude object instances whose names match a given regex");
    m_exclude.set_syntax("regex");
    m_exclude.set_exact_value_count(1);
    m_exclude.set_default_value("/(?!)/");      // match nothing -- http://stackoverflow.com/a/4589566/393756
    parser().add_option_handler(&m_exclude);
}
コード例 #5
0
CommandLineHandler::CommandLineHandler()
  : CommandLineHandlerBase("animatecamera")
{
    add_default_options();

    m_filenames.set_exact_value_count(2);
    parser().set_default_option_handler(&m_filenames);

    m_animation_path.add_name("--animation-path");
    m_animation_path.add_name("-a");
    m_animation_path.set_description("load an animation path file");
    m_animation_path.set_syntax("filename.txt");
    m_animation_path.set_exact_value_count(1);
    parser().add_option_handler(&m_animation_path);

    m_3dsmax_mode.add_name("--3dsmax");
    m_3dsmax_mode.set_description("assume the animation path file uses Autodesk 3ds Max's coordinate system");
    parser().add_option_handler(&m_3dsmax_mode);

    m_output_format.add_name("--output-format");
    m_output_format.add_name("-o");
    m_output_format.set_description("set the format of the output frames");
    m_output_format.set_syntax("format");
    m_output_format.set_exact_value_count(1);
    m_output_format.set_default_value("exr");
    parser().add_option_handler(&m_output_format);

    m_frame_count.add_name("--frame-count");
    m_frame_count.add_name("-f");
    m_frame_count.set_description("set the number of frames in the animation");
    m_frame_count.set_syntax("count");
    m_frame_count.set_exact_value_count(1);
    m_frame_count.set_default_value(20);
    parser().add_option_handler(&m_frame_count);

    m_part_count.add_name("--part-count");
    m_part_count.add_name("-p");
    m_part_count.set_description("split the render script in that many parts");
    m_part_count.set_syntax("count");
    m_part_count.set_exact_value_count(1);
    m_part_count.set_default_value(1);
    parser().add_option_handler(&m_part_count);

    m_camera_target.add_name("--target");
    m_camera_target.add_name("-t");
    m_camera_target.set_description("set the target of the camera relatively to the center of the scene");
    m_camera_target.set_syntax("x y z");
    m_camera_target.set_exact_value_count(3);
    m_camera_target.set_default_values(make_vector(0.0, 0.0, 0.0));
    parser().add_option_handler(&m_camera_target);

    m_camera_distance.add_name("--distance");
    m_camera_distance.add_name("-d");
    m_camera_distance.set_description("set the normalized distance from the camera to the scene");
    m_camera_distance.set_syntax("scalar");
    m_camera_distance.set_exact_value_count(1);
    m_camera_distance.set_default_value(10.0);
    parser().add_option_handler(&m_camera_distance);

    m_camera_elevation.add_name("--elevation");
    m_camera_elevation.add_name("-e");
    m_camera_elevation.set_description("set the normalized elevation of the camera");
    m_camera_elevation.set_syntax("scalar");
    m_camera_elevation.set_exact_value_count(1);
    m_camera_elevation.set_default_value(2.0);
    parser().add_option_handler(&m_camera_elevation);
}
コード例 #6
0
CommandLineHandler::CommandLineHandler()
  : CommandLineHandlerBase("appleseed.cli")
{
    add_default_options();

    m_filename.set_min_value_count(0);
    m_filename.set_max_value_count(1);
    parser().set_default_option_handler(&m_filename);

    m_configuration.add_name("--configuration");
    m_configuration.add_name("-c");
    m_configuration.set_description("select the configuration");
    m_configuration.set_syntax("name");
    m_configuration.set_exact_value_count(1);
    parser().add_option_handler(&m_configuration);

    m_params.add_name("--parameter");
    m_params.add_name("-p");
    m_params.set_description("set a custom parameter");
    m_params.set_syntax("name=value");
    m_params.set_flags(OptionHandler::Repeatable);
    m_params.set_exact_value_count(1);
    parser().add_option_handler(&m_params);

#if defined __APPLE__ || defined _WIN32

    m_display_output.add_name("--display-output");
    m_display_output.set_description("display the output image");
    parser().add_option_handler(&m_display_output);

#endif

    m_disable_autosave.add_name("--disable-autosave");
    m_disable_autosave.set_description("disable automatic saving of rendered images");
    parser().add_option_handler(&m_disable_autosave);

    m_threads.add_name("--threads");
    m_threads.add_name("-t");
    m_threads.set_description("set the number of rendering threads");
    m_threads.set_syntax("n");
    m_threads.set_exact_value_count(1);
    parser().add_option_handler(&m_threads);

    m_output.add_name("--output");
    m_output.add_name("-o");
    m_output.set_description("set the name of the output file");
    m_output.set_syntax("filename");
    m_output.set_exact_value_count(1);
    parser().add_option_handler(&m_output);

    m_continuous_saving.add_name("--continuous-saving");
    m_continuous_saving.set_description("write tiles to disk as soon as they are rendered");
    parser().add_option_handler(&m_continuous_saving);

    m_resolution.add_name("--resolution");
    m_resolution.add_name("-r");
    m_resolution.set_description("set the resolution of the rendered image");
    m_resolution.set_syntax("width height");
    m_resolution.set_exact_value_count(2);
    parser().add_option_handler(&m_resolution);

    m_window.add_name("--window");
    m_window.add_name("-w");
    m_window.set_description("restrict rendering to a given rectangle (expressed in pixels)");
    m_window.set_syntax("x0 y0 x1 y1");
    m_window.set_exact_value_count(4);
    parser().add_option_handler(&m_window);

    m_samples.add_name("--samples");
    m_samples.add_name("-s");
    m_samples.set_description("set the minimum and maximum numbers of samples per pixel");
    m_samples.set_syntax("min max");
    m_samples.set_exact_value_count(2);
    parser().add_option_handler(&m_samples);

    m_passes.add_name("--passes");
    m_passes.set_description("set the number of rendering passes");
    m_passes.set_syntax("n");
    m_passes.set_exact_value_count(1);
    parser().add_option_handler(&m_passes);

    m_override_shading.add_name("--override-shading");
    m_override_shading.set_description("override shading with a diagnostic shader");
    m_override_shading.set_syntax("shader");
    m_override_shading.set_exact_value_count(1);
    parser().add_option_handler(&m_override_shading);

    m_select_object_instances.add_name("--select-object-instances");
    m_select_object_instances.set_description("select which object instances to include in the render using a regular expression");
    m_select_object_instances.set_syntax("regex");
    m_select_object_instances.set_exact_value_count(1);
    parser().add_option_handler(&m_select_object_instances);

    m_mplay_display.add_name("--mplay");
    m_mplay_display.set_description("use Houdini's mplay");
    parser().add_option_handler(&m_mplay_display);

    m_hrmanpipe_display.add_name("--hrmanpipe");
    m_hrmanpipe_display.set_description("use Houdini's hrmanpipe; the argument is the socket number to pass to hrmanpipe");
    m_hrmanpipe_display.set_syntax("socket");
    m_hrmanpipe_display.set_exact_value_count(1);
    parser().add_option_handler(&m_hrmanpipe_display);

    m_run_unit_tests.add_name("--run-unit-tests");
    m_run_unit_tests.set_description("run unit tests; filter them based on the optional regular expression argument");
    m_run_unit_tests.set_min_value_count(0);
    m_run_unit_tests.set_max_value_count(1);
    parser().add_option_handler(&m_run_unit_tests);

    m_run_unit_benchmarks.add_name("--run-unit-benchmarks");
    m_run_unit_benchmarks.set_description("run unit benchmarks; filter them based on the optional regular expression argument");
    m_run_unit_benchmarks.set_min_value_count(0);
    m_run_unit_benchmarks.set_max_value_count(1);
    parser().add_option_handler(&m_run_unit_benchmarks);

    m_verbose_unit_tests.add_name("--verbose-unit-tests");
    m_verbose_unit_tests.set_description("enable verbose mode while unit testing");
    parser().add_option_handler(&m_verbose_unit_tests);

    m_benchmark_mode.add_name("--benchmark-mode");
    m_benchmark_mode.set_description("enable benchmark mode");
    parser().add_option_handler(&m_benchmark_mode);
}