User Tools

Site Tools


visual3d:tutorials:pipeline:meta_command_creation

This is an old revision of the document!


combining pipeline scripts into a meta-command

this is an example for creating a meta-command in visual3d.

1. suppose you have a pipeline script that generates a metric or some sort of result.

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.

(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:  
 prompt_for_pipeline_parameter_value  
 /pipeline_parameter_name=the_input_number  
 /prompt=pick a number!  
 ;  


script2.v3s: 
 set_pipeline_parameter  
 /parameter_name=output_text  
 /parameter_value_prefix=your number was...  
 /parameter_value=::the_input_number  
 ;  

here is a process to modify the scripts so that they work together:

  1. convert the second script to a meta-command
  1. save the new meta-command in the proper visual3d directory
  1. 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 pipeline_commands:meta_commands.

! begin_meta  
! meta_cmd_name=number_game 
! meta_param= the_num: string ::yes  
! end_meta 


set_pipeline_parameter 
/parameter_name=output_text 
/parameter_value_prefix=your number was... 
/parameter_value=::the_num 
; 
  

copy the file number_game.v3m to the meta-command directory: possibly: c:\program files (x86)\visual3d v5\ plugins\meta-commands


edit script1.v3s and change it to the following:

prompt_for_pipeline_parameter_value 
/pipeline_parameter_name=the_input_number 
/prompt=pick a number! 
; 
  
number_game 
/the_num=::the_input_number 
;
 

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.

visual3d/tutorials/pipeline/meta_command_creation.1718804384.txt.gz · Last modified: 2024/06/19 13:39 by sgranger