visual3d:tutorials:pipeline:meta_command_creation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:tutorials:pipeline:meta_command_creation [2024/06/19 12:55] – sgranger | visual3d:tutorials:pipeline:meta_command_creation [2025/07/09 18:16] (current) – sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== combining pipeline scripts into a meta-command | + | ====== Meta Command Creation ====== |
- | this is an example for creating | + | ==== Combining Pipeline Scripts into a Meta-Command ==== |
- | 1. suppose you have a pipeline script that generates a metric or some sort of result. | + | This is an example for creating |
- | 2. suppose | + | - Suppose you have a pipeline script that generates a metric or some sort of result. |
+ | - Suppose | ||
+ | - Finally suppose you are tired of calling two scripts and want to do it all at once | ||
- | 3. finally suppose you are tired of calling 2 scripts and want to do it all at once. | + | Here is an extremely simplistic example: \\ |
- | + | Script1 | |
- | \\ | + | |
- | here is an extremely simplistic example. script1 | + | |
- | + | ||
- | (note: naturally, these scripts will not run separated like this – the input value would have to be stored somewhere. using a call_script command also fails because it does not pass data.) | + | |
- | + | ||
- | \\ | + | |
+ | **Note:** Naturally, these scripts will not run separated like this – the input value would have to be stored somewhere. Using a Call_Script command also fails because it does not pass data. | ||
< | < | ||
- | script1.v3s: | + | Script1.v3s: |
- | prompt_for_pipeline_parameter_value | + | Prompt_For_Pipeline_Parameter_Value |
- | /pipeline_parameter_name=the_input_number | + | /PIPELINE_PARAMETER_NAME=the_input_number |
- | /prompt=pick a number! | + | /PROMPT=Pick a number! |
; | ; | ||
</ | </ | ||
- | |||
- | \\ | ||
- | |||
< | < | ||
- | script2.v3s: | + | Script2.v3s: |
- | set_pipeline_parameter | + | Set_Pipeline_Parameter |
- | /parameter_name=output_text | + | /PARAMETER_NAME=output_text |
- | /parameter_value_prefix=your number was... | + | /PARAMETER_VALUE_PREFIX=Your number was... |
- | /parameter_value=:: | + | /PARAMETER_VALUE=:: |
; | ; | ||
</ | </ | ||
- | here is a process to modify the scripts so that they work together:\\ | + | Here is a process to modify the scripts so that they work together: |
+ | - Convert the second script to a meta-command | ||
+ | - Save the new meta-command in the proper Visual3D directory | ||
+ | - Edit the first script to call the meta-command | ||
- | - convert the second script to a meta-command\\ | + | Edit **Script2.v3s** and change it to the following, and save it as **number_game.v3m**. |
- | + | Note that the meta-command syntax is simply a few lines as a header, and then changing any input parameter names to match. | |
- | - save the new meta-command in the proper visual3d directory\\ | + | |
- | + | ||
- | - edit the first script to call the meta-command\\ | + | |
- | + | ||
- | + | ||
- | \\ | + | |
- | edit **script2.v3s** and change it to the following, and save it as **number_game.v3m**. | + | |
< | < | ||
- | ! begin_meta | + | ! BEGIN_META |
- | ! meta_cmd_name=number_game | + | ! META_CMD_NAME=number_game |
- | ! meta_param= the_num: string :: | + | ! META_PARAM= THE_NUM: string :: |
- | ! end_meta | + | ! END_META |
- | set_pipeline_parameter | + | Set_Pipeline_Parameter |
- | /parameter_name=output_text | + | /PARAMETER_NAME=output_text |
- | /parameter_value_prefix=your number was... | + | /PARAMETER_VALUE_PREFIX=Your number was... |
- | /parameter_value=::the_num | + | /PARAMETER_VALUE=::THE_NUM |
; | ; | ||
| | ||
</ | </ | ||
- | copy the file **number_game.v3m** to the meta-command directory: | + | Copy the file **number_game.v3m** to the meta-command directory: |
- | + | Edit **Script1.v3s** and change it to the following: | |
- | \\ | + | |
- | edit **script1.v3s** and change it to the following: | + | |
< | < | ||
- | prompt_for_pipeline_parameter_value | + | Prompt_For_Pipeline_Parameter_Value |
- | /pipeline_parameter_name=the_input_number | + | /PIPELINE_PARAMETER_NAME=the_input_number |
- | /prompt=pick a number! | + | /PROMPT=Pick a number! |
; | ; | ||
| | ||
number_game | number_game | ||
- | /the_num=:: | + | /THE_NUM=:: |
; | ; | ||
</ | </ | ||
- | that’s it. restart visual3d | + | That’s it. Restart Visual3D |
- | note also that if you copy script1.v3s to c:\program files (x86)\visual3d | + | Note also that if you copy script1.v3s to C:\Program Files (x86)\Visual3D |
visual3d/tutorials/pipeline/meta_command_creation.1718801703.txt.gz · Last modified: 2024/06/19 12:55 by sgranger