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/17 17:09] – removed sgranger | visual3d:tutorials:pipeline:meta_command_creation [2024/07/17 15:47] (current) – created sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Meta Command Creation ====== | ||
+ | |||
+ | ==== 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.) | ||
+ | |||
+ | \\ | ||
+ | |||
+ | |||
+ | < | ||
+ | | ||
+ | | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | |||
+ | < | ||
+ | Script2.v3s: | ||
+ | | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | 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\\ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | 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: | ||
+ | |||
+ | < | ||
+ | ! BEGIN_META | ||
+ | ! META_CMD_NAME=number_game | ||
+ | ! META_PARAM= THE_NUM: string :: | ||
+ | ! END_META | ||
+ | |||
+ | |||
+ | Set_Pipeline_Parameter | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | | ||
+ | </ | ||
+ | |||
+ | 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 | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | | ||
+ | number_game | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | </ | ||
+ | |||
+ | 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.1718644146.txt.gz · Last modified: 2024/06/17 17:09 by sgranger