User Tools

Site Tools


visual3d:tutorials:pipeline:meta_command_creation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:tutorials:pipeline:meta_command_creation [2024/06/19 12:55] sgrangervisual3d:tutorials:pipeline:meta_command_creation [2024/07/17 15:47] (current) – created sgranger
Line 1: Line 1:
-===== combining pipeline scripts into a meta-command =====+====== Meta Command Creation ======
  
-this is an example for creating meta-command in visual3d.+==== Combining Pipeline Scripts into Meta-Command ====
  
-1. suppose you have pipeline script that generates a metric or some sort of result.+This is an example for creating meta-command in Visual3D.
  
-2suppose also, that you have a second script that needs the result of the first script.+1Suppose you have a pipeline script that generates a metric or some sort of result.
  
-3. finally suppose you are tired of calling 2 scripts and want to do it all at once.+2. Suppose also, that you have a second script that needs the result of the first script. 
 + 
 +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 below prompts you to enter a number, and script2 prints it out.+Here is an extremely simplistic example. Script1 below prompts you to enter a number, and script2 prints it out.
  
-(notenaturally, these scripts will not run separated like this – the input value would have to be stored somewhere. using call_script command also fails because it does not pass data.)+(NoteNaturally, these scripts will not run separated like this – the input value would have to be stored somewhere. Using Call_Script command also fails because it does not pass data.)
  
 \\ \\
Line 18: Line 20:
  
 <code> <code>
- 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!  
  ;    ;  
 </code> </code>
Line 29: Line 31:
  
 <code> <code>
-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=::the_input_number  + /PARAMETER_VALUE=::the_input_number  
  ;    ;  
 </code> </code>
  
-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\\+  - Convert the second script to a meta-command\\
  
-  - save the new meta-command in the proper visual3d directory\\+  - Save the new meta-command in the proper Visual3D directory\\
  
-  - edit the first script to call the meta-command\\+  - 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**. //note that the meta-command syntax is simply a few lines as a header, and then changing any input parameter names to match. for the syntax of the header see [[visual3d:documentation:pipeline:meta_commands:meta_commands_overview|pipeline_commands:meta_commands]].//+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. For the syntax of the header see [[Visual3D:Documentation:Pipeline:Meta_Commands:Meta_Commands_Overview|Pipeline_Commands:Meta_Commands]].//
  
 <code> <code>
-begin_meta   +BEGIN_META   
-meta_cmd_name=number_game  +META_CMD_NAME=number_game  
-meta_paramthe_num: string ::yes   +META_PARAMTHE_NUM: string ::yes   
-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 
  
      
 </code> </code>
  
-copy the file **number_game.v3m** to the meta-command directory: possiblyc:\program files (x86)\visual3d v5\ plugins\meta-commands+Copy the file **number_game.v3m** to the meta-command directory: PossiblyC:\Program Files (x86)\Visual3D v5\ Plugins\Meta-Commands
  
 \\ \\
-edit **script1.v3s** and change it to the following:+Edit **Script1.v3s** and change it to the following:
  
 <code> <code>
-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_input_number +/THE_NUM=::the_input_number 
 ; ;
    
 </code> </code>
  
-that’s it. restart visual3d and run the new **script1.v3s**.+That’s it. Restart Visual3D and run the new **script1.v3s**.
  
-note also that if you copy script1.v3s to c:\program files (x86)\visual3d v5\plugins\scripts then the script will show up in the box on the workspace tab in visual3d for easy access.+Note also that if you copy script1.v3s to C:\Program Files (x86)\Visual3D v5\Plugins\Scripts then the script will show up in the box on the workspace tab in Visual3D for easy access.
  
  
  
visual3d/tutorials/pipeline/meta_command_creation.1718801703.txt.gz · Last modified: 2024/06/19 12:55 by sgranger